Added text from Hackerman, because he's the greatest hacker, also the done and fail aligns to the terminal width

This commit is contained in:
madmaurice 2015-06-01 03:33:46 +02:00
parent 99e83434a2
commit 1dcd677689

50
hack.py
View file

@ -1,7 +1,12 @@
#!/usr/bin/env python3
from random import shuffle, choice, randint
from time import sleep
from sys import stdout
from os import listdir, path
from os import listdir, path, popen
def gettermsize():
_, columns = popen('stty size','r').read().split()
return int(columns)
def p(t):
stdout.write(t)
@ -13,15 +18,17 @@ RESET='\033[0m'
def runhack(f):
while True:
tw = gettermsize()-10
tws=("%d" % tw)
t = choice(f)
s = ("%-70s" % (t()+".....") )
s = ( ("%-"+tws+"s") % ("> "+t()+".....") )
p(s)
sleep(randint(1,20)/10.0)
sleep(randint(1,5)/10.0)
fail = (randint(1,5)==1)
while fail:
p("["+RED+"FAIL"+RESET+"]\n")
p(s)
p( ("%-"+tws+"s") % "")
sleep(randint(1,20)/10.0)
fail = (randint(1,5)==1)
@ -39,6 +46,39 @@ if __name__ == "__main__":
lambda: "Encrypting code",
lambda: "Collect user hashes",
lambda: "Connect to %s" % choice(["nsa.gov", "fbi.gov", "whitehouse.gov", "facebook.com", "zom.bi"]),
lambda: "Hacking"
lambda: "Hacking",
lambda: "Initializing startup",
lambda: "Linking graphic card",
lambda: "Handling core optimization",
lambda: "Charging Processor core",
lambda: "Catalyst field enabled",
lambda: "Receiver error check",
lambda: "Self-diagnosis",
lambda: "Loading data",
lambda: "Resizing data",
lambda: "Setting cpu clock to %.2f Ghz" % (randint(80,390)/100.0),
lambda: "Setting ethernet data rate to %d Mbit/s" % (randint(300,10000)),
lambda: "Authorizing connection",
lambda: "Starting optimization processors",
lambda: "Connecting to uplink drive",
lambda: "Loading modem driver v%d.%03d" % (randint(0,2), randint(0,999)),
lambda: "Linking to Mainframe",
lambda: "Extracting data column %d using visual objects" % (randint(101,20987)),
lambda: "Monitor mode on",
lambda: "Testing link online on port %d" % randint(1024,65563),
lambda: "Aux baud rate set to %d" % randint(1,30),
lambda: "Write control mode",
lambda: "Inserting parameters",
lambda: "Bypassing kernel",
lambda: "Verifying attributes",
lambda: "Activating hacking stealth mode",
lambda: "Hiding proxy",
lambda: "Deploying core terminal script",
lambda: "Decoding anti hacking software",
lambda: "Changing root passwords",
lambda: "Encrypting passwords",
lambda: "Connecting core grid to system",
lambda: "Loading space time information",
lambda: "Establishing link to all systems",
])