import socket 

host = socket.gethostname()
port = 9337

sock_ = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
sock_.bind((host,port))
sock_.listen(1)

print("\nServer started...\n")

conn,addr = sock_.accept()

print("Connection established with: ",str(addr))

message = "\nThank you for connecting "+str(addr)
conn.send(message.encode("ascii"))
conn.close()import hashlib
import argparse

parser = argparse.ArgumentParser(description="MD5 Cracker")
parser.add_argument("-md5", dest="hash", help="md5 hash", required=True)
parser.add_argument("-w", dest="wordlist", help="wordlist", required=True)
parsed_args = parser.parse_args()

def main(): 
    hash_cracked = ""
    with open(parsed_args.wordlist) as file:
        for line in file:
            line = line.strip()
            if hashlib.md5(bytes(line,encoding="utf-8")).hexdigest() == parsed_args.hash:
                hash_cracked = line
                print("\nMD5-hash has been successfully cracked. The value is %s."%line)
    if hash_cracked == "":
        print("\nFailed to crack the hash. Try using a bigger/different dictionary.")

if __name__ == "__main__":
    main()