Skip to content

Instantly share code, notes, and snippets.

@c1b3rh4ck c1b3rh4ck/core.py
Created Sep 22, 2014

Embed
What would you like to do?
Core for ctfinfobot.
#!/usr/bin/python
#ctf infobot BarcampSE Pereira 2013
#colors and core :)
import os, sys
import string
import random
fwpath = os.getcwd()
sys.path.append(fwpath+"src")
# Location for logs, modules and storage
ActivityLog = ("Logs")
# Pretty colors
reset = '\x1b[0m' # reset all colors to white on black
bold = '\x1b[1m' # enable bold text
uline = '\x1b[4m' # enable underlined text
nobold = '\x1b[22m' # disable bold text
nouline = '\x1b[24m' # disable underlined text
red = '\x1b[31m' # red text
green = '\x1b[32m' # green text
blue = '\x1b[34m' # blue text
cyan = '\x1b[36m' # cyan text
white = '\x1b[37m' # white text (use reset unless it's only temporary)
warning = "%s[!]%s" % (red, reset)
info = "%s[*]%s" % (green, reset)
def warning(msg):
print("%s%s[%s!%s]%s %s " % (bold, red, white, red, reset, msg))
def status(msg):
print("%s[~]%s %s " % (bold, reset, msg))
def title(msg):
print("%s %s %s" % (uline, msg, reset))
def info(msg):
print("%s[*]%s %s " % (bold, reset, msg))
# catch for ctrl+c so we can exit smoothly
def signalHandler(signal, frame):
warning("Ctrl-C caught, Shutting down now!")
logging.info("[!] Ctrl+C signal caught. Shutting down Intersect!")
def banner():
target = random.randrange(1,3)
if target == 1:
print """%s%s
____ ___ ___ __
/ _/__ / _/__ / _ )___ / /_
_/ // _ \/ _/ _ \/ _ / _ \/ __/
/___/_//_/_/ \___/____/\___/\__/
%sBarcampSE Pereira v4.0%s
""" % (bold, blue, white, reset)
elif target == 2:
print """%s%s
.d88b w d8b 888 d8b 888b. w
8P w8ww 8' 8 8d8b. 8' .d8b. 8wwwP .d8b. w8ww
8b 8 w8ww 8 8P Y8 w8ww 8' .8 8 b 8' .8 8
`Y88P Y8P 8 888 8 8 8 `Y8P' 888P' `Y8P' Y8P
%sBarcampSE Pereira v4.0 %s
""" % (bold, green, white, reset)
elif target == 3:
print """%s%s
__ ____/_ /___ __/___ _/_________ __/________ __ )_______ /_
_ / _ __/_ /_ __ / __ __ \_ /_ _ __ \_ __ | __ \ __/
/ /___ / /_ _ __/ __/ / _ / / / __/ / /_/ / /_/ // /_/ / /_
\____/ \__/ /_/ /___/ /_/ /_//_/ \____//_____/ \____/\__/ %sBarcampSE Pereira v4.0%s
""" % (bold, green, white, reset)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.