Example #1
0
    def module_choose(self, target, enum, savemap):

        try:

            bscan_dns_queries(self.target)
            bscan_whois_look(self.target)

            # <Module required> Perform enumerations and network mapping

            supported_engines = {
                'certspotter': tuga_certspotter.Certspotter,
                'hackertarget': tuga_hackertarget.Hackertarget,
                'virustotal': tuga_virustotal.Virustotal,
                'threatcrowd': tuga_threatcrowd.Threatcrowd,
                'ssl': tuga_crt.CRT,
                'entrust': tuga_entrust.Entrust,
                'googlesearch': tuga_googlesearch.GoogleSearch
            }
            chosenEnums = []

            if enum is None:
                queries(target)
                chosenEnums = [
                    tuga_certspotter.Certspotter,
                    tuga_hackertarget.Hackertarget, tuga_virustotal.Virustotal,
                    tuga_threatcrowd.Threatcrowd, tuga_crt.CRT,
                    tuga_entrust.Entrust
                ]

                # Start super fast enumeration
                enums = [indicate(target, output) for indicate in chosenEnums]

            else:

                for engine in enum:
                    if engine.lower() in supported_engines:
                        chosenEnums.append(supported_engines[engine.lower()])
                        # Start the enumeration

                        enums = [
                            indicate(target, output)
                            for indicate in chosenEnums
                        ]

            # Save map domain (png file)

            if savemap is not False:
                mapping_domain(target)
        except KeyboardInterrupt:
            print("\nTugaRecon interrupted by user\n")
            sys.exit()
Example #2
0
def menu():
    banner()
    args = parse_args()  # args = parser.parse_args()
    target = parse_url(args.domain)
    output = args.output
    # port = args.ports
    savemap = args.savemap
    enum = args.enum
    threads = args.threads
    bruteforce = args.bruteforce
    bscan_dns_queries(target)
    bscan_whois_look(target)

    main(target, output, savemap, enum, threads, bruteforce, args)
Example #3
0
    def __init__(self, target, options):

        self.target = target
        self.options = options  # default threads 200
        self.ignore_intranet = options.i  # need more options... not complete
        # set threads and count system to 0
        self.thread_count = self.scan_count = self.found_count = 0
        self.lock = threading.Lock()
        # Resize console
        self.console_width = getTerminalSize()[0] - 2  # thanks guys
        self.msg_queue = queue.Queue()
        self.STOP_SCAN = False
        threading.Thread(target=self._print_msg).start()
        self.queries_bscan = bscan_dns_queries(target)
        self._load_dns_servers()  # load DNS servers from a list
        # set resolver from dns.resolver
        self.resolvers = [
            dns.resolver.Resolver(configure=False)
            for _ in range(options.threads)
        ]
        for _ in self.resolvers:
            _.lifetime = _.timeout = 6.0
        self._load_next_sub()
        self.queue = queue.Queue()
        t = threading.Thread(target=self._load_sub_names)
        t.start()
        while not self.queue.qsize() > 0 and t.is_alive():
            time.sleep(0.1)
            # create a target folder and save results in to a file
        if options.output:
            outfile = options.output
        else:
            if not os.path.exists("results/" + self.target):
                os.mkdir("results/" + self.target)
            else:
                pass
            outfile = 'results/' + target + '_tugascan.txt' if not options.full_scan else 'results/' + self.target + "/"\
                                                                                          + target + '_tugascan_full.txt'
            #outfile = 'results/' + target + '_tugascan.txt' if not options.full_scan else 'results/' + target + '_tugascan_full.txt'
        self.outfile = open(outfile, 'w')
        # save ip ,dns.
        self.ip_dict = {}
        self.last_scanned = time.time()
        self.ex_resolver = dns.resolver.Resolver(configure=False)
        self.start_time = None