def __init__(self, args, parser): """start with arguments and parser objects""" #import args and parser objects from argparse self.args = args self.parser = parser #version self.version = 'v2-09.19.17' #defaults self.lookup_list = [] self.client_name = None self.autosint_db = 'AutOSINT.db' self.report_directory = './reports/' self.api_key_directory = './api_keys/' self.databse_directory = './database/' #module results lists self.whois_result = [] self.dns_result = [] self.google_dork_result = [] self.shodan_query_result = [] self.pastebin_scrape_urls_result = [] self.pastebin_scrape_content_result = [] self.theharvester_module_result = [] self.scrape_result = [] self.cred_leak_search_result = [] self.pyfoca_module_result = [] self.haveibeenpwned_result = [] #start timer self.start_time = time.time() #module assign self.cred_leaks_module = Credleaks() self.pyfoca_module = Pyfoca() self.web_scraper_module = Scraper() self.theharvester_module = Theharvester() self.dns_query_module = Dnsquery() self.pastebin_scrape_module = Pastebinscrape() self.shodan_search_module = Shodansearch() self.google_dork_module = Googledork() self.haveibeenpwned_api_module = Haveibeenpwned() self.whois_query_module = Whois() self.report_generator_module = Reportgen() #check dirs if not os.path.exists(self.report_directory): os.makedirs(self.report_directory) if not os.path.exists(self.api_key_directory): os.makedirs(self.api_key_directory)
def __init__(self, args, parser): #version self.version = 'v2.04.03.17' #defaults self.lookupList = [] self.clientName = None self.autOsintDB = 'AutOSINT.db' self.reportDir='./reports/' self.apiKeyDir='./api_keys/' #import args and parser objects from argparse self.args = args self.parser = parser #module results lists self.whoisResult = [] self.dnsResult = [] self.googleResult = [] self.shodanResult = [] self.pasteScrapeResult = [] self.pasteScrapeContent = [] self.harvesterResult = [] self.scrapeResult = [] self.credResult = [] self.pyfocaResult = [] self.hibpResult = [] #start timer self.startTime=time.time() #module assign self.credLeaks = Credleaks() self.pyFoca = Pyfoca() self.web_scraper = Scraper() self.theHarvester = Theharvester() self.dnsQuery = Dnsquery() self.pastebinScrape = Pastebinscrape() self.shodanSearch = Shodansearch() self.googleDork = Googledork() self.hibpSearch = Haveibeenpwned() self.whoisQuery = Whois() #resource assign self.reportGen=Reportgen() self.setupDatabase=SetupDatabase()
class Autosint: def __init__(self, args, parser): #version self.version = 'v2.03.31.17' #defaults self.lookupList = [] self.clientName = None self.autOsintDB = 'AutOSINT.db' self.reportDir = './reports/' self.apiKeyDir = './api_keys/' #import args and parser objects from argparse self.args = args self.parser = parser #module results lists self.whoisResult = [] self.dnsResult = [] self.googleResult = [] self.shodanResult = [] self.pasteScrapeResult = [] self.pasteScrapeContent = [] self.harvesterResult = [] self.scrapeResult = [] self.credResult = [] self.pyfocaResult = [] self.hibpResult = [] #start timer self.startTime = time.time() #module assign self.credLeaks = Credleaks() self.pyFoca = Pyfoca() self.web_scraper = Scraper() self.theHarvester = Theharvester() self.dnsQuery = Dnsquery() self.pastebinScrape = Pastebinscrape() self.shodanSearch = Shodansearch() self.googleDork = Googledork() self.hibpSearch = Haveibeenpwned() self.whoisQuery = Whois() #resource assign self.reportGen = Reportgen() self.setupDatabase = SetupDatabase() def clear(self): #clean up screen os.system('cls' if os.name == 'nt' else 'clear') def banner(self): #verbosity flag to print logo and args if self.args.verbose is True: print(''' _ _ ___ ____ ___ _ _ _____ / \ _ _| |_ / _ \/ ___|_ _| \ | |_ _| / _ \| | | | __| | | \___ \| || \| | | | / ___ \ |_| | |_| |_| |___) | || |\ | | | /_/ \_\__,_|\__|\___/|____/___|_| \_| |_|\n''') if self.args.verbose is True: print('AutOSINT.py %s: A way to automate various OSINT tasks\n' % self.version) if self.args.verbose is True: print(self.args) def checkargs(self): #check local dirs for reports, apikey and database if not os.path.exists(self.reportDir): os.makedirs(self.reportDir) if not os.path.exists(self.apiKeyDir): os.makedirs(self.apiKeyDir) #set True on action store_true args if -a if self.args.all is True: self.args.creds = True self.args.hibp = True self.args.foca = True self.args.nslookup = True self.args.theharvester = True self.args.whois = True self.args.scraper = True self.args.shodan = True #validate entered IP address? do we even care about IP address? i and d do the same shit if self.args.ipaddress is not None: for a in self.args.ipaddress: try: socket.inet_aton(a) except socket.error: print '[-] Invalid IP address entered!' + a sys.exit() #require at least one argument if not (self.args.domain or self.args.ipaddress): print( '[-] No OSINT reference provided, add domain(s) with -d or IP address(es) with -i\n' ) sys.exit() #if no queries defined, exit. -a sets all so we're good there if (self.args.whois is False and \ self.args.hibp is False and \ self.args.nslookup is False and \ self.args.googledork is None and \ self.args.shodan is False and \ self.args.creds is False and \ self.args.theharvester is False and \ self.args.scraper is False and \ self.args.pastebinsearch is None and \ self.args.foca is False): print '[-] No options specified, use -h or --help for a list' sys.exit() #check to see if an ip or domain name was entered if self.args.domain is not None: for d in self.args.domain: self.lookupList = self.args.domain for l in self.lookupList: if not os.path.exists(self.reportDir + '/' + l): os.makedirs(self.reportDir + '/' + l) else: for i in self.args.ipaddress: self.lookupList = self.args.ipaddress for l in self.lookupList: if not os.path.exists(self.reportDir + '/' + l): os.makedirs(self.reportDir + '/' + l) if self.args.verbose is True: print '[+] Lookup Values: ' + ', '.join(self.lookupList) #check for a supplied client name and exit if none provided if self.args.client is None: print( '\n[!] Client name required, please provide with -C <Clientname>\n' ) sys.exit(0) else: #strip out specials in client name self.clientName = re.sub('\W+', ' ', self.args.client).lower() #check for database, create if missing if not os.path.exists(self.autOsintDB): print('\n[!] Database missing, creating %s \n' % self.autOsintDB) self.databaseCommands = DatabaseCommands(self.clientName) self.setupDatabase.createdatabase() def runQueries(self): #call function if -w arg if self.args.whois is True: self.whoisResult = self.whoisQuery.run(self.args, self.lookupList, self.reportDir) #call function if -n arg if self.args.nslookup is True: self.dnsResult = self.dnsQuery.run(self.args, self.lookupList, self.reportDir) #call function if -b arg if self.args.hibp is True: self.hibpResult = self.hibpSearch.run(self.args, self.lookupList, self.reportDir) #call function if -g arg if self.args.googledork is None: print( '[!] Please provide arguments for google dorking. e.g -g inurl:apsx' ) sys.exit(0) else: self.googleResult = self.googleDork.run(self.args, self.lookupList, self.reportDir) #call function if -s arg if self.args.shodan is True: self.shodanResult = self.shodanSearch.run(self.args, self.lookupList, self.reportDir, self.apiKeyDir) #call function if -p arg if self.args.pastebinsearch is None: print( '[!] Please provide arguments for pastebin keywords. e.g -p password id_rsa' ) sys.exit(0) else: self.pasteScrapeResult = self.pastebinScrape.run( self.args, self.lookupList, self.reportDir, self.apiKeyDir) # call function if -t arg if self.args.theharvester is True: self.harvesterResult = self.theHarvester.run( self.args, self.lookupList, self.reportDir) #call function if -c arg if self.args.creds is True: self.credResult = self.credLeaks.run(self.args, self.lookupList, self.startTime, self.reportDir) #call function if -S arg if self.args.scraper is True: self.scrapeResult = self.web_scraper.run(self.args, self.lookupList, self.reportDir, self.apiKeyDir) #call function if -f arg if self.args.foca is True: self.pyfocaResult = self.pyFoca.run(self.args, self.lookupList, self.reportDir) #run the docx report. text files happen in the respective functions def report(self): self.reportGen.run(self.args, self.reportDir, self.lookupList, self.whoisResult, self.dnsResult, self.googleResult, self.shodanResult, self.pasteScrapeResult, self.harvesterResult, self.scrapeResult, self.credResult, self.pyfocaResult)
class Autosint(object): """autosint class""" def __init__(self, args, parser): """start with arguments and parser objects""" #import args and parser objects from argparse self.args = args self.parser = parser #version self.version = 'v2-09.19.17' #defaults self.lookup_list = [] self.client_name = None self.autosint_db = 'AutOSINT.db' self.report_directory = './reports/' self.api_key_directory = './api_keys/' self.databse_directory = './database/' #module results lists self.whois_result = [] self.dns_result = [] self.google_dork_result = [] self.shodan_query_result = [] self.pastebin_scrape_urls_result = [] self.pastebin_scrape_content_result = [] self.theharvester_module_result = [] self.scrape_result = [] self.cred_leak_search_result = [] self.pyfoca_module_result = [] self.haveibeenpwned_result = [] #start timer self.start_time = time.time() #module assign self.cred_leaks_module = Credleaks() self.pyfoca_module = Pyfoca() self.web_scraper_module = Scraper() self.theharvester_module = Theharvester() self.dns_query_module = Dnsquery() self.pastebin_scrape_module = Pastebinscrape() self.shodan_search_module = Shodansearch() self.google_dork_module = Googledork() self.haveibeenpwned_api_module = Haveibeenpwned() self.whois_query_module = Whois() self.report_generator_module = Reportgen() #check dirs if not os.path.exists(self.report_directory): os.makedirs(self.report_directory) if not os.path.exists(self.api_key_directory): os.makedirs(self.api_key_directory) def clear(self): """clean up screen""" os.system('cls' if os.name == 'nt' else 'clear') def banner(self): """verbosity flag to print logo and args""" if self.args.verbose is True: print(''' _ _ ___ ____ ___ _ _ _____ / \ _ _| |_ / _ \/ ___|_ _| \ | |_ _| / _ \| | | | __| | | \___ \| || \| | | | / ___ \ |_| | |_| |_| |___) | || |\ | | | /_/ \_\__,_|\__|\___/|____/___|_| \_| |_|\n''') if self.args.verbose is True: print('AutOSINT.py {}: A way to automate various OSINT tasks and place results into a docx\n'.format(self.version)) if self.args.verbose is True: print(self.args) def check_arguments(self): """check local dirs for reports, apikey and database""" #require at least one argument if not (self.args.domain): print('[-] No OSINT reference provided, add domain(s) with -d\n') parser.print_help() sys.exit(0) #check to see if an ip or domain name was entered if self.args.domain is not None: for d in self.args.domain: self.lookup_list = self.args.domain for l in self.lookup_list: if not os.path.exists(self.report_directory+l): os.makedirs(self.report_directory+l) if self.args.verbose is True: print ('[+] Lookup Values: '+', '.join(self.lookup_list)) #check for a supplied client name and exit if none provided if self.args.client is None: print('\n[!] Client name required, please provide with -c <Clientname>\n') parser.print_help() sys.exit(0) else: #strip out specials in client name self.client_name = re.sub('\W+', ' ', self.args.client).lower() def run_queries(self): """invoke all the queries. assumption is that every run will want all data""" #verified self.whois_result = self.whois_query_module.run(self.args, self.lookup_list, self.report_directory) #verified self.dns_result = self.dns_query_module.run(self.args, self.lookup_list, self.report_directory) #needs work self.haveibeenpwned_result = self.haveibeenpwned_api_module.run(self.args, self.lookup_list, self.report_directory) #verified self.google_dork_result = self.google_dork_module.run(self.args, self.lookup_list, self.report_directory) #verified self.shodan_query_result = self.shodan_search_module.run(self.args, self.lookup_list, self.report_directory, self.api_key_directory) #verified self.pastebin_scrape_urls_result = self.pastebin_scrape_module.run(self.args, self.lookup_list, self.report_directory, self.api_key_directory) #verified self.theharvester_module_result = self.theharvester_module.run(self.args, self.lookup_list, self.report_directory) self.cred_leak_search_result = self.cred_leaks_module.run(self.args, self.lookup_list, self.start_time, self.report_directory) #needs work self.scrape_result = self.web_scraper_module.run(self.args, self.lookup_list, self.report_directory, self.api_key_directory) #pyfoca has to be present self.pyfoca_module_result = self.pyfoca_module.run(self.args, self.lookup_list, self.report_directory) def report(self): """run the docx report. text files happen in the respective functions""" self.report_generator_module.run(\ self.args, \ self.report_directory, \ self.lookup_list, \ self.whois_result, \ self.dns_result, \ self.google_dork_result, \ self.shodan_query_result, \ self.pastebin_scrape_urls_result, \ self.theharvester_module_result, \ self.scrape_result, \ self.cred_leak_search_result, \ self.pyfoca_module_result) def end(self): """ending stuff, right now just shows how long script took to run""" print('\nCompleted in {:.2f} seconds\n'.format(time.time() - self.start_time))
class Autosint(object): """autosint class""" def __init__(self, args, parser): """start with arguments and parser objects""" #import args and parser objects from argparse self.args = args self.parser = parser #version self.version = 'v2-09.19.17' #defaults self.lookup_list = [] self.client_name = None self.autosint_db = 'AutOSINT.db' self.report_directory = './reports/' self.api_key_directory = './api_keys/' self.databse_directory = './database/' #module results lists self.whois_result = [] self.dns_result = [] self.google_dork_result = [] self.shodan_query_result = [] self.pastebin_scrape_urls_result = [] self.pastebin_scrape_content_result = [] self.theharvester_module_result = [] self.scrape_result = [] self.cred_leak_search_result = [] self.pyfoca_module_result = [] self.haveibeenpwned_result = [] #start timer self.start_time = time.time() #module assign self.cred_leaks_module = Credleaks() self.pyfoca_module = Pyfoca() self.web_scraper_module = Scraper() self.theharvester_module = Theharvester() self.dns_query_module = Dnsquery() self.pastebin_scrape_module = Pastebinscrape() self.shodan_search_module = Shodansearch() self.google_dork_module = Googledork() self.haveibeenpwned_api_module = Haveibeenpwned() self.whois_query_module = Whois() self.report_generator_module = Reportgen() #check dirs if not os.path.exists(self.report_directory): os.makedirs(self.report_directory) if not os.path.exists(self.api_key_directory): os.makedirs(self.api_key_directory) def clear(self): """clean up screen""" os.system('cls' if os.name == 'nt' else 'clear') def banner(self): """verbosity flag to print logo and args""" if self.args.verbose is True: print(''' _ _ ___ ____ ___ _ _ _____ / \ _ _| |_ / _ \/ ___|_ _| \ | |_ _| / _ \| | | | __| | | \___ \| || \| | | | / ___ \ |_| | |_| |_| |___) | || |\ | | | /_/ \_\__,_|\__|\___/|____/___|_| \_| |_|\n''') if self.args.verbose is True: print( 'AutOSINT.py {}: A way to automate various OSINT tasks and place results into a docx\n' .format(self.version)) if self.args.verbose is True: print(self.args) def check_arguments(self): """check local dirs for reports, apikey and database""" #require at least one argument if not (self.args.domain): print('[-] No OSINT reference provided, add domain(s) with -d\n') parser.print_help() sys.exit(0) #check to see if an ip or domain name was entered if self.args.domain is not None: for d in self.args.domain: self.lookup_list = self.args.domain for l in self.lookup_list: if not os.path.exists(self.report_directory + l): os.makedirs(self.report_directory + l) if self.args.verbose is True: print('[+] Lookup Values: ' + ', '.join(self.lookup_list)) #check for a supplied client name and exit if none provided if self.args.client is None: print( '\n[!] Client name required, please provide with -c <Clientname>\n' ) parser.print_help() sys.exit(0) else: #strip out specials in client name self.client_name = re.sub('\W+', ' ', self.args.client).lower() def run_queries(self): """invoke all the queries. assumption is that every run will want all data""" #verified self.whois_result = self.whois_query_module.run( self.args, self.lookup_list, self.report_directory) #verified self.dns_result = self.dns_query_module.run(self.args, self.lookup_list, self.report_directory) #needs work self.haveibeenpwned_result = self.haveibeenpwned_api_module.run( self.args, self.lookup_list, self.report_directory) #verified self.google_dork_result = self.google_dork_module.run( self.args, self.lookup_list, self.report_directory) #verified self.shodan_query_result = self.shodan_search_module.run( self.args, self.lookup_list, self.report_directory, self.api_key_directory) #verified self.pastebin_scrape_urls_result = self.pastebin_scrape_module.run( self.args, self.lookup_list, self.report_directory, self.api_key_directory) #verified self.theharvester_module_result = self.theharvester_module.run( self.args, self.lookup_list, self.report_directory) self.cred_leak_search_result = self.cred_leaks_module.run( self.args, self.lookup_list, self.start_time, self.report_directory) #needs work self.scrape_result = self.web_scraper_module.run( self.args, self.lookup_list, self.report_directory, self.api_key_directory) #pyfoca has to be present self.pyfoca_module_result = self.pyfoca_module.run( self.args, self.lookup_list, self.report_directory) def report(self): """run the docx report. text files happen in the respective functions""" self.report_generator_module.run(\ self.args, \ self.report_directory, \ self.lookup_list, \ self.whois_result, \ self.dns_result, \ self.google_dork_result, \ self.shodan_query_result, \ self.pastebin_scrape_urls_result, \ self.theharvester_module_result, \ self.scrape_result, \ self.cred_leak_search_result, \ self.pyfoca_module_result) def end(self): """ending stuff, right now just shows how long script took to run""" print('\nCompleted in {:.2f} seconds\n'.format(time.time() - self.start_time))