Created
April 7, 2018 03:47
-
-
Save neo-32/3c0285d9d67db0c44a81b79bb3a844b5 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
import telnetlib | |
import re | |
import binascii | |
import time | |
tn = telnetlib.Telnet('hosthere',23) | |
xstring = tn.read_until('string') | |
binstring = re.search('of ([0|1]+)',xstring).group(1) | |
number = int(binstring,2) | |
result = binascii.unhexlify('%x' % number) | |
tn.write(result) | |
print result | |
tn.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment