def getSubdomain(arg): hostname = arg apikey = os.environ.get('VIRUS_TOTAL_API_KEY') url = 'https://www.virustotal.com/vtapi/v2/domain/report' params = {'apikey': apikey, 'domain': hostname} response = requests.get(url, params=params) data = response.json() try: sub1 = data["subdomains"] except: sub1 = [] sub2 = data["domain_siblings"] t = Terminal() subdomains = sub1 + sub2 print( t.bold_bright_green("********************Subdomains of " + hostname + "************************")) print( t.bold_bright_green( "----------------------------------------------------------------------\n" )) for i in subdomains: print(t.bold_bright_blue("[+] " + i)) print( t.bold_bright_green( "********************Subdomains health map*******************************" )) print( t.bold_bright_green( "-----------------------------------------------------------------------\n" )) try: for url in subdomains: q.put(url.strip()) q.join() except KeyboardInterrupt: sys.exit()
def scan_info(module, target_host): modules = ('Whois', 'Wad', 'searchsploit', 'secure_response_headers', 'SSLScan', 'dns_enum', 'Nmap_TCP', 'Nmap_UDP') f = open('/var/www/html/output/' + modules[module] + '.html', 'w') f.write("<h3>" + modules[module] + " Scan Result: " + hostname + "</h3>") f.close() t = Terminal() #Printing target website print( t.bold_bright_green(""" ==================================================================================== # TARGET WEBSITE INFO # ==================================================================================== """)) print(t.bold_bright_cyan("[+] Target Website: ") + ("https://" + hostname)) #IP Finding print( t.bold_bright_green(""" ==================================================================================== # IP ADDRESS INFO # ==================================================================================== """)) try: IP = socket.gethostbyname(hostname) print(t.bold_bright_cyan("[+] IP Address of that Website: "), IP)
try: result = dns.resolver.query(c_url, 'CNAME') for cnameval in result: return ' cname of ' + c_url + ' address:', cnameval.target except Exception as error2: print("---------------------------------------------------") print(t.bold_bright_red("[+] " + str(error2))) print("---------------------------------------------------") print( t.bold_bright_green(""" ==================================================================================== / ___| _ _| |__ | _ \ _ __ ___ ___ _ _ _ __ ___ _ __ | |_(_) ___ _ __ \___ \| | | | '_ \| |_) | '__/ _ \/ __| | | | '_ ` _ \| '_ \| __| |/ _ \| '_ \ ___) | |_| | |_) | __/| | | __/\__ \ |_| | | | | | | |_) | |_| | (_) | | | | |____/ \__,_|_.__/|_| |_| \___||___/\__,_|_| |_| |_| .__/ \__|_|\___/|_| |_| V_1.0 |_| ==================================================================================== """)) print( t.bold_bright_green( "Sub Presumption By @Manikanta - http://www.example.com/\nSpecially created for Bug Bounty Hunting!\n\n" )) def doSomethingWithResult(status, url): t = Terminal() if status == 200: print(t.bold_bright_white("[+] " + str(status) + " " + url)) else:
def upload_torrents(): parser = ArgumentParser(description='Upload .torrent files to a Transmission server.') parser.add_argument('host', type=str, help='Transmission host[:port] (port defaults to 9091)') parser.add_argument('-u', '--user', type=str, default=getuser(), help='Transmission username (defaults to current user)') parser.add_argument('-d', '--directory', type=str, default='~/Downloads', help='directory to search for .torrent files (defaults to ~/Downloads)') parser.add_argument('-k', '--keep', action='store_true', help='do not trash .torrent files after uploading') args = parser.parse_args() t = Terminal() directory = Path(normpath(expanduser(expandvars(args.directory)))).resolve() print('\nScanning {} for {} files...'.format(t.bold(str(directory)), t.bold('.torrent')), end='') torrent_files = sorted(directory.glob('*.torrent')) if torrent_files: print(t.bold_bright_green(' Found {}'.format(len(torrent_files)))) else: print(t.bold_bright_red(' None found')) return password = getpass('\n{}\'s password: '******':' in args.host: hostname, port = args.host.split(':') client = Client(address=hostname, port=port, user=args.user, password=password) else: client = Client(address=args.host, user=args.user, password=password) print(t.bold_bright_green('Connected')) except TransmissionError as e: print(t.bold_bright_red('Connection failed') + ' to Transmission at ' + t.bold(args.host)) return uploaded, failed = [], [] # pad the index so that the brackets are all vertically aligned width = len(str(len(torrent_files))) for i, f in enumerate(torrent_files): prefix = ('[{:>{width}}]').format(i + 1, width=width) print('\n' + t.bold(prefix + ' Uploading') + '\t' + f.name) try: torrent = client.add_torrent('file://' + str(f)) uploaded.append(f) print(t.bold_bright_green(prefix + ' Started') + '\t' + t.bright_cyan(torrent.name)) except TransmissionError as e: failed.append(f) print(t.bold_bright_red(prefix + ' Error') + '\t' + t.bright_black(str(e))) if not args.keep: # convert to list to force iteration trash = lambda f: send2trash(str(f)) list(map(trash, uploaded)) print('') if uploaded: print('{} file{} uploaded successfully{}'.format( t.bold_bright_green(str(len(uploaded))), 's' if len(uploaded) != 1 else '', ' and moved to trash' if not args.keep else '' )) if failed: print('{} file{} failed to upload'.format( t.bold_bright_red(str(len(failed))), 's' if len(failed) != 1 else '' ))