示例#1
0
def module_body(current_user, __MODULE_PATH__, __OUTPUT_PATH__, SESSION_ID,
                USERLEVEL, debugging):
    while True:
        try:
            print("Fl00D LAUNCHER\n\n")
            print("[1] Fl00d 1\n[2] Fl00d 2\n[3] Quit\n")
            selection = input(">>> ")
            selection = int(selection)
            if selection == 1:
                from modules.FL00D import fl00d

            elif selection == 2:
                from modules.FL00D import fl00d2

            elif selection == 3:
                break

            else:
                print(error.errorCodes().ERROR0001)

        except KeyboardInterrupt:
            print(error.errorCodes().ERROR0002)
            continue

    print(
        API.ShadowSuite(current_user, __MODULE_PATH__, __OUTPUT_PATH__,
                        SESSION_ID, USERLEVEL, debugging).FINISH)
示例#2
0
    def __init__(self, global_variables):
        if not global_variables:
            raise ValueError("Global Variables is strictly needed!")

        else:
            if type(global_variables) is not dict:
                raise TypeError("Global Variables must be a dictionary!")

            else:
                keys = ('config_file', 'USERNAME', 'USERPASS', 'ROOTNAME',\
                        'ROOTPASS', 'MODULE_PATH', 'SERVICES_PATH', 'OUTPUT_PATH',\
                        'BINARY_PATH', 'NOTES_MAXLINES', 'USERLEVEL',\
                        'INSTALLED_MODULES', 'current_user', 'PLATFORM',\
                        'SESSION_ID', 'DEBUGGING')
                for key in keys:
                    a = self._assert(global_variables[key], key)
                    #print(key) # DEV0005
                    #print(global_variables[key]) # DEV0005
                    #print(a) # DEV0005
                    try:
                        if a == 0:
                            continue

                        else:
                            raise exceptions.InvalidParameterError(
                                error.errorCodes().ERROR0022)

                    except (TypeError, ValueError):
                        raise exceptions.InvalidParameterError(
                            "[i] " + error.errorCodes().ERROR0020(str(a)))

                self.global_variables = global_variables
def module_body(current_user, __MODULE_PATH__, __OUTPUT_PATH__, SESSION_ID,
                USERLEVEL, debugging):
    print()
    print("==METAGOOFIL==")
    print()
    print("[01] - Work with remote target")
    print("[02] - Work with local target")
    print()
    print("[99] - Quit")
    print()
    rem_or_loc = input(" > ")
    if rem_or_loc == "1":
        remote()

    elif rem_or_loc == "2":
        local()

    elif rem_or_loc == "99":
        pass

    else:
        print(error.errorCodes().ERROR0001)

    print(
        API.ShadowSuite(current_user, __MODULE_PATH__, __OUTPUT_PATH__,
                        SESSION_ID, USERLEVEL, debugging).FINISH)
示例#4
0
def module_body(current_user, __MODULE_PATH__, __OUTPUT_PATH__, SESSION_ID,
                USERLEVEL, debugging):
    print("Linux Exploit Suggester")
    print()
    print("[1] Check for vulnerabilities in my current linux kernel version")
    print(
        "[2] Manually enter a linux kernel version and check for vulnerabilities"
    )
    print()
    print("[3] Quit")
    print("")
    selection = int(input(" >>> "))
    if selection == 1:
        os.system("cd modules/LES && perl les.pl")

    elif selection == 2:
        kernel_version = input("Kernel Version: ")
        os.system("cd modules/LES && perl les.pl -k " + kernel_version)

    elif selection == 3:
        pass

    else:
        print(error.errorCodes().errorCodes().ERROR0001)

    print(
        API.ShadowSuite(current_user, __MODULE_PATH__, __OUTPUT_PATH__,
                        SESSION_ID, USERLEVEL, debugging).FINISH)
示例#5
0
def moduleAPI(global_variables):
    API_ShadowSuite = API.ShadowSuite(global_variables['current_user'], global_variables['MODULE_PATH'], global_variables['OUTPUT_PATH'], global_variables['SESSION_ID'], global_variables['USERLEVEL'], global_variables['DEBUGGING'])
    try:
        ip = requests.get('https://api.ipify.org/').text
        return ip

    except ConnectionError:
        return error.errorCodes().ERROR0010

    except requests.exceptions.ConnectionError:
        return error.errorCodes().ERROR0010

    except Exception as error_msg:
        return error_msg

    print(API_ShadowSuite.FINISH)
示例#6
0
def Ftp_honeypot():
    host, port = getBasicInput()
    try:
        print('Starting FTP honeypot!')
        s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        s.bind((host, port))
        s.listen(100)
        while True:
            (insock, address) = s.accept()
            print('[' + time.asctime() + '] Connection from %s port %d' %
                  (address[0], address[1]))
            try:
                insock.close()
            except KeyboardInterrupt:
                print("\nFTP honeypot shutting down... Bye!")

            except socket.error as e:
                ftp_writeLog(address)

            else:
                ftp_writeLog(address)

    except KeyboardInterrupt:
        print("\nFTP honeypot shutting down... Bye!")

    except OSError:
        print(
            "The port we are trying to use is already being used by another process. Sorry!"
        )

    except PermissionError:
        print(error.errorCodes().ERROR0005)
示例#7
0
def HTTP_honeypot():
    url = input("URL to emulate: ")
    if 'http' not in url:
        url = 'http://' + url

    while True:
        port = int(input("Port: "))
        if port < 1 or port > 65535:
            print("Error: Invalid port number.")
            continue

        else:
            break
    try:
        print("[i] Starting HTTP honeypot!")
        #httpd.__url__privatemethod = url
        #httpd.__port__privatemethod = port
        s = httpd.httpd(url, port)
        s.clone()
        s.serve()

    except KeyboardInterrupt:
        s.cleanup()
        print("\n[i] HTTP Honeypot shutting down... Bye!")

    except OSError:
        print(
            "The port we are trying to use is already being used by another process. Sorry!"
        )

    except PermissionError:
        print(error.errorCodes().ERROR0005)
示例#8
0
    def error_except(self):
        try:
            loop = True
            while loop == True:
                quit = None
                ########## LABEL FOR SSF ONLY ##########
                ask = input(
                    CB + FB + FI +
                    'Do you want to keep Shadow Suite running? (y/n)> ' + CW +
                    FR)
                ask = ask.lower()
                if ask == 'y':
                    loop = False
                    quit = False

                elif ask == 'n':
                    loop = False
                    quit = True

                else:
                    loop = True

            return quit

        except KeyboardInterrupt:
            print(error.errorCodes().ERROR0002)
            logger.log(2, "SystemExit raised with error code 2.",
                       'logfile.txt')
            sys.exit(2)
示例#9
0
def module_body(current_user, __MODULE_PATH__, __OUTPUT_PATH__, SESSION_ID, USERLEVEL, debugging):
    banner = r"""
 ____  _               _                ____                _
/ ___|| |__   __ _  __| | _____      __/ ___|_ __ __ _  ___| | __
\___ \| '_ \ / _` |/ _` |/ _ \ \ /\ / / |   | '__/ _` |/ __| |/ /
 ___) | | | | (_| | (_| | (_) \ V  V /| |___| | | (_| | (__|   <
|____/|_| |_|\__,_|\__,_|\___/ \_/\_/  \____|_|  \__,_|\___|_|\_\
                           Launcher
    """
    print(banner)
    while True:
        print()
        print("[01] ShadowCrack v2.0\n[02] ShadowCrack Legacy\n\n[99] Quit")
        choice = int(input(" >>> "))
        if choice == 1:
            os.system("cd modules/SHADOWCRACK && python3 -B ShadowCrack.py")

        elif choice == 2:
            os.system("cd modules/SHADOWCRACK/legacy && python2 -B ShadowCrack.py")

        elif choice == 99:
            break

        else:
            print(error.errorCodes().ERROR0001)

    print(API.ShadowSuite(current_user, __MODULE_PATH__, __OUTPUT_PATH__, SESSION_ID, USERLEVEL, debugging).FINISH)
示例#10
0
def main(current_user, __MODULE_PATH__, __OUTPUT_PATH__, SESSION_ID, USERLEVEL,
         debugging):
    if import_error is True:
        return None

    else:
        """ First, it checks the value assigned to the 'needsroot' variable in the 
        dictionary 'info', then if the value is equal to zero, it calls the 'geteuid()'
        function from the 'os' module. If the result from geteuid is also zero, then
        the module will call the function 'module_body()'. Otherwise, it will print an
        error message. If the value assigned to the 'needsroot' variable in the dictionary
        'info' is not equal to zero, then the module will not call the 'geteuid()' function
        from the 'os' module, and will immediately call 'module_body()' function. """
        if info['needsroot'] == "0":
            if os.geteuid() != 0:
                print(error.errorCodes().ERROR0005)
                return 0

            else:
                module_body(current_user, __MODULE_PATH__, __OUTPUT_PATH__,
                            SESSION_ID, USERLEVEL, debugging)

        else:
            module_body(current_user, __MODULE_PATH__, __OUTPUT_PATH__,
                        SESSION_ID, USERLEVEL, debugging)
示例#11
0
def module_body(global_variables):
    # To support module versions older than v7.0
    API_ShadowSuite = API.ShadowSuite(global_variables['current_user'], global_variables['MODULE_PATH'], global_variables['OUTPUT_PATH'], global_variables['SESSION_ID'], global_variables['USERLEVEL'], global_variables['DEBUGGING'])
    print()
    try:
        ip = requests.get('https://api.ipify.org/').text
        print("Your public IP Address is '" + str(ip) + "'.")

    except ConnectionError:
        print(error.errorCodes().ERROR0010)
    
    except requests.exceptions.ConnectionError:
        print(error.errorCodes().ERROR0010)

    except Exception as error_msg:
        print("[i] " + str(error_msg))

    print(API_ShadowSuite.FINISH)
示例#12
0
    def login_root(self, global_variables, ulogin, plogin):
        ulogin = programFunctions().hash(ulogin, 'sha256')
        plogin = programFunctions().hash(plogin, 'sha256')
        if global_variables['ROOTNAME'] == ulogin and global_variables[
                'ROOTPASS'] == plogin:
            return "Login Successful!"  # means success

        else:
            return error.errorCodes().ERROR0013  # means fail
def update(global_variables, debugging):
    try:
        update_needed, remote_version = check_for_updates(debugging, True)
        if update_needed == "ERRED" or remote_version == "ERRED":
            print(error.errorCodes().ERROR0020("Unknown error occured."))
            return None

        else:
            pass

    except Exception as check4updates_err:
        print(error.errorCodes().ERROR0020(str(check4updates_err)))
        return None

    if update_needed == True:
        success = subprocess.call([
            global_variables['BINARY_PATH'] + "git", "pull", "origin", "master"
        ])
        if success == 0:
            print("[i] SSF is now updated to " + remote_version +
                  "! Please restart SSF to use the updated version.")

        else:
            print("[i] " +
                  error.errorCodes().ERROR0020("Process returned error code " +
                                               str(success) + '.'))

        return None

    else:
        print("[i] You are using the latest version of SSF!")
        print()
        print(
            "[i] If you have any suggestions, opinions, feature requests, or")
        print("    even issues, don't hesitate to contact us at the following")
        print("    accounts:")
        print()
        print("        [email protected]")
        print("        [email protected]")
        print()
        return None
