Skip to content

Instantly share code, notes, and snippets.

@tjt263
Last active March 16, 2016 16:02
Show Gist options
  • Save tjt263/9fb5096a564312d741ed to your computer and use it in GitHub Desktop.
Save tjt263/9fb5096a564312d741ed to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import socket
target_host = raw_input("target host: ")
target_port = int(raw_input("target port: "))
# create a socket object
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# connect the client
client.connect((target_host, target_port))
# send some data
client.send(raw_input("> "))
# receive some data
response = client.recv(4096)
print response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment