-
-
Save hasherezade/328210a57464360e23e125929b62b301 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 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' | |
try: | |
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
s.connect(('127.0.0.1', 2222)) | |
s.send(key) | |
result = s.recv(512) | |
if result is not None: | |
print "[+] Response: " + result | |
s.close() | |
except socket.error: | |
print "Could not connect to the socket. Is the crackme running?" | |
if __name__ == "__main__": | |
sys.exit(main()) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment