#!/usr/bin/python
# TCP Exploit Skeleton
# Und3rf10w 
import socket
from sys import exit,argv

if len(argv) < 2:
	print  "UNDEF-TODO: TCP Exploit Skeleton"
	print "Usage: %s <Target IP Address/hostname> <Target Port>" % str(argv[0])
	exit(0)

# Buffer Goes here
buffer""

try:
	print "Attacking %s:%s" % (str(argv[1]),int(argv[2]))
	s=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
	connect=s.connect((str(argv[1]),int(argv[2])))
	# This next part depends on whatever the RFC is for what you're trying to 
	# exploit. Up to you to put the 'string' in the right place. Be sure to
	# receive bytes after sending anything.
	s.recv(1024) # Grab the banner, do not remove
	s.send(string + "\r\n") # Sends your evil buffer as 'string'
	s.send('QUIT\r\n') # Replace 'QUIT' with whatever ends your session
	s.close()
except:
	print "ERROR: socket() failed"
	exit(1)

