Advertisement
Lewster7

Domain to IP

May 18th, 2022
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.75 KB | None | 0 0
  1. #!/usr/bin/env python3
  2. import os, requests, sys, time
  3. from colorama import init, Fore, Style
  4. from concurrent.futures import ThreadPoolExecutor
  5. from socket import gethostbyname
  6.  
  7. init()
  8. r = Fore.RED + Style.BRIGHT
  9. g = Fore.GREEN + Style.BRIGHT
  10. c = Fore.CYAN + Style.BRIGHT
  11. oo = Fore.YELLOW + Style.BRIGHT
  12. o = Fore.RESET + Style.RESET_ALL
  13.  
  14. banner = """
  15. {} ____ ___ _____ _____           _____ ___            ___ ____  
  16. {}/ ___|_ _|_   _| ____|         |_   _/ _ \         |_ _|  _ \
  17. {}\___ \| |  | | |  _|    _____    | || | | |  _____   | || |_) |
  18. {} ___) | |  | | | |___  |_____|   | || |_| | |_____|  | ||  __/
  19. {}|____/___| |_| |_____|           |_| \___/          |___|_|
  20.                                                              
  21.  
  22.                     {}Coded by Lewster7
  23.              WA:https://wa.me/6283843192429
  24.        {}Note : List Domain tanpa http/https
  25.  
  26.            """.format(g, r, oo, c, r, g, r, o)
  27.  
  28.  
  29. def sitetoip(i):
  30.     try:
  31.         ip = gethostbyname(i)
  32.         print('{}[+] '"{}{} ""{} == ""{}[{}]".format(g, oo, i, o, g, ip))
  33.         open('ips.txt', 'a').write(ip + '\n')
  34.     except:
  35.         print('{}[-] '"{}{}""{} == ""{}[ ERROR ]".format(r, oo, i, o, r))
  36.  
  37. def Main():
  38.     os.system('cls' if os.name == 'nt' else 'clear')
  39.     print(banner)
  40.  
  41.     lists = input('\n{}[+] {}List{} > {}'.format(o, g, o, g))
  42.     thread = input('{}[+] {}Thread{} > {}'.format(o, g, o, r))
  43.     print('')
  44.     try:
  45.         domain = lists.replace('"','')
  46.         process = open(domain, 'r').read().splitlines()
  47.         with ThreadPoolExecutor(max_workers=int(thread)) as e:
  48.             [e.submit(sitetoip, i) for i in process]
  49.     except:
  50.           print('{}[!] {}Incorrect'.format(o, r))
  51.        
  52. if __name__ == '__main__':
  53.     Main()
  54.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement