Created
March 16, 2016 14:19
-
-
Save tjt263/e7a30379367737d0ac5f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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