Example #1
0
    def remove_section(self, section):
        if not self.config.config.has_section(section):
            print red("Section %s does not exist" % section)
            return

        self.config.remove_section(section)
        print blue("Successfully removed section %s" % section, readline=True)
Example #2
0
    def save_key(self, passphrase):
        f = open(self.keyname, "wb")

        if passphrase is None or not passphrase:
            response = raw_input(
                red("No password provided - Enter a password? ([y]/n): ",
                    readline=True)).strip().lower()

            if response == "y":

                while True:

                    passphrase = getpass(
                        bold(magenta("Password: "******"Confirm password: "******"Passwords don't match! Please try again.\n",
                                readline=True))
                    else:
                        break

        f.write(self.key.exportKey(
            format=self.format,
            passphrase=passphrase,
        ))

        f.close()
Example #3
0
 def remove_option(self, section, option):
     if not self.config.config.has_option(section, option):
         print red("Section '%s' has no option '%s' to remove" %
                   (section, option),
                   readline=True)
         return
     self.config.config.remove_option(section, option)
     print blue("Successfully removed '%s' from '%s'" % (option, section),
                readline=True)
Example #4
0
    def _configure(self, config):

        for section in config.sections():
            print red("Configuring %s" % section, readline=True)
            for option, value in config.items(section):
                entry = raw_input(
                    bold(magenta(
                        "\t[%s] (default currently '%s'): " % (
                            option,
                            str(value)
                        ),
                        readline=True
                    ))
                )
                if entry:
                    value = entry
                if not value:
                    value = "NOT SET"
                config.set(section, option, value)
Example #5
0
    def __init__(self, config):
        self.config = config
        self.host_url = "http://updates.maxmind.com"
        self.fnames_url = "%s/app/update_getfilename" % self.host_url
        self.ipaddr_url = "%s/app/update_getipaddr" % self.host_url
        self.update_url = "%s/app/update_secure" % self.host_url
        self.db_path = "%s/geo_db" % TS_DIR
        self.db_hashes = {}

        self.v1_asnum = "%s/GeoLiteASNum.dat" % self.db_path
        self.v1_city = "%s/GeoLiteCity.dat" % self.db_path
        self.v1_country = "%s/GeoLiteCountry.dat" % self.db_path

        self.g1_asnum_reader = None
        self.g1_city_reader = None
        self.g1_country_reader = None

        self.have_db_files = True

        if not os.path.exists(self.db_path):
            value = raw_input(
                bold(
                    red("Geolocation databases not found. Would you like " +
                        "to download them now ([yes]/no)?: ")))

            value = value.strip().upper()
            if (value == "NO" or value == "N"):
                self.have_db_files = False
            else:
                os.mkdir(self.db_path)
                self.update()

        else:

            db_files = glob.glob("%s/*" % self.db_path)

            for db_file in db_files:

                db_data = open(db_file).read()
                db_hash = md5(db_data).hexdigest()

                db_file = db_file.split(os.path.sep)[-1]

                self.db_hashes[db_file] = db_hash

            if db_files:
                self._init_readers()
Example #6
0
    def emit(self, record):

        colored = copy.copy(record)

        if record.levelname == "WARNING":
            colored.msg = yellow(record.msg)

        elif record.levelname in ["ERROR", "CRITICAL", "FATAL"]:
            colored.msg = red(record.msg)

        elif record.levelname == "INFO":
            colored.msg = green(record.msg)

        else:
            colored.msg = cyan(record.msg)

        logging.StreamHandler.emit(self, colored)
Example #7
0
    def __init__(self, config_file="threatshell.ini"):
        """
        @param config_file - a config file name to read or write

        throws IOException if reading the config file fails
        """

        aes_key = os.path.join(TS_DIR, "aes_key.enc")
        rsa_key = os.path.join(TS_DIR, "conf_key.pem")

        self.target_path = os.path.join(TS_DIR, config_file)
        config_path = self.target_path
        edit_path = os.path.join(TS_DIR, "threatshell.txt")

        config = None

        if not os.path.exists(config_path):

            print red(
                (
                    "\nThis appears to be the first time you've ran " +
                    "threatshell. Let's load the config defaults, then you " +
                    "can setup the appropriate values. Make sure to have " +
                    "your API keys handy ;)\n\n"
                ),
                readline=True
            )
            config_path = os.path.join(TS_ROOT, "conf", "defaults.ini")
            key_maker = KeyMaker(rsa_key, "PEM", 2048)

            print "\n"
            print bold(
                red(
                    "Building RSA key for encrypted config",
                    readline=True
                ),
                readline=True
            )
            key_maker.generate_key()

            while True:

                passphrase = getpass(
                    bold(
                        magenta("RSA key passphrase: ", readline=True),
                        readline=True
                    )
                )

                if passphrase:

                    confirm = getpass(
                        bold(
                            magenta("RSA key passphrase: ", readline=True),
                            readline=True
                        )
                    )

                    if passphrase != confirm:
                        print bold(
                            red(
                                "Passwords do not match! Please try again.\n",
                                readline=True
                            ),
                            readline=True
                        )
                    else:
                        break
                else:
                    break

            key_maker.save_key(passphrase)

            config = EncryptedConfigParser(
                allow_no_value=True,
                aes_key=aes_key,
                private_key=rsa_key
            )

            read = config.read_raw(config_path)
            if not read:
                raise IOError("Failed to read config file '%s'" % config_path)
            self._configure(config)
            config.write(outfile=self.target_path)
            print red(
                "\n\nConfiguration complete - Happy hunting!",
                readline=True
            )

        elif os.path.exists(edit_path):
            config = EncryptedConfigParser(
                allow_no_value=True,
                aes_key=aes_key,
                private_key=rsa_key
            )
            print magenta(
                "Found decrypted config file - loading and encrypting...",
                readline=True
            )
            read = config.read_raw(edit_path)
            if not read:
                raise IOError("Failed to read config file '%s'" % edit_path)
            config.write(outfile=self.target_path)
            os.unlink(edit_path)

        else:
            config = EncryptedConfigParser(
                allow_no_value=True,
                aes_key=aes_key,
                private_key=rsa_key
            )
            config.read(self.target_path)

        self.config = config
Example #8
0
    def set_option(self, section, option, value):
        """
        Creates or overwrites existing options

        @param section - the config section name that will contain the option
        @param option - the name of the option to create or modify
        @param value - the value for the given option to have
        """
        if section not in self.config.sections():
            resp = raw_input(
                bold(
                    magenta(
                        "Section %s does not exist. Create? (y/[n]): " % (
                            section
                        ),
                        readline=True
                    ),
                    readline=True
                )
            )
            if not resp or resp.lower() == "n":
                print red("Opted out of creating new section", readline=True)
                return
            else:
                self.config.add_section(section)
                self.config.set(section, option, value)
                print blue(
                    "Added '%s' -> '%s' to new section '%s'" % (
                        option,
                        value,
                        section
                    ),
                    readline=True
                )
                return

        if not self.config.has_option(section, option):
            resp = raw_input(
                bold(
                    magenta(
                        "%s does not have option %s. Create? (y/[n]): " % (
                            section,
                            option
                        ),
                        readline=True
                    ),
                    readline=True
                )
            )
            if not resp or resp.lower() == "n":
                print red("Opted out of creating new option", readline=True)
            else:
                self.config.set(section, option, value)
                print blue(
                    "Successfully added '%s' -> '%s'" % (
                        section,
                        option
                    ),
                    readline=True
                )

        else:
            self.config.set(section, option, value)
Example #9
0
def logo():

    logos = []

    logos.append(r"""
            ,----,
          ,/   .`|
        ,`   .'  :  ,---,                                     ___              .--.--.     ,---,                ,--,    ,--,
      ;    ;     /,--.' |                                   ,--.'|_           /  /    '. ,--.' |              ,--.'|  ,--.'|
    .'___,/    ,' |  |  :      __  ,-.                      |  | :,'         |  :  /`. / |  |  :              |  | :  |  | :
    |    :     |  :  :  :    ,' ,'/ /|                      :  : ' :         ;  |  |--`  :  :  :              :  : '  :  : '
    ;    |.';  ;  :  |  |,--.'  | |' | ,---.     ,--.--.  .;__,'  /          |  :  ;_    :  |  |,--.   ,---.  |  ' |  |  ' |
    `----'  |  |  |  :  '   ||  |   ,'/     \   /       \ |  |   |            \  \    `. |  :  '   |  /     \ '  | |  '  | |
        '   :  ;  |  |   /' :'  :  / /    /  | .--.  .-. |:__,'| :             `----.   \|  |   /' : /    /  ||  | :  |  | :
        |   |  '  '  :  | | ||  | ' .    ' / |  \__\/: . .  '  : |__           __ \  \  |'  :  | | |.    ' / |'  : |__'  : |__
        '   :  |  |  |  ' | :;  : | '   ;   /|  ," .--.; |  |  | '.'|         /  /`--'  /|  |  ' | :'   ;   /||  | '.'|  | '.'|
        ;   |.'   |  :  :_:,'|  , ; '   |  / | /  /  ,.  |  ;  :    ;        '--'.     / |  :  :_:,''   |  / |;  :    ;  :    ;
        '---'     |  | ,'     ---'  |   :    |;  :   .'   \ |  ,   /           `--'---'  |  | ,'    |   :    ||  ,   /|  ,   /
                  `--''              \   \  / |  ,     .-./  ---`-'                      `--''       \   \  /  ---`-'  ---`-'
                                      `----'   `--`---'                                               `----'

    """)

    logos.append(r"""
     _____  _     ____  _____ ____  _____    ____  _     _____ _     _
    /__ __\/ \ /|/  __\/  __//  _ \/__ __\  / ___\/ \ /|/  __// \   / \
      / \  | |_|||  \/||  \  | / \|  / \    |    \| |_|||  \  | |   | |
      | |  | | |||    /|  /_ | |-||  | |    \___ || | |||  /_ | |_/\| |_/\
      \_/  \_/ \|\_/\_\\____\\_/ \|  \_/    \____/\_/ \|\____\\____/\____/

    """)

    logos.append(r"""
     /$$$$$$$$ /$$                                       /$$            /$$$$$$  /$$                 /$$ /$$
    |__  $$__/| $$                                      | $$           /$$__  $$| $$                | $$| $$
       | $$   | $$$$$$$   /$$$$$$   /$$$$$$   /$$$$$$  /$$$$$$        | $$  \__/| $$$$$$$   /$$$$$$ | $$| $$
       | $$   | $$__  $$ /$$__  $$ /$$__  $$ |____  $$|_  $$_/        |  $$$$$$ | $$__  $$ /$$__  $$| $$| $$
       | $$   | $$  \ $$| $$  \__/| $$$$$$$$  /$$$$$$$  | $$           \____  $$| $$  \ $$| $$$$$$$$| $$| $$
       | $$   | $$  | $$| $$      | $$_____/ /$$__  $$  | $$ /$$       /$$  \ $$| $$  | $$| $$_____/| $$| $$
       | $$   | $$  | $$| $$      |  $$$$$$$|  $$$$$$$  |  $$$$/      |  $$$$$$/| $$  | $$|  $$$$$$$| $$| $$
       |__/   |__/  |__/|__/       \_______/ \_______/   \___/         \______/ |__/  |__/ \_______/|__/|__/

    """)

    logos.append(r"""
      _______ _                    _      _____ _          _ _
     |__   __| |                  | |    / ____| |        | | |
        | |  | |__  _ __ ___  __ _| |_  | (___ | |__   ___| | |
        | |  | '_ \| '__/ _ \/ _` | __|  \___ \| '_ \ / _ \ | |
        | |  | | | | | |  __/ (_| | |_   ____) | | | |  __/ | |
        |_|  |_| |_|_|  \___|\__,_|\__| |_____/|_| |_|\___|_|_|

    """)

    logos.append(r"""
     ____  _   _  ____  ____    __   ____    ___  _   _  ____  __    __
    (_  _)( )_( )(  _ \( ___)  /__\ (_  _)  / __)( )_( )( ___)(  )  (  )
      )(   ) _ (  )   / )__)  /(__)\  )(    \__ \ ) _ (  )__)  )(__  )(__
     (__) (_) (_)(_)\_)(____)(__)(__)(__)   (___/(_) (_)(____)(____)(____)

     """)

    logos.append(r"""
    .------..------..------..------..------..------.     .------..------..------..------..------.
    |T.--. ||H.--. ||R.--. ||E.--. ||A.--. ||T.--. |.-.  |S.--. ||H.--. ||E.--. ||L.--. ||L.--. |
    | :/\: || :/\: || :(): || (\/) || (\/) || :/\: ((5)) | :/\: || :/\: || (\/) || :/\: || :/\: |
    | (__) || (__) || ()() || :\/: || :\/: || (__) |'-.-.| :\/: || (__) || :\/: || (__) || (__) |
    | '--'T|| '--'H|| '--'R|| '--'E|| '--'A|| '--'T| ((1)) '--'S|| '--'H|| '--'E|| '--'L|| '--'L|
    `------'`------'`------'`------'`------'`------'  '-'`------'`------'`------'`------'`------'
    """)

    logos.append(r"""
      _____    _   _    ____    U _____ u    _       _____        ____     _   _  U _____ u  _       _
     |_ " _|  |'| |'|U |  _"\ u \| ___"|/U  /"\  u  |_ " _|      / __"| u |'| |'| \| ___"|/ |"|     |"|
       | |   /| |_| |\\| |_) |/  |  _|"   \/ _ \/     | |       <\___ \/ /| |_| |\ |  _|" U | | u U | | u
      /| |\  U|  _  |u |  _ <    | |___   / ___ \    /| |\       u___) | U|  _  |u | |___  \| |/__ \| |/__
     u |_|U   |_| |_|  |_| \_\   |_____| /_/   \_\  u |_|U       |____/>> |_| |_|  |_____|  |_____| |_____|
     _// \\_  //   \\  //   \\_  <<   >>  \\    >>  _// \\_       )(  (__)//   \\  <<   >>  //  \\  //  \\
    (__) (__)(_") ("_)(__)  (__)(__) (__)(__)  (__)(__) (__)     (__)    (_") ("_)(__) (__)(_")("_)(_")("_)

    """)

    logos.append(r"""
                                         (
      *   )    )                     )   )\ )    )       (   (
    ` )  /( ( /(  (      (     )  ( /(  (()/( ( /(    (  )\  )\
     ( )(_)))\()) )(    ))\ ( /(  )\())  /(_)))\())  ))\((_)((_)
    (_(_())((_)\ (()\  /((_))(_))(_))/  (_)) ((_)\  /((_)_   _
    |_   _|| |(_) ((_)(_)) ((_)_ | |_   / __|| |(_)(_)) | | | |
      | |  | ' \ | '_|/ -_)/ _` ||  _|  \__ \| ' \ / -_)| | | |
      |_|  |_||_||_|  \___|\__,_| \__|  |___/|_||_|\___||_| |_|

    """)

    logos.append(r"""
    ___________.__                          __      _________.__           .__  .__
    \__    ___/|  |_________   ____ _____ _/  |_   /   _____/|  |__   ____ |  | |  |
      |    |   |  |  \_  __ \_/ __ \\__  \\   __\  \_____  \ |  |  \_/ __ \|  | |  |
      |    |   |   Y  \  | \/\  ___/ / __ \|  |    /        \|   Y  \  ___/|  |_|  |__
      |____|   |___|  /__|    \___  >____  /__|   /_______  /|___|  /\___  >____/____/
                    \/            \/     \/               \/      \/     \/
    """)

    logos.append(r"""
     ___________  __    __    _______    _______       __  ___________       ________  __    __    _______  ___      ___
    ("     _   ")/" |  | "\  /"      \  /"     "|     /""\("     _   ")     /"       )/" |  | "\  /"     "||"  |    |"  |
     )__/  \\__/(:  (__)  :)|:        |(: ______)    /    \)__/  \\__/     (:   \___/(:  (__)  :)(: ______)||  |    ||  |
        \\_ /    \/      \/ |_____/   ) \/    |     /' /\  \  \\_ /         \___  \   \/      \/  \/    |  |:  |    |:  |
        |.  |    //  __  \\  //      /  // ___)_   //  __'  \ |.  |          __/  \\  //  __  \\  // ___)_  \  |___  \  |___
        \:  |   (:  (  )  :)|:  __   \ (:      "| /   /  \\  \\:  |         /" \   :)(:  (  )  :)(:      "|( \_|:  \( \_|:  \
         \__|    \__|  |__/ |__|  \___) \_______)(___/    \___)\__|        (_______/  \__|  |__/  \_______) \_______)\_______)

    """)

    logos.append(r"""
    ████████╗██╗  ██╗██████╗ ███████╗ █████╗ ████████╗    ███████╗██╗  ██╗███████╗██╗     ██╗
    ╚══██╔══╝██║  ██║██╔══██╗██╔════╝██╔══██╗╚══██╔══╝    ██╔════╝██║  ██║██╔════╝██║     ██║
       ██║   ███████║██████╔╝█████╗  ███████║   ██║       ███████╗███████║█████╗  ██║     ██║
       ██║   ██╔══██║██╔══██╗██╔══╝  ██╔══██║   ██║       ╚════██║██╔══██║██╔══╝  ██║     ██║
       ██║   ██║  ██║██║  ██║███████╗██║  ██║   ██║       ███████║██║  ██║███████╗███████╗███████╗
       ╚═╝   ╚═╝  ╚═╝╚═╝  ╚═╝╚══════╝╚═╝  ╚═╝   ╚═╝       ╚══════╝╚═╝  ╚═╝╚══════╝╚══════╝╚══════╝

    """.decode("utf-8"))

    logos.append(r"""
    ▄▄▄█████▓ ██░ ██  ██▀███  ▓█████ ▄▄▄     ▄▄▄█████▓     ██████  ██░ ██ ▓█████  ██▓     ██▓
    ▓  ██▒ ▓▒▓██░ ██▒▓██ ▒ ██▒▓█   ▀▒████▄   ▓  ██▒ ▓▒   ▒██    ▒ ▓██░ ██▒▓█   ▀ ▓██▒    ▓██▒
    ▒ ▓██░ ▒░▒██▀▀██░▓██ ░▄█ ▒▒███  ▒██  ▀█▄ ▒ ▓██░ ▒░   ░ ▓██▄   ▒██▀▀██░▒███   ▒██░    ▒██░
    ░ ▓██▓ ░ ░▓█ ░██ ▒██▀▀█▄  ▒▓█  ▄░██▄▄▄▄██░ ▓██▓ ░      ▒   ██▒░▓█ ░██ ▒▓█  ▄ ▒██░    ▒██░
      ▒██▒ ░ ░▓█▒░██▓░██▓ ▒██▒░▒████▒▓█   ▓██▒ ▒██▒ ░    ▒██████▒▒░▓█▒░██▓░▒████▒░██████▒░██████▒
      ▒ ░░    ▒ ░░▒░▒░ ▒▓ ░▒▓░░░ ▒░ ░▒▒   ▓▒█░ ▒ ░░      ▒ ▒▓▒ ▒ ░ ▒ ░░▒░▒░░ ▒░ ░░ ▒░▓  ░░ ▒░▓  ░
        ░     ▒ ░▒░ ░  ░▒ ░ ▒░ ░ ░  ░ ▒   ▒▒ ░   ░       ░ ░▒  ░ ░ ▒ ░▒░ ░ ░ ░  ░░ ░ ▒  ░░ ░ ▒  ░
      ░       ░  ░░ ░  ░░   ░    ░    ░   ▒    ░         ░  ░  ░   ░  ░░ ░   ░     ░ ░     ░ ░
              ░  ░  ░   ░        ░  ░     ░  ░                 ░   ░  ░  ░   ░  ░    ░  ░    ░  ░

    """.decode("utf-8"))

    logos.append(r"""
        ███        ▄█    █▄       ▄████████    ▄████████    ▄████████     ███             ▄████████    ▄█    █▄       ▄████████  ▄█        ▄█
    ▀█████████▄   ███    ███     ███    ███   ███    ███   ███    ███ ▀█████████▄        ███    ███   ███    ███     ███    ███ ███       ███
       ▀███▀▀██   ███    ███     ███    ███   ███    █▀    ███    ███    ▀███▀▀██        ███    █▀    ███    ███     ███    █▀  ███       ███
        ███   ▀  ▄███▄▄▄▄███▄▄  ▄███▄▄▄▄██▀  ▄███▄▄▄       ███    ███     ███   ▀        ███         ▄███▄▄▄▄███▄▄  ▄███▄▄▄     ███       ███
        ███     ▀▀███▀▀▀▀███▀  ▀▀███▀▀▀▀▀   ▀▀███▀▀▀     ▀███████████     ███          ▀███████████ ▀▀███▀▀▀▀███▀  ▀▀███▀▀▀     ███       ███
        ███       ███    ███   ▀███████████   ███    █▄    ███    ███     ███                   ███   ███    ███     ███    █▄  ███       ███
        ███       ███    ███     ███    ███   ███    ███   ███    ███     ███             ▄█    ███   ███    ███     ███    ███ ███▌    ▄ ███▌    ▄
       ▄████▀     ███    █▀      ███    ███   ██████████   ███    █▀     ▄████▀         ▄████████▀    ███    █▀      ██████████ █████▄▄██ █████▄▄██
                                 ███    ███                                                                                     ▀         ▀
    """.decode("utf-8"))

    logos.append(r"""
     ▄▄▄▄▄▄▄▄▄▄▄  ▄         ▄  ▄▄▄▄▄▄▄▄▄▄▄  ▄▄▄▄▄▄▄▄▄▄▄  ▄▄▄▄▄▄▄▄▄▄▄  ▄▄▄▄▄▄▄▄▄▄▄       ▄▄▄▄▄▄▄▄▄▄▄  ▄         ▄  ▄▄▄▄▄▄▄▄▄▄▄  ▄            ▄
    ▐░░░░░░░░░░░▌▐░▌       ▐░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌     ▐░░░░░░░░░░░▌▐░▌       ▐░▌▐░░░░░░░░░░░▌▐░▌          ▐░▌
     ▀▀▀▀█░█▀▀▀▀ ▐░▌       ▐░▌▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀█░▌ ▀▀▀▀█░█▀▀▀▀      ▐░█▀▀▀▀▀▀▀▀▀ ▐░▌       ▐░▌▐░█▀▀▀▀▀▀▀▀▀ ▐░▌          ▐░▌
         ▐░▌     ▐░▌       ▐░▌▐░▌       ▐░▌▐░▌          ▐░▌       ▐░▌     ▐░▌          ▐░▌          ▐░▌       ▐░▌▐░▌          ▐░▌          ▐░▌
         ▐░▌     ▐░█▄▄▄▄▄▄▄█░▌▐░█▄▄▄▄▄▄▄█░▌▐░█▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄█░▌     ▐░▌          ▐░█▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄█░▌▐░█▄▄▄▄▄▄▄▄▄ ▐░▌          ▐░▌
         ▐░▌     ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌     ▐░▌          ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░▌          ▐░▌
         ▐░▌     ▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀█░█▀▀ ▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀█░▌     ▐░▌           ▀▀▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀▀▀ ▐░▌          ▐░▌
         ▐░▌     ▐░▌       ▐░▌▐░▌     ▐░▌  ▐░▌          ▐░▌       ▐░▌     ▐░▌                    ▐░▌▐░▌       ▐░▌▐░▌          ▐░▌          ▐░▌
         ▐░▌     ▐░▌       ▐░▌▐░▌      ▐░▌ ▐░█▄▄▄▄▄▄▄▄▄ ▐░▌       ▐░▌     ▐░▌           ▄▄▄▄▄▄▄▄▄█░▌▐░▌       ▐░▌▐░█▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄▄▄
         ▐░▌     ▐░▌       ▐░▌▐░▌       ▐░▌▐░░░░░░░░░░░▌▐░▌       ▐░▌     ▐░▌          ▐░░░░░░░░░░░▌▐░▌       ▐░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌
          ▀       ▀         ▀  ▀         ▀  ▀▀▀▀▀▀▀▀▀▀▀  ▀         ▀       ▀            ▀▀▀▀▀▀▀▀▀▀▀  ▀         ▀  ▀▀▀▀▀▀▀▀▀▀▀  ▀▀▀▀▀▀▀▀▀▀▀  ▀▀▀▀▀▀▀▀▀▀▀

    """.decode("utf-8"))

    logos.append(r"""
     ********** **                                 **          ******** **               **  **
    /////**/// /**                                /**         **////// /**              /** /**
        /**    /**      ******  *****   ******   ******      /**       /**       *****  /** /**
        /**    /****** //**//* **///** //////** ///**/       /*********/******  **///** /** /**
        /**    /**///** /** / /*******  *******   /**        ////////**/**///**/******* /** /**
        /**    /**  /** /**   /**////  **////**   /**               /**/**  /**/**////  /** /**
        /**    /**  /**/***   //******//********  //**        ******** /**  /**//****** *** ***
        //     //   // ///     //////  ////////    //        ////////  //   //  ////// /// ///

    """)

    logos.append(r"""
    '########:'##::::'##:'########::'########::::'###::::'########:::::'######::'##::::'##:'########:'##:::::::'##:::::::
    ... ##..:: ##:::: ##: ##.... ##: ##.....::::'## ##:::... ##..:::::'##... ##: ##:::: ##: ##.....:: ##::::::: ##:::::::
    ::: ##:::: ##:::: ##: ##:::: ##: ##::::::::'##:. ##::::: ##::::::: ##:::..:: ##:::: ##: ##::::::: ##::::::: ##:::::::
    ::: ##:::: #########: ########:: ######:::'##:::. ##:::: ##:::::::. ######:: #########: ######::: ##::::::: ##:::::::
    ::: ##:::: ##.... ##: ##.. ##::: ##...:::: #########:::: ##::::::::..... ##: ##.... ##: ##...:::: ##::::::: ##:::::::
    ::: ##:::: ##:::: ##: ##::. ##:: ##::::::: ##.... ##:::: ##:::::::'##::: ##: ##:::: ##: ##::::::: ##::::::: ##:::::::
    ::: ##:::: ##:::: ##: ##:::. ##: ########: ##:::: ##:::: ##:::::::. ######:: ##:::: ##: ########: ########: ########:
    :::..:::::..:::::..::..:::::..::........::..:::::..:::::..:::::::::......:::..:::::..::........::........::........::

    """)

    logos.append(r"""

     _|_|_|_|_|  _|                                        _|            _|_|_|  _|                  _|  _|
         _|      _|_|_|    _|  _|_|    _|_|      _|_|_|  _|_|_|_|      _|        _|_|_|      _|_|    _|  _|
         _|      _|    _|  _|_|      _|_|_|_|  _|    _|    _|            _|_|    _|    _|  _|_|_|_|  _|  _|
         _|      _|    _|  _|        _|        _|    _|    _|                _|  _|    _|  _|        _|  _|
         _|      _|    _|  _|          _|_|_|    _|_|_|      _|_|      _|_|_|    _|    _|    _|_|_|  _|  _|


    """)

    logos.append(r"""
                                              ,;                                       .                    ,;
               .    .      j.               f#i                                       ;W.    .            f#i            i              i
      GEEEEEEELDi   Dt     EW,            .E#t             .. GEEEEEEEL              f#EDi   Dt         .E#t            LE             LE
      ,;;L#K;;.E#i  E#i    E##j          i#W,             ;W, ,;;L#K;;.            .E#f E#i  E#i       i#W,            L#E            L#E
         t#E   E#t  E#t    E###D.       L#D.             j##,    t#E              iWW;  E#t  E#t      L#D.            G#W.           G#W.
         t#E   E#t  E#t    E#jG#W;    :K#Wfff;          G###,    t#E             L##LffiE#t  E#t    :K#Wfff;         D#K.           D#K.
         t#E   E########f. E#t t##f   i##WLLLLt       :E####,    t#E            tLLG##L E########f. i##WLLLLt       E#K.           E#K.
         t#E   E#j..K#j... E#t  :K#E:  .E#L          ;W#DG##,    t#E              ,W#i  E#j..K#j...  .E#L         .E#E.          .E#E.
         t#E   E#t  E#t    E#KDDDD###i   f#E:       j###DW##,    t#E             j#E.   E#t  E#t       f#E:      .K#E           .K#E
         t#E   E#t  E#t    E#f,t#Wi,,,    ,WW;     G##i,,G##,    t#E           .D#j     E#t  E#t        ,WW;    .K#D           .K#D
         t#E   f#t  f#t    E#t  ;#W:       .D#;  :K#K:   L##,    t#E          ,WK,      f#t  f#t         .D#;  .W#G           .W#G
          fE    ii   ii    DWi   ,KK:        tt ;##D.    L##,     fE          EG.        ii   ii           tt :W##########Wt :W##########Wt
           :                                    ,,,      .,,       :          ,                               :,,,,,,,,,,,,,.:,,,,,,,,,,,,,.

    """)

    logos.append(r"""

    ooooo 8                            o    .oPYo. 8             8 8
      8   8                            8    8      8             8 8
      8   8oPYo. oPYo. .oPYo. .oPYo.  o8P   `Yooo. 8oPYo. .oPYo. 8 8
      8   8    8 8  `' 8oooo8 .oooo8   8        `8 8    8 8oooo8 8 8
      8   8    8 8     8.     8    8   8         8 8    8 8.     8 8
      8   8    8 8     `Yooo' `YooP8   8    `YooP' 8    8 `Yooo' 8 8
    ::..::..:::....:::::.....::.....:::..::::.....:..:::..:.....:....
    :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    """)

    logos.append(r"""
         _____                                                _____
     ___|__   |__  __   _  _____   ______  ____     __     __|___  |__  __   _  ______  ____    ____
    |_    _|     ||  |_| ||     | |   ___||    \  _|  |_  |   ___|    ||  |_| ||   ___||    |  |    |
     |    |      ||   _  ||     \ |   ___||     \|_    _|  `-.`-.     ||   _  ||   ___||    |_ |    |_
     |____|    __||__| |_||__|\__\|______||__|\__\ |__|   |______|  __||__| |_||______||______||______|
        |_____|                                              |_____|

    """)

    print color(random.choice(logos), random.randrange(31, 37))
    print "~ %s ~\n" % red("Huntin' Yo")
    print " Threat Shell v%s" % yellow(TS_VERSION)
    print
    sys.stdout.flush()