示例#14
0
    def find_service(self, service):
        # Argument "service" is the target service to view the info.
        service_name = self.SERVICES_PATH + service
        try:
            service_name = service_name.replace('/', '.')
            logger.log(
                3,
                'User shows info about ' + service_name + ' service via API.',
                'logfile.txt', global_variables['SESSION_ID'])
            service_importlib(service_name, 'info')

        except Exception as service_err:
            print(error.errorCodes().ERROR0020(str(service_err)))
示例#15
0
def main(current_user, __MODULE_PATH__, __OUTPUT_PATH__, SESSION_ID, USERLEVEL,
         debugging):
    if info['needsroot'] == "0":
        if os.geteuid() != 0:
            print(error.errorCodes().ERROR0005)
            return

        else:
            module_body(current_user, __MODULE_PATH__, __OUTPUT_PATH__,
                        SESSION_ID, USERLEVEL, debugging)

    else:
        module_body(current_user, __MODULE_PATH__, __OUTPUT_PATH__, SESSION_ID,
                    USERLEVEL, debugging)
示例#16
0
    def generate_new_service(self, csn):
        logger.log(0, 'User generated a new service named ' + csn,
                   'logfile.txt', self.SESSION_ID)
        if misc.programFunctions().is_windows():
            os.system("xcopy core/temp_service.py output/" + csn + ".py")

        else:
            os.system("cp core/temp_service.py output/" + csn + ".py")

        if misc.programFunctions().path_exists('output/' + csn + ".py"):
            print("[i] " + csn + ".py service sucessfully generated!")

        else:
            print("[i] " + error.errorCodes().ERROR0015 +
                  " (Generated service not found)")
示例#17
0
def main(global_variables):
    if import_error is True:
        return None

    else:
        """ First, it checks the value assigned to the 'needsroot' variable in the 
        dictionary 'info', then if the value is equal to zero, it calls the 'geteuid()'
        function from the 'os' module. If the result from geteuid is also zero, then
        the module will call the function 'service_body()'. Otherwise, it will print an
        error message. If the value assigned to the 'needsroot' variable in the dictionary
        'info' is not equal to zero, then the module will not call the 'geteuid()' function
        from the 'os' module, and will immediately call 'service_body()' function. """
        if info['needsroot'] == "0":
            if os.geteuid() != 0:
                print(error.errorCodes().ERROR0005)
                return 0

            else:
                service_body(global_variables)

        else:
            service_body(global_variables)
示例#18
0
    def pause(self, silent=False, phrase="Press enter to continue..."):
        try:
            """
            platform = sys.platform
            if platform == 'linux':
                if silent is False:
                    print('Press any key to continue...')
                    os.system('read A972681B318C92911A4020C18ACF78B6')

                else:
                    os.system('read A972681B318C92911A4020C18ACF78B6')

            elif platform == 'windows':
                if silent is False:
                    os.system('pause')

                else:
                    os.sysem('pause > nul')

            else:
                if silent is False:
                    print('Press any key to continue...')
                    os.system('read A972681B318C92911A4020C18ACF78B6')

                else:
                    os.system('read A972681B318C92911A4020C18ACF78B6')
            """

            if silent == True:
                input()

            else:
                input(phrase)

        except (KeyboardInterrupt, EOFError):
            print(error.errorCodes().ERROR0002)
            logger.log(2, "SystemExit raised with error code 2.",
                       'logfile.txt')
            sys.exit(2)
示例#19
0
    def clrscrn(self):
        try:
            platform = self.is_windows()
            if platform == False:
                os.system('clear')

            elif platform == True:
                os.system('cls')

            else:
                os.system('clear')
                # DEV0001: Thinking of new generic clrscrn... Try also using ansi module.
                """
                loop = 0
                while loop != 100:
                    print()
                    loop += 1
                """

        except KeyboardInterrupt:
            print(error.errorCodes().ERROR0002)
            logger.log(2, "SystemExit raised with error code 2.",
                       'logfile.txt')
            sys.exit(2)
示例#20
0
def module_body(current_user, __MODULE_PATH__, __OUTPUT_PATH__, SESSION_ID, USERLEVEL, debugging):
    go = "cd modules/CUPP"
    print("  ___________")
    print(" | cupp.py! |                # Common")
    print("      \\                     # User")
    print("       \\   ,__,             # Passwords")
    print("        \\  (oo)____         # Profiler")
    print("           (__)    )\\")
    print("              ||--|| *   Muris Kurgas <*****@*****.**>")
    print('\n\nOutput files are in the modules/CUPP folder...\n\n')
    print("[1] Interactive questions for user password profiling")
    print("[2] Use this option to improve existing dictionary, or WyD.pl output to make some pwnsauce")
    print("[3] Download huge wordlists from repository")
    print("[4] Test CUPP.py")
    print("\n[9] Quit\n\n")
    select = input("Input > ")
    select = int(select)
    if select == 1:
        os.system(go + " && python3 cupp3.py -i -q")

    elif select == 2:
        os.system(go + " && python3 cupp3.py -w -q")

    elif select == 3:
        os.system(go + " && python3 cupp3.py -l -q")

    elif select == 4:
        os.system(go + " && python3 test_cupp.py")

    elif select == 9:
        return

    else:
        print(error.errorCodes().ERROR0001)

    print(API.ShadowSuite(current_user, __MODULE_PATH__, __OUTPUT_PATH__, SESSION_ID, USERLEVEL, debugging).FINISH)
示例#21
0
def module_body(current_user, __MODULE_PATH__, __OUTPUT_PATH__, SESSION_ID,
                USERLEVEL, debugging):
    print("Nmap: Network exploration tool and security / port scanner\n\n")
    print("Target's IP Address or URL: ")
    TARGET = input("[NWRAP] > ")
    while True:
        print("\n")
        print("Common Scanning Types:")
        print("[1] TCP connect scan")
        # nmap -sT [TARGET]
        print("[2] Half-open scan        [i] ROOT REQUIRED")
        # nmap -sS [TARGET]
        print("[3] ping scan")
        # nmap -sP [TARGET]
        print("[4] UDP scan              [i] ROOT REQUIRED")
        # nmap -sU [TARGET]
        print("[5] IP Protocol scan      [i] ROOT REQUIRED")
        # nmap -sO [TARGET]
        print()
        print("Ping Scan Types:")
        print("[6] TCP SYN ping")
        # nmap -PS[PORTLIST] [TARGET]
        print("[7] TCP ACK ping")
        # nmap -PA[PORTLIST] [TARGET]
        print("[8] UDP ping              [i] ROOT REQUIRED")
        # nmap -PU[PORTLIST] [TARGET]
        print("[9] SCTP INIT ping        [i] ROOT REQUIRED")
        # nmap -PY[PORTLIST] [TARGET]
        print("[10] ARP ping")
        # nmap -PR [TARGET]
        print()
        print("Other Scan Types:")
        print("[11] List scan")
        # nmap -sL [TARGET]
        print("[12] SCTP INIT scan       [i] ROOT REQUIRED")
        # nmap -sY [TARGET]
        print("[13] TCP ACK scan         [i] ROOT REQUIRED")
        # nmap -sA [TARGET]
        print("[14] TCP Windows scan     [i] ROOT REQUIRED")
        # nmap -sW [TARGET]
        print("[15] OS scan              [i] ROOT REQUIRED")
        # nmap -O [TARGET]
        print()
        print("More settings:")
        print("[98] Automated scans")
        # DEV0001: Include comprehensive, intense scans
        print("[99] Quit")
        # nmap -O [TARGET]
        print()
        SCANTYPE = int(input("[NWRAP] > "))
        if SCANTYPE == 1:
            print()
            print()
            print()
            print()
            print("TCP Connect scan")
            print()
            try:
                nmap.PortScanner("nmap -sT " + TARGET)

            except:
                os.system('nmap -sT ' + TARGET)

            print()
            print("Scan finished!")
            API.misc.programFunctions().pause()

        elif SCANTYPE == 2:
            print()
            print()
            print()
            print()
            print("Half-open scan")
            print()
            try:
                nmap.PortScanner("nmap -sS " + TARGET)

            except:
                os.system("nmap -sS " + TARGET)

            print()
            print("Scan finished!")

        elif SCANTYPE == 3:
            print()
            print()
            print()
            print()
            print("Ping scan")
            print()
            try:
                nmap.PortScanner("nmap -sP " + TARGET)

            except:
                os.system('nmap -sP ' + TARGET)

            print()
            print("Scan finished!")

        elif SCANTYPE == 4:
            print()
            print()
            print()
            print()
            print("UDP scan")
            print()
            try:
                nmap.PortScanner("nmap -sU " + TARGET)

            except:
                os.system("nmap -sU " + TARGET)

            print()
            print("Scan finished!")

        elif SCANTYPE == 5:
            print()
            print()
            print()
            print()
            print("IP Protocol scan")
            print()
            try:
                nmap.PortScanner("nmap -sO " + TARGET)

            except:
                os.system("nmap -sO " + TARGET)

            print()
            print("Scan finished!")

        elif SCANTYPE == 6:
            print()
            print()
            print()
            print()
            print("TCP SYN ping")
            print()
            try:
                nmap.PortScanner(
                    "nmap -PS20,21,22,23,25,53,80,88,110,119,123,137,139,143,161,162,163,164,194,443,514,563,989,990,5060 "
                    + TARGET)

            except:
                os.system(
                    "nmap -PS20,21,22,23,25,53,80,88,110,119,123,137,139,143,161,162,163,164,194,443,514,563,989,990,5060 "
                    + TARGET)

            print()
            print("Scan finished!")

        elif SCANTYPE == 7:
            print()
            print()
            print()
            print()
            print("TCP ACK ping")
            print()
            try:
                nmap.PortScanner(
                    "nmap -PA20,21,22,23,25,53,80,88,110,119,123,137,139,143,161,162,163,164,194,443,514,563,989,990,5060 "
                    + TARGET)

            except:
                os.system(
                    'nmap -PA20,21,22,23,25,53,80,88,110,119,123,137,139,143,161,162,163,164,194,443,514,563,989,990,5060 '
                    + TARGET)

            print()
            print("Scan finished!")

        elif SCANTYPE == 8:
            print()
            print()
            print()
            print()
            print("UDP ping")
            print()
            try:
                nmap.PortScanner(
                    "nmap -PU20,21,22,23,25,53,80,88,110,119,123,137,139,143,161,162,163,164,194,443,514,563,989,990,5060 "
                    + TARGET)

            except:
                os.system(
                    "nmap -PU20,21,22,23,25,53,80,88,110,119,123,137,139,143,161,162,163,164,194,443,514,563,989,990,5060"
                )
            print()
            print("Scan finished!")

        elif SCANTYPE == 9:
            print()
            print()
            print()
            print()
            print("SCTP INIT ping")
            print()
            try:
                nmap.PortScanner(
                    "nmap -PY20,21,22,23,25,53,80,88,110,119,123,137,139,143,161,162,163,164,194,443,514,563,989,990,5060 "
                    + TARGET)

            except:
                os.system(
                    'nmap -PY20,21,22,23,25,53,80,88,110,119,123,137,139,143,161,162,163,164,194,443,514,563,989,990,5060 '
                    + TARGET)

            print()
            print("Scan finished!")

        elif SCANTYPE == 10:
            print()
            print()
            print()
            print()
            print("ARP ping")
            print()
            try:
                nmap.PortScanner(
                    "nmap -PR20,21,22,23,25,53,80,88,110,119,123,137,139,143,161,162,163,164,194,443,514,563,989,990,5060 "
                    + TARGET)

            except:
                os.system(
                    'nmap -PR20,21,22,23,25,53,80,88,110,119,123,137,139,143,161,162,163,164,194,443,514,563,989,990,5060 '
                    + TARGET)

            print()
            print("Scan finished!")

        elif SCANTYPE == 11:
            print()
            print()
            print()
            print()
            print("List scan")
            print()
            try:
                nmap.PortScanner("nmap -sL " + TARGET)

            except:
                os.system('nmap -sL ' + TARGET)

            print()
            print("Scan finished!")

        elif SCANTYPE == 12:
            print()
            print()
            print()
            print()
            print("SCTP INIT scan")
            print()
            try:
                nmap.PortScanner("nmap -sY " + TARGET)

            except:
                os.system('nmap -sY ' + TARGET)

            print()
            print("Scan finished!")

        elif SCANTYPE == 13:
            print()
            print()
            print()
            print()
            print("TCP ACK scan")
            print()
            try:
                nmap.PortScanner("nmap -sA " + TARGET)

            except:
                os.system('nmap -sA ' + TARGET)

            print()
            print("Scan finished!")

        elif SCANTYPE == 14:
            print()
            print()
            print()
            print()
            print("TCP Window scan")
            print()
            try:
                nmap.PortScanner("nmap -sW " + TARGET)

            except:
                os.system('nmap -sW ' + TARGET)

            print()
            print("Scan finished!")

        elif SCANTYPE == 15:
            print()
            print()
            print()
            print()
            print("OS scan")
            print()
            try:
                nmap.PortScanner("nmap -O " + TARGET)

            except:
                os.system('nmap -O ' + TARGET)

            print()
            print("Scan finished!")

        elif SCANTYPE == 98:
            automated_scans()

        elif SCANTYPE == 99:
            print()
            print()
            print()
            print()
            print("Quitting NWRAP...")
            break

        else:
            print(error.errorCodes().ERROR0001)

    print(
        API.ShadowSuite(current_user, __MODULE_PATH__, __OUTPUT_PATH__,
                        SESSION_ID, USERLEVEL, debugging).FINISH)
