コード例 #1
0
def main():
    try:
        line_1 = "\033[4m" + intname + "\033[0m > "
        terminal = raw_input(line_1)
        if terminal[0:3] == 'use':
            if terminal[4:] == terminal[4:]:
                Exploit_check = "%s.plugin" % (terminal[4:])
                if os.path.exists(Exploit_check) == True:
                    os.system("python %s.plugin" % (terminal[4:]))
                    main()
                else:
                    print "[\033[1;91m!\033[0m] %s: could not be found" % (
                        terminal[4:])
        if terminal[0:6] == 'pyexec':
            exec(terminal[7:])
            main()
        elif terminal[0:21] == "retarget":
            retarget.edit()
            main()
        elif terminal[0:17] == 'show ' + terminal[5:]:
            print ""
            print "Plugin Category: " + terminal[5:]
            print "==============================\n"
            print " Name              Description"
            print " ----              -----------"
            directory_list = glob.glob(terminal[5:] + '/*.plugin')
            for line in directory_list:
                about = line
                with open(about, 'r') as myfile:
                    data = myfile.read().splitlines()
                    desc = data[0]
                    datar = desc.replace("Description = '", "")
                x = datar.rstrip("'")
                bb = line.split(terminal[5:] + '/')[1].split('.plugin')[0]
                if x == "#!/usr/bin/python":
                    x = "\033[1;91mDescription has not yet been implemented.\033[1;m"
                print " %s\t   %s" % (bb, x)
            print " "
            main()
        elif terminal[0:] == 'session':
            print """Automatic Settings
======================

  Variable          Value
  --------          -----
  LOCAL_IP          %s  GATEWAY_IP        %s  MAC_ADDR          %s""" % (
                str(lan_ip), str(gateway_ip), str(mac_address))
            sesread = open("modules/session.py", "r").read()
            print ""
            exec(sesread)
            main()
        elif terminal[0:4] == 'help':
            help.help()
            main()
        elif terminal[0:] == 'show':
            showlist()
            main()
        elif terminal[0:2] == '?':
            help.help()
            main()
        elif terminal[0:5] == 'ipnet':
            os.system('ifconfig')
            main()
        elif terminal[0:5] == 'clear':
            os.system('clear')
            main()
        elif terminal[0:6] == 'banner':
            os.system('clear')
            header.main_header()
            main()
        elif terminal[0:9] == 'exit':
            exit()
        elif terminal[0:1] == '!':
            os.system(terminal[1:])
            main()
        else:
            print "\033[31m[!]\033[0m %s: command not found" % (terminal)
            main()
    except (KeyboardInterrupt):
        print "\n"
        return main()
コード例 #2
0
def main():
    try:
        line_1 = "\033[1;4m" + intname + "\033[1;24m > "
        terminal = raw_input(line_1)
        logging.info(terminal)
        time.sleep(0.5)
        if terminal[0:3] == 'use':
            if terminal[4:] == terminal[4:]:
                Exploit_check = "plugins/Exploits/%s.plugin" % (terminal[4:])
                Payload_check = "plugins/Payloads/%s.plugin" % (terminal[4:])
                Utilities_check = "plugins/Utilities/%s.plugin" % (
                    terminal[4:])
                if os.path.exists(Exploit_check) == True:
                    os.system("python plugins/Exploits/%s.plugin" %
                              (terminal[4:]))
                    main()
                elif os.path.exists(Payload_check) == True:
                    os.system("python plugins/Payloads/%s.plugin" %
                              (terminal[4:]))
                    main()
                elif os.path.exists(Utilities_check) == True:
                    os.system("python plugins/Utilities/%s.plugin" %
                              (terminal[4:]))
                    main()
                else:
                    print "[?] %s: could not be found" % (terminal[4:])
            #elif terminal[4:32] =='example':
            #example()
            #main()
        if terminal[0:6] == 'search':
            print "\033[1;94m[?]\033[1;m Searching %s" % (terminal[7:])
            time.sleep(1)
            names = addrs
            found = []
            for name in names:
                if terminal[7:] in name:
                    found.append(name)
            print found
            main()
        elif terminal[0:21] == "retarget":
            retarget.edit()
            main()
        elif terminal[0:17] == 'show All':
            modules.all()
            main()
        elif terminal[0:17] == 'show Exploits':
            modules.exploits()
            main()
        elif terminal[0:17] == 'show Utilities':
            modules.utilities()
            main()
        elif terminal[0:17] == 'show Payloads':
            modules.payloads()
            main()
        elif terminal[0:4] == 'help':
            help.help()
            main()
        elif terminal[0:41] == 'plugin':
            os.system('python plugins/hello.plugin')
            main()
        elif terminal[0:7] == 'show':
            showlist()
            main()
        elif terminal[0:2] == '?':
            help.help()
            main()
        elif terminal[0:5] == 'ipnet':
            os.system('wine cmd.exe /c ipconfig')
            main()
        elif terminal[0:8] == 'clean':
            os.system("echo 'Cleaning evidence ;)'; rm -rf storage/logs/*")
            main()
        elif terminal[0:5] == 'clear':
            os.system('clear')
            main()
        elif terminal[0:6] == 'banner':
            os.system('clear')
            postit()
            menu.main_info()
            main()
        elif terminal[0:9] == 'exit':
            exit()
        elif terminal[0:1] == '!':
            os.system(terminal[1:])
            main()
        else:
            print "Command not found:", terminal
            main()
    except (KeyboardInterrupt):
        print "\n"
        return main()
コード例 #3
0
    sys.exit()
else:
    pass

RescoursesDir = os.getcwd()
dandtime = time.strftime("%d-%m-%Y-%H:%M:%S")
logfile = "storage/logs/%s.log" % (dandtime)

if CHECK_LOGS == True:
    if os.path.exists("storage/logs/config.xml") == False:
        print "[" + time.strftime(
            "%H:%M:%S"
        ) + "] Failed to load Configuration file.   STATUS:[" + colors[
            1] + "FAILED" + colors[0] + "]"
        os.system("cp storage/config-skeleton.xml storage/logs/config.xml")
        retarget.edit()
    print "[" + time.strftime(
        "%H:%M:%S"
    ) + "] Creating a Configuration file: storage/logs/config.xml.   STATUS:[" + colors[
        14] + "OK" + colors[0] + "]"
    time.sleep(0.6)
else:
    print "[" + time.strftime(
        "%H:%M:%S"
    ) + "] Failed creating Configuration file.   STATUS:[" + colors[
        1] + "FAILED" + colors[0] + "]"
    exit()

time.sleep(0.5)
#Wait and check internet activity
time.sleep(0.8)
コード例 #4
0
ファイル: roxy.py プロジェクト: sanelez/roxysploit
def main():
    try:
        line_1 = "\033[1;4m" + intname + "\033[1;24m > "
        terminal = raw_input(line_1).lower()
        logging.info(terminal)
        time.sleep(0.5)
        if terminal[0:3] == 'use':
            if terminal[4:] == terminal[4:]:
                os.system(PLUGIN_EXEC + terminal[4:] + PLUGIN_END)
                main()
            #elif terminal[4:32] =='example':
            #example()
            #main()
        if terminal[0:6] == 'search':
            print "\033[1;94m[?]\033[1;m Searching %s" % (terminal[7:])
            time.sleep(1)
            names = addrs
            found = []
            for name in names:
                if terminal[7:] in name:
                    found.append(name)
            print found
            main()
        elif terminal[0:21] == "retarget":
            retarget.edit()
            main()
        elif terminal[0:17] == 'show plugins':
            modules.all()
            main()
        elif terminal[0:4] == 'help':
            help.help()
            main()
        elif terminal[0:41] == 'plugin':
            os.system('python plugins/hello.plugin')
            main()
        elif terminal[0:7] == 'show':
            showlist()
            main()
        elif terminal[0:2] == '?':
            help.help()
            main()
        elif terminal[0:5] == 'ipnet':
            os.system('wine cmd.exe /c ipconfig')
            main()
        elif terminal[0:8] == 'clean':
            os.system("echo 'Cleaning evidence ;)'; rm storage/logs/*")
            main()
        elif terminal[0:5] == 'clear':
            os.system('clear')
            main()
        elif terminal[0:6] == 'banner':
            os.system('clear')
            postit()
            menu.main_info()
            main()
        elif terminal[0:9] == 'exit':
            exit()
        elif terminal[0:1] == '!':
            os.system(terminal[1:])
            main()
        else:
            print "Command not found:", terminal
            main()
    except (KeyboardInterrupt):
        print "\n"
        return main()