Instantly share code, notes, and snippets.

@hasherezade / Secret
Created Nov 23, 2017

What would you like to do?
import socket
import sys
import argparse
def main():
parser = argparse.ArgumentParser(description="Send to the Crackme")
parser.add_argument('--key', dest="key", default="0xa2", help="The value to be sent")
args = parser.parse_args()
my_key = int(args.key, 16) % 255
print '[+] Checking the key: ' + hex(my_key)
key = chr(my_key) + '012'
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('', 2222))
result = s.recv(512)
if result is not None:
print "[+] Response: " + result
except socket.error:
print "Could not connect to the socket. Is the crackme running?"
if __name__ == "__main__":
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment