Example #1
0
def args_check(cmdparse, usage):
    print(random.choice(Banner))
    confs = {}
    args = []
    if hasattr(cmdparse, "items"):
        cmdlines = cmdparse.items()
    else:
        cmdlines = cmdparse.__dict__.items()
    for key, value in cmdlines:
        confs[key] = value
        args.append(value)
    if confs['version']:
        logger.info(f"Version: {Version}")
        exit(0)
    if confs['updateprogram']:
        update()
        exit(0)
    if ((not confs['query'] or not confs['apitype']) and not confs['file']
            and not confs['url']) or (not confs['dict'] and not confs['func']):
        print(usage)
        exit(0)
    if confs['porxy']:
        ProxyPool.extend(red_api(confs['porxy']))
    if confs['code']:
        try:
            StatusCode.extend([int(x) for x in confs['code'].split(",")])
        except:
            print(usage)
            exit(0)
    if confs['params']:
        try:
            kw = {
                x.split("=")[0]: eval(x.split("=")[1])
                for x in confs['params'].split(",")
            }
            if isinstance(kw, dict):
                params = kw['params'] if 'params' in kw and isinstance(
                    kw['params'], dict) else None
                json = kw['json'] if 'json' in kw and isinstance(
                    kw['json'], dict) else None
                data = kw['data'] if 'data' in kw and isinstance(
                    kw['data'], dict) else None
                args[8] = {'params': params, 'json': json, 'data': data}
        except:
            print(usage)
            exit(0)
    if confs['output'] not in ['json', 'txt', "csv", "xlsx", "xls"]:
        logger.warning(f"暂不支持{confs['output']}文件格式,改为默认文件格式txt输出")
        args[5] = "txt"

    return args
Example #2
0
def run():
    try:
        data = []
        try:
            data = load_data()
            data = update.update(data)
        except IOError:
            data_constructor.build_data()
            data = load_data()
        main(data)
    except Exception as e:
        exc_type, exc_obj, exc_tb = sys.exc_info()
        fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
        print(exc_type, fname, exc_obj, exc_tb.tb_lineno)
    finally:
        prep_data_on_close(data)
Example #3
0
def run():
    try:
        data = []
        try:
            data = load_data()
            data = update.update(data)
        except IOError:
            data_constructor.build_data()
            data = load_data()
        main(data)
    except Exception as e:
        exc_type, exc_obj, exc_tb = sys.exc_info()
        fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
        print(exc_type, fname, exc_obj, exc_tb.tb_lineno)
    finally:
        prep_data_on_close(data)
Example #4
0
def main():
    """Main game function."""
    try:
        data = load_data()
        data = update.update(data)
    except:
        # print(sys.exc_info())
        data_constructor.build_data()
        data = load_data()
    data["want_to_play"] = True
    data["start"] = time.time()
    actions = {
        "quit": quit,
        "look": check_status,
        "shop": buy_menu.menu,
        "yard": yard.menu,
        "collect money": collect_money,
        "check food": yard.check_food,
        "check treasures": check_treasures,
        "help": print_help
    }
    banner()
    data["prefix"] = "{.BLUE}[Welcome!]{.ENDC}".format(printer.PColors,
                                                       printer.PColors)
    check_status(data)
    recieve_treasures(data)
    data["prefix"] = "[Main Menu]"
    while data["want_to_play"] is True:
        data["prefix"] = "{.MAIN}[Main Menu]{.ENDC}".format(
            printer.PColors, printer.PColors)
        printer.prompt(data["prefix"], actions.keys())
        inp = input("{0} Choose an action! ".format(data["prefix"]))
        if inp in actions:
            actions[inp](data)
            continue
        else:
            printer.invalid(data["prefix"])
Example #5
0
def console():
    path = None
    toolpart =None
    #File lists Function
    def mp(path):
        for root,dirs,files in os.walk(path): 
            for f in files: 
                print (f)
    #list Function
    def list():
        print ("\nTools\n===============")
        mp(path)
    try:
    
        while True:
            signal.signal(signal.SIGINT,controlc_signal)
            #Get PWD
            getcwd = os.getcwd()
            getdir = getcwd.split("/")
            pwd =  getdir[-1]
            #Get LocalHost Name
            plat = platform.node()
            #Nothing Special :)
            point = "→"
            #Check Tools Part Directory
            if path == None:
                None
            else:
                pth = path.split("/")
                toolpart = pth[-2]
            #Promot
            option = input (Fore.RESET+"\n[SSF@%s](%s){%s} %s "%(plat,pwd,toolpart,point))
            
            option2 = option.split(" ")
            #Conditions
            if option2[0] == "cd":
                
                def cd(path):
                    os.chdir(os.path.expanduser(path))
                try:
                    cd(option2[1])
                
                except:
                    print ("ERROR: No such file or directory: ",option2[1])
            elif option2[0] == 'run':
                
                    try:
                        
                        if option == "run":
                            print ("enter help to see how to use this command")
                        else:
                            run = option.split("run ")[1]
                            run2 = path+run
                            #exec(open(run2).read())
                            exst = os.path.isfile(run2) 
                            if exst:
                                os.system(run2)
                            else :
                                print ("Cannot find executable file")
                    except:
                        print ("Error !!!")
            
            elif option2[0] == 'use':
                try:
                    check = "/opt/sandsploit/module/%s/"%option2[1]
                    exist = os.path.isdir(check) 
                    if exist:
                        path = check
                    else:
                        print ("Part not Found")
                    
                except:
                    print ("Part Not Found")
            elif option == 'list':
                if path == None:
                    print("\nTools\n===============")
                    print ("Tools NotFound")
                else:
                    list()


            elif option == 'help':
                #Menu
                print ('''

Command     Description
========    ============
banner      Change Banner
bash        Run Bash Shell
list        List of tools for each section
listener    Sniffing Port
python      Interactive Shell(Debuging Purposes)
RSMaker     Make Reverse Shell For Desktop Operating Systems
run         Run Tools In modules
use         Interact With Different Parts of Penetration Testing Tools
version     Show version of SandSploit
upgrade     Full Upgrade Freamworks
update      Update Exploits & Scripts Parts
exit        Exit From SSF
                ''')
            elif option == "version":
                version()
            elif option == "update":
                update()
            elif option == "upgrade":
                upgrade()
            elif option == "banner":
                banner()
            elif option == "RSMaker":
                RSMaker()
            elif option == "listener":
                listener()
            elif option == "exit":
                sys.exit()
            else:
                os.system(option)

    except EnvironmentError:
        print ("\nUnknown Error......")
        print ("Enter ""help"" to show commands....")
        console()
Example #6
0
def set_confs():
    if confs.updateprogram:
        update()
    if confs.version:
        logger.info("Version: {0}".format(Version))
        exit(0)
    if confs.search:
        searchType = ["fofa", "eye"]
        if confs.search in set(searchType):
            pass
        else:
            logger.error("参数错误,e.g.(-s fofa or -s eye)")
            exit(0)
    if confs.outputTarget:
        outTypes = ["txt", "json", "html", "xls", "csv"]
        if confs.outputTarget in set(outTypes):
            pass
        else:
            logger.error("输出格式错误,只支持输出格式为:{0}".format(outTypes))
            exit(0)
    if confs.ip:
        Urls.ips.append(confs.ip)
    if confs.url:
        if not confs.url.startswith('http'):
            confs.url = "http://" + confs.url
        Urls.url.append(confs.url)
    if confs.file:
        with open(confs.file, 'r') as f:
            for ip in f.readlines():
                if len(ip) != 1:
                    Urls.ips.append(ip.strip())
    if confs.web:
        with open(confs.web, 'r') as f:
            for web in f.readlines():
                if len(web) != 1:
                    if not web.startswith('http'):
                        web = "http://" + web
                    Urls.url.append(web.strip())

    if isinstance(confs["proxy"], str):
        if ":" in confs["proxy"]:
            splits = confs["proxy"].split(":")
            try:
                if int(splits[2]):
                    confs["proxy"] = {
                        splits[0]:
                        "{0}:{1}:{2}".format(splits[0], splits[1], splits[2])
                    }
                    Proxys.proxyList.append(confs["proxy"])
            except ValueError:
                logger.error(
                    "代理地址错误,例如:http://127.0.0.1:8080 or https://127.0.0.1:8080"
                )
                exit(0)
        elif confs["proxy"] != "all" and confs["proxy"] != "cn":
            logger.error(
                "参数错误,all表示加载全部IP,cn加载国内IP,自定义例子为:http://127.0.0.1:8080 or https://127.0.0.1:8080"
            )
            exit(0)
        else:
            checkProxyFile(confs["proxy"])
        if len(Proxys.proxyList) == 0:
            logger.error("本地获取代理失败,请从新获取")
            message = input("是否不使用代理访问?[y/N]")
            if message != "y":
                exit(0)
        else:
            logger.info("分配IP中")
            getScheme()
    if confs.proxylist:
        if confs.proxylist == "all" or confs.proxylist == "cn":
            checkProxyFile(confs.proxylist)
            if len(Proxys.proxyList) == 0:
                logger.error("本地获取代理失败,请重新获取")
                exit(0)
            else:
                tb = pt.PrettyTable()
                tb.field_names = ['Protocol', 'Host']
                for p in Proxys.proxyList:
                    logger.info(p)
                    for i in p:
                        tb.add_row([i, p[i]])
                print(tb)
                logger.info("协议可切换,一般在代理插件里设置http协议,这样避免证书问题")
        else:
            exit(0)
Example #7
0
File: tilt.py Project: MrBig19/aku
target=None
reverse=False
google=False
extensive=False
output=None

for opt, arg in options:
    if opt in ('-h', '--help'):
        actions.showhelp()
        sys.exit(0)
    elif opt in ('-v', '--version'):
        actions.header()
        sys.exit(0)
    elif opt in ('-u', '--update'):
        actions.header()
        update.update()
        sys.exit(0)
    elif opt in ('-t', '--target'):
        target = arg
    elif opt in ('-r', '--reverse'):
        reverse = True
    elif opt in ('-e', '--extensive'):
        extensive = True
    elif opt in ('-g', '--google'):
        google = True
    elif opt in ('-o', '--output'):
        output = arg
    else:
        actions.header()
        actions.showhelp()
        sys.exit(1)
Example #8
0
def termux_console():
    try:

        while True:
            getcwd = os.getcwd()
            getdir = getcwd.split("/")
            pwd = getdir[-1]
            plat = platform.node()
            point = "→"

            option = input(Fore.RESET + "\n[SSF@%s](%s) %s " %
                           (plat, pwd, point))

            option2 = option.split(" ")
            if option2[0] == "cd":

                def cd(path):
                    os.chdir(os.path.expanduser(path))

                try:
                    cd(option2[1])

                except:
                    print("ERROR: No such file or directory: ", option2[1])
            elif option2[0] == 'run':

                try:

                    if option == "run":
                        print("enter help to see how to use this command")
                    else:
                        run = option.split("run ")[1]
                        os.system("./" + run)
                except:
                    print("No file to execute")

            elif option2[0] == 'use':
                try:
                    os.chdir(
                        "/data/data/com.termux/files/usr/opt/sandsploit/module/"
                        + option2[1])
                except:
                    print("Part Not Found")

            elif option == 'help':
                print('''

Command     Description
========    ============
banner      Change Banner
bash        Run Bash Shell
listener    Sniffing Port
python      Interactive Shell(Debuging Purposes)
RSMaker     Make Reverse Shell For Desktop Operating Systems
run         Run Exploits & Tools
use         Interact with one of the two sections of Tools or exploits
version     Show version of SandSploit
upgrade     Full Upgrade Freamworks
update      Update Exploits & Scripts Parts
exit        Exit From SSF
                ''')
            elif option == "version":
                version()
            elif option == "update":
                update()
            elif option == "upgrade":
                upgrade()
            elif option == "banner":
                banner()
            elif option == "RSMaker":
                RSMaker()
            elif option == "listener":
                listener()
                Commands()
            elif option == "exit":
                break
            else:
                os.system(option)

    except EnvironmentError:
        print("\nUnknown Error......")
        print("Enter " "help" " to show commands....")
        Commands()
    except KeyboardInterrupt:
        print("\nInterrupt: use the 'exit' command to quit")
        Commands()
Example #9
0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from lib.menu import pyVer, clear, menu
from lib.update import update

pyVer()
update()

print (' HXYA modules verification...', end='')

try:
    import os, requests, json, time, sys, datetime
    from colorama import init, Fore, Back, Style
    print (' Good!')
except:
    print (' Some modules are missing. Please execute python3 -m pip install -r requirements.txt')
    input(' Type ENTER to exit')

print (' Modules verification...', end='')

try:
    from core.youtube import likClo, disClo, subClo, comClo, vieClo
    from core.instagram import avaPse, bomber, wdnfm, unfollow
    from core.ccg import ccg
    from core.mail import mail, statMail
    from lib.config import config
    from lib.cache import initca

    import lib.print as printMenu
    print (' Good!')