walloftext/hack.py

45 lines
1.4 KiB
Python
Raw Normal View History

2015-05-25 20:20:42 +02:00
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"
])