示例#22
0
def Telnet_honeypot():
    host, port = getBasicInput()
    motd = input("MOTD #1 (Enter '' (none) for default): ")
    if motd == None or motd == "":
        motd = """\



Ubuntu LTS 16.1 Telnet Server

#################################################################################
#                                                                               #
# AUTHORIZED USERS ONLY! DISCONNECT IF YOU ARE NOT ONE OF THE AUTHORIZED USERS! #
#                                                                               #
#################################################################################

Login: """

    motd = motd.encode()

    motd2 = input("MOTD #2 (Enter '' (none) for default: ")
    if motd2 == None or motd2 == '':
        motd2 = """\

Password: """

    motd2 = motd2.encode()

    honey_reply = input(
        "Do you want to send a message to the attacker? (Makes the honeypot suspicious; y/n) > "
    ).lower()
    if honey_reply == 'y':
        reply = input("Message: ").encode()

    elif honey_reply == 'n':
        print("[i] You choosed to not send a message. Wise choice, dude!")
        reply = None

    else:
        print("[i] Unknown answer, assuming no...")
        reply = None

    try:
        print('Starting Telnet honeypot!')
        s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        s.bind((host, port))
        s.listen(100)
        while True:
            (insock, address) = s.accept()
            print('[' + time.asctime() + '] Connection from %s port %d' %
                  (address[0], address[1]))
            try:
                insock.send(motd)
                data = insock.recv(1024)
                insock.send(motd2)
                data = insock.recv(1024)
                if reply == None or reply == "":
                    pass

                else:
                    insock.send(reply)
                    data = insock.recv(1024)

                insock.close()

            except KeyboardInterrupt:
                print("\nTelnet honeypot shutting down... Bye!")

            except socket.error as e:
                telnet_writeLog(address)

            else:
                telnet_writeLog(address, data)

    except KeyboardInterrupt:
        print("\nTelnet honeypot shutting down... Bye!")

    except OSError:
        print(
            "The port we are trying to use is already being used by another process. Sorry!"
        )

    except PermissionError:
        print(error.errorCodes().ERROR0005)
