def inputargs():
    target = autokbex_input('target(the host ip or domain):')
    regex = autokbex_input('regex(hit waf keyword or regex)')
    threads = autokbex_input('thread(numbers of multi threads):')

    args = ''
    if target == '':
        print('[!]输入无效')
        return False
    else:
        args = args + '-target ' + target
    if regex != '':
        args = args + ' -regex ' + regex
    if threads != '':
        args = args + ' -thread ' + threads
    return args
Esempio n. 2
0
def run_func(F,func,pwd=None):
    if 'pwd' in func[1]:
        if pwd==None:
            pwd=autokbex_input('输入链接密码:')
        return F.run(func[0],pwd=pwd)
    else:
        return F.run(func[0])
Esempio n. 3
0
def get_py_env():
    global python2_env, python3_env
    if os.path.exists(cvebase + 'py2_env.ini'):
        with open(cvebase + 'py2_env.ini', 'r', encoding='utf-8') as f:
            python2_env = f.read().strip()
    else:
        python2_env = autokbex_input('[!]python2 环境不存在,请输入python2可执行文件目录:')
        with open(cvebase + 'py2_env.ini', 'w', encoding='utf-8') as f:
            f.write(python2_env)
    if os.path.exists(cvebase + 'py3_env.ini'):
        with open(cvebase + 'py3_env.ini', 'r', encoding='utf-8') as f:
            python3_env = f.read().strip()
    else:
        python3_env = autokbex_input('[!]python3 环境不存在,请输入python3可执行文件目录:')
        with open(cvebase + 'py3_env.ini', 'w', encoding='utf-8') as f:
            f.write(python3_env)
Esempio n. 4
0
def inputargs():
    softlist_path=autokbex_input('软件包列表文件路径:')
    if not os.path.exists(softlist_path):
        print('[+]错误:文件不存在')
        return
    args='--db ./Library/linux-soft-exploit-suggester/files_exploits.csv '
    args+='--file '+softlist_path
    
    return args
Esempio n. 5
0
def inputargs():
    systeminfo_path = autokbex_input('systeminfo文件路径:')
    if not os.path.exists(systeminfo_path):
        print('[+]错误:文件不存在')
        return
    args = '--database ' + get_db()
    args += ' --systeminfo ' + systeminfo_path

    return args
Esempio n. 6
0
def inputargs():
    target = autokbex_input('domain(domain to bypass):')
    listsubdomains = autokbex_input(
        'listsubdomains(list with subdomains for extra coverage)(y/n):').strip(
        ).lower()
    checkall = autokbex_input(
        'checkall(Check all subdomains for a WAF bypass)(y/n):').strip().lower(
        )

    args = ''
    if target == '':
        print('[!]输入无效')
        return False
    else:
        args = args + '-d ' + target
    if listsubdomains != '':
        args = args + ' -l'
    if checkall != '':
        args = args + ' -a'
    return args
Esempio n. 7
0
def download():
    url = autokbex_input('url:')
    while 1:
        path = autokbex_input('path(默认为output):')
        if path == '': path = 'output'
        if os.path.exists(path):
            if os.path.isdir(path):
                break
            else:
                print('[!]路径必须是文件夹')
        else:
            print('[!]路径不存在')
    file_name = autokbex_input('filename:')
    t_num = autokbex_input('thread num(默认6):')
    if t_num == '':
        Dld = Aria2_Downloader(path)
    elif t_num.isdigit():
        Dld = Aria2_Downloader(path, int(t_num))
    else:
        print('[!]需要输入数字')
    Dld.download(url, file_name)
Esempio n. 8
0
def select_mode():
    for i,mode in enumerate(allow_mode):
        print(i+1,':',mode)
    mode=autokbex_input('选择语言模式:')
    if not mode.isdigit():
        print('[!]请输入数字')
        return False
    mode=int(mode)
    if mode<=0 or mode>len(allow_mode):
        print('[!]请输入合法范围的数字')
        return False
    return allow_mode[mode-1]
Esempio n. 9
0
def select_func(F):
    funcs=F.get_funclist()
    for i,func in enumerate(funcs):
        print(i+1,':',func[0],func[2])

    fno=autokbex_input('选择马(数字/all):')
    if fno.lower()=='all':return 'all'
    if not fno.isdigit():
        print('[!]请输入数字')
        return False
    fno=int(fno)
    if fno<=0 or fno>len(funcs):
        print('[!]请输入合法范围的数字')
        return False
    return funcs[fno-1]
Esempio n. 10
0
def main():
    mode=select_mode()
    if mode==False:
        return False
    F=load_funcs(mode)
    if F==False:return False
    func=select_func(F)
    if func==False:return False
    elif func=='all':
        pwd=autokbex_input('输入链接密码:')
        for f in F.get_funclist():
            print('-'*50)
            print(run_func(F,f,pwd))
        print('-'*50)
    else:
        print(run_func(F,func))
Esempio n. 11
0
        print('[+]日志记录已关闭')
        log = False
    if '--debug' in sys.argv:
        print('[+]进入debug模式.将会实时输出数据,debug依赖于log,--nolog将失效')
        debug = True
        log = True

    if '-r' in sys.argv or '--reverse' in sys.argv:
        reverse = True
        print('[+]已选择反向代理模式')
    else:
        reverse = False
        print('[+]已选择正向代理模式')

    try:
        port_server = int(autokbex_input('本地监听端口:').strip())
        if reverse:
            host_forward = autokbex_input('转发目标ip:')
            port_forward = int(autokbex_input('转发目标端口:').strip())
        else:
            host_forward = port_forward = None
        forwarder_num = int(autokbex_input('转发线程数:').strip())
        #codec=input('发送编码方式:').strip()
        #if codec=='':
        #    codec='utf-8'
        func_file = autokbex_input(
            '存储处理函数的文件(方法名为out_head,out_body,in_head,in_body:')
        set_func = False
        if func_file != '':
            if os.path.exists(func_file):
                U = pyfunc_util(func_file, 'def *:*')
Esempio n. 12
0
def main():
    while 1:
        args = autokbex_input('curl>')
        run(args)
Esempio n. 13
0
    path = path.split('tools', maxsplit=1)[0] + 'Library/utils'
else:
    path = path + '/Library/utils'
if not path in (p.replace('\\', '/') for p in sys.path):
    sys.path.append(path)
from env_variable_util import ENVIRONMENT_VARIABLE_UTIL_WIN
from auto_input import autokbex_input

print('[+]此模块索引环境变量里的可执行文件')
print('[+]输入名称返回绝对路径,例如输入python,返回c:\\pythohn3\python.exe')
print('[+]输入#输出所有环境变量匹配信息')

E = ENVIRONMENT_VARIABLE_UTIL_WIN(allow_suffixs=('*', ),
                                  dir_black_list=tuple())
ex_match = autokbex_input(
    '[+]立即启用额外匹配模式?(y/n)(进行忽略大小写和后缀的匹配)(会导致无法使用索引建立中的快速索引功能)').strip().lower(
    ) == 'y'
if not ex_match:
    print('[+]额外匹配模式将在索引建立完成后启用')
else:
    print('[+]额外匹配模式已启用')
while 1:
    d = autokbex_input('win env match>')
    if not ex_match and E._indexing_down_get():
        ex_match = True
        print('[+]额外匹配模式已启用')
    stime = time.time()
    if d == '#':
        for k, v in E.getall().items():
            for l in v:
                print(k.center(37), '|', l)
Esempio n. 14
0
path = os.path.abspath('.')
if 'tools' in path.replace('\\', '/').split('/'):  #这里是为了便于开发调试
    path = path.split('tools', maxsplit=1)[0] + 'Library/utils'
else:
    path = path + '/Library/utils'
if not path in (p.replace('\\', '/') for p in sys.path):
    sys.path.append(path)

from auto_input import autokbex_input

if len(sys.argv) == 3:
    url = sys.argv[1]
    password = sys.argv[2]
else:
    url = autokbex_input('webshell_address:')
    if url == 'exit()': exit(0)
    password = autokbex_input('webshell_password:'******'exit()': exit(0)
print('注意:\ncd 只能单独执行\n不会提示目录不存在')
print('------------start------------')


def checkos():
    #check_os={password:"******"}
    check_os = {password: "******"}
    nowos = requests.post(url, check_os)
    nowos.encoding = 'utf-8'
    if nowos.text == 'WIN':
        return 'win'
    else:
Esempio n. 15
0
    index = guessing(name, guess_list)
    if index == -1: return False
    return all_cve[index]


if len(sys.argv) == 2:
    #get_py_env()
    allcve = scan()
    file_name = match(allcve, sys.argv[1])
    if file_name == False:
        print('[!]匹配失败')
        exit(1)
    now_env = eval('python' + str(check_py23(file_name)) + '_env')
    while 1:
        print(os.path.basename(file_name), '-> ', end='')
        args = autokbex_input('input args:')
        if args == '':
            continue
        os.system(now_env + ' ' + file_name + ' ' + args)

if __name__ == "__main__":
    print('本模块用于调用cve 的poc')
    #get_py_env()
    allcve = scan()
    print('[+]get', len(allcve), 'poc')
    for i in allcve:
        print('[+]' + os.path.split(i)[1])

    while True:
        data = autokbex_input('cve>')
        if data == '':