From 99e83434a26738af7b0ef32be70e4f286e386d5c Mon Sep 17 00:00:00 2001 From: Madmaurice Date: Mon, 25 May 2015 20:20:42 +0200 Subject: [PATCH] First commit. --- hack.py | 44 ++++++++++++++++++++++++++++++++++++++++++++ redcode.py | 19 +++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100755 hack.py create mode 100644 redcode.py diff --git a/hack.py b/hack.py new file mode 100755 index 0000000..50f2f87 --- /dev/null +++ b/hack.py @@ -0,0 +1,44 @@ +from random import shuffle, choice, randint +from time import sleep +from sys import stdout +from os import listdir, path + +def p(t): + stdout.write(t) + stdout.flush() + +RED='\033[91m' +GREEN='\033[92m' +RESET='\033[0m' + +def runhack(f): + while True: + t = choice(f) + s = ("%-70s" % (t()+".....") ) + p(s) + sleep(randint(1,20)/10.0) + + fail = (randint(1,5)==1) + while fail: + p("["+RED+"FAIL"+RESET+"]\n") + p(s) + sleep(randint(1,20)/10.0) + fail = (randint(1,5)==1) + + p("["+GREEN+"DONE"+RESET+"]\n") + +if __name__ == "__main__": + runhack([ + lambda: "Tracing IP %d.%d.%d.%d" % (randint(10,192), randint(0,254), randint(0,254), randint(1,70) ), + lambda: "Exploiting Port %d" % randint(5,1024), + lambda: "Reroute it to the spaghetti. Keep it in the loop", + lambda: "Crack Steam-powered defense system", + lambda: "Starting internet explorer", + lambda: "Trying exploit 0x%X" % (randint(0,2**16)), + lambda: ("Injecting red code into %s") % (lambda p: choice(list(filter(lambda e: path.isfile(e), [path.join(p,f) for f in listdir(p)]))))("/etc"), + lambda: "Encrypting code", + lambda: "Collect user hashes", + lambda: "Connect to %s" % choice(["nsa.gov", "fbi.gov", "whitehouse.gov", "facebook.com", "zom.bi"]), + lambda: "Hacking" + ]) + diff --git a/redcode.py b/redcode.py new file mode 100644 index 0000000..ee54050 --- /dev/null +++ b/redcode.py @@ -0,0 +1,19 @@ +from random import randint, choice +from sys import stdout +from time import sleep + +RED='\033[31m' +GREEN='\033[32m' +YELLOW='\033[33m' +BLUE='\033[34m' +WHITE='\033[37m' + +colors = [ RED, GREEN, GREEN ] + +while True: + if randint(0,99) < 30: + stdout.write(choice(colors)) + stdout.write('%X' % randint(0,15)) + stdout.flush() + sleep(0.005) +