示例#23
0
def module_body(current_user, __MODULE_PATH__, __OUTPUT_PATH__, SESSION_ID,
                USERLEVEL, debugging):
    BANNER = r"""
 ____                      _   _
|  _ \  ___  ___ ___ _ __ | |_(_) ___  _ __
| | | |/ _ \/ __/ _ \ '_ \| __| |/ _ \| '_ \
| |_| |  __/ (_|  __/ |_) | |_| | (_) | | | |
|____/ \___|\___\___| .__/ \__|_|\___/|_| |_|
                    |_|         v{}
    """
    while True:
        try:
            pf = API.misc.programFunctions()
            pf.clrscrn()
            print(BANNER.format(info['version']))
            print()
            print("Current Time: " + time.asctime())
            print("Current user: "******" | Session ID: " +
                  str(SESSION_ID))
            print()
            print("[01] HTTP (80) Honeypot")
            print("[02] FTP (20,21) Honeypot")
            print("[03] SMTP (25) Honeypot")
            print("[04] Telnet (23) Honeypot")
            print("[05] SSH (22) Honeypot")
            print("[06] SNMP (161,162) Honeypot")
            print()
            print("[99] Quit")
            honeytype = int(input("[DECEPTION]: "))
            if honeytype == 1:
                HTTP_honeypot()

            elif honeytype == 2:
                Ftp_honeypot()

            elif honeytype == 3:
                continue

            elif honeytype == 4:
                Telnet_honeypot()

            elif honeytype == 5:
                continue

            elif honeytype == 6:
                continue

            elif honeytype == 99:
                print(
                    API.ShadowSuite(current_user, __MODULE_PATH__,
                                    __OUTPUT_PATH__, SESSION_ID, USERLEVEL,
                                    debugging).FINISH)
                return 0

            else:
                print(error.errorCodes().ERROR0001)

            API.misc.programFunctions().pause()

        except KeyboardInterrupt:
            print(error.errorCodes().ERROR0002)

        except (ValueError, TypeError):
            pass
def check_for_updates(debugging, silent=False):
    print(misc.CG + "[i] Checking for updates..." + misc.END)
    if debugging == True:
        print("[LOGGER] Getting current version from repository...")

    try:
        remote_version = urllib.request.urlopen(
            "https://raw.githubusercontent.com/Sh4d0w-T34m/ShadowSuiteFramework/master/core/version.py"
        )

    except urllib.error.URLError:
        print(error.errorCodes().ERROR0010)
        return "ERRED", "ERRED"

    except Exception as urllib_err:
        print(error.errorCodes().ERROR0020(str(urllib_err)))
        return "ERRED", "ERRED"

    remote_version = remove_version.split('\n')
    got_it = False
    for lines in remote_version:
        if 'VNUMBER' in lines:
            remote_version = lines.replace("VNUMBER = ", '')
            got_it = True

        else:
            got_it = False
            continue

    if got_it == True:
        pass

    else:
        print(error.errorCodes().ERROR0021)
        return "ERRED", "ERRED"

    current_version = version.VNUMBER
    # print("Current: " + current_version)
    # print("Remote: " + remote_version)
    if remote_version != current_version:
        if silent == True:
            return True, remote_version

        print()
        print("[i] There's a new version! New version: " + remote_version)
        print()
        print("[i] Type 'update program' to update.")
        print("    To manually update or you didn't cloned the repository,")
        print(
            "    go to 'https://github.com/Sh4d0w-T34m/ShadowSuiteFramework'")
        print("    and clone the repository.")
        print()
        return True, remote_version  # Needs update

    else:
        if silent == True:
            return False, ""

        print()
        print("[i] You are using the latest version of SSF!")
        print()
        print(
            "[i] If you have any suggestions, opinions, feature requests, or")
        print("    even issues, don't hesitate to contact us at the following")
        print("    accounts:")
        print()
        print("        [email protected]")
        print("        [email protected]")
        print()
        return False, ""  # Up-to-date