Beispiel #1
0
def main():
    log_out(conf)
    print(banner(conf.Program_name))
    args = cmdLineParser()
    conf.update(cmdLineParser().parse_args()[0].__dict__)
    if conf.version:
        print conf.version
        exit()
    if conf.url is None:
        args.print_help()
        exit()

    try:
        attack = conf.mode_list[conf.mode]
    except KeyError:
        errmsg = 'mode {name} is not exist'.format(name=conf)
        raise ArgERROR(errmsg)

    Log.info('attack mode {name}'.format(name=conf.mode))

    try:
        data = conf.payloads[conf.payload]
    except KeyError as e:
        errmsg = 'payload {name} is not exist'.format(name=e)
        raise ArgERROR(message=errmsg)
    payload = data.get_payload(conf)
    fuzz = attack.get_waf(conf, payload)
    fuzz.check(conf.url)
    Log.info('test finish, result file {name}'.format(name=conf.output_file))
Beispiel #2
0
def main():
    args = cmdLineParser()

    if args.target:
        url = args.target
    if args.module:
        plugin = args.module
    else:
        plugin = None

    loadPlugin(url=url, poc=plugin)
Beispiel #3
0
    def run(self):

        args = cmdLineParser()

        path, infoxml = self.initExp(args['exp'])

        if infoxml == None:
            print "\n[!]error, you input exploit do not exist"
            print "\n[*]All exploits list :"
            showAll()
            sys.exit(1)

        if args['mode'] == 'i':

            self.showInfo(infoxml)
            enterAndExit()

        else:
            #            pdb.set_trace()
            target, tlist, plist, tnum = inputMsg()  #target存储的时最原始未处理的输入目标信息
            tpool = Ethread(infoxml, path, tlist, plist, tnum, target)
            tpool.threadManager()
    def run(self):

        args = cmdLineParser()

        path,infoxml = self.initExp(args['exp'])

        if infoxml == None:
            print "\n[!]error, you input exploit do not exist"
            print "\n[*]All exploits list :"
            showAll()
            sys.exit(1)

        if args['mode'] == 'i':

            self.showInfo(infoxml)
            enterAndExit()

        else:
#            pdb.set_trace()
            target,tlist,plist,tnum = inputMsg()#target存储的时最原始未处理的输入目标信息
            tpool = Ethread(infoxml,path,tlist,plist,tnum,target)
            tpool.threadManager()
Beispiel #5
0
        except Exception as e:
            color_print.red(f"[-] error host_file: {args.host_file}\n[-] {e}")
            sys.exit()
    # exclude empty elements and remove duplicates
    host_list = list(set(filter(None, host_list)))

    if len(host_list) < 1:
        color_print.red(f"[-] no target to scan, use -H/-HF to specify target")
        sys.exit()
    return host_list


if __name__ == "__main__":
    start_time = time.time()
    global thread_count
    args = cmdLineParser()
    # get host
    hosts = load_host(args)

    # get port list
    ports = []
    if args.port:
        ports = [int(port) for port in args.port.split(',')]
        color_print.cyan(f"[*] begin to scan ports: {ports}")
    else:
        color_print.cyan(f"[*] begin to scan default ports")

    # generate tasks
    task_queue = generate_tasks(hosts, ports)
    color_print.cyan(f"[*] task count:{task_queue.qsize()}")