Exemplo n.º 1
0
def sqlmap_target(target, options):
    """ add sqlmap details to a Target and return it """
    report = sqlmap_url(target.getUrl(), options)
    if report is None:
        log.critical("There was an error while scanning {}".format(target.url))
        exit(1)  # just to be sure

    target = parse_report(report, target)
    # TODO: finish this :)
    return target
Exemplo n.º 2
0
def getdorks(args):
    if args.dorkfile is not None and args.dork is not None:
        log.critical("-f (--dork-file) and -d (--dork) are incompatible")
        exit(1)
    elif args.dorkfile is not None:
        if os.path.isfile(args.dorkfile):
            lines = []
            try:
                with open(args.dorkfile) as dork_file:
                    for line in dork_file:
                        lines.append(line)
            except IOError as e:
                log.critical('Got an error when reading the supplied dork file\
                             (-f/--dork-file): {}'.format(e))
        else:
            log.critical(
                "The dork file supplied (-f/--dork-file) does not exists")
        pass  # TODO: accept a dorkfile
    elif args.dorkfile is None and args.dork is None:
        log.debug("interactively querying dork")
        log.info("Enter a dork:")
        dorks = [input("dork: ")]
    else:
        dorks = [args.dork]

    return dorks