Fadly31337

Domain to IP

Nov 5th, 2020
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.87 KB | None | 0 0
  1. import sys,os,re,socket,binascii,time,json,random,threading,Queue,pprint,urlparse,smtplib,telnetlib,os.path,hashlib,string,urllib2,glob,sqlite3,urllib,argparse,marshal,base64,colorama,requests
  2. from colorama import *
  3. from random import choice
  4. from colorama import Fore,Back,init
  5. from email.mime.multipart import MIMEMultipart
  6. from email.mime.text import MIMEText
  7. from platform import system
  8. from Queue import Queue
  9. from time import strftime
  10. from urlparse import urlparse
  11. from urllib2 import urlopen
  12. colorama.init()
  13.  
  14. CLEAR_SCREEN = '\033[2J'
  15. RED = '\033[31m'
  16. RESET = '\033[0m'
  17. BLUE  = "\033[34m"
  18. CYAN  = "\033[36m"
  19. GREEN = "\033[32m"
  20. RESET = "\033[0m"
  21. BOLD    = "\033[m"
  22. REVERSE = "\033[m"
  23.  
  24. def logo():
  25.         clear = "\x1b[0m"
  26.         colors = [36, 32, 34, 35, 31, 37  ]
  27.  
  28.         x = """
  29.  _____         ____                _____    ___       _
  30. | ____|_______|  _ \ ___  _ __ __|_   _|__|_ _|_ __ | |
  31. |  _| |_  /_  / | | |/ _ \| '_ ` _ \| |/ _ \| || '_ \| |
  32. | |___ / / / /| |_| | (_) | | | | | | | (_) | || |_) |_|
  33. |_____/___/___|____/ \___/|_| |_| |_|_|\___/___| .__/(_)
  34.                                                |_|      
  35.             Grab IP from your domain list
  36. """
  37.         for N, line in enumerate(x.split("\n")):
  38.             sys.stdout.write("\x1b[1;%dm%s%s\n" % (random.choice(colors), line, clear))
  39.             time.sleep(0.05)
  40. logo()
  41.  
  42.  
  43. def getIP(site):
  44.    
  45.         site = i.strip()
  46.         try:
  47.             if 'http://' not in site:
  48.                 IP1 = socket.gethostbyname(site)
  49.                 print "IP: "+IP1
  50.                 open('ip_result.txt', 'a').write(IP1+'\n')
  51.             elif 'http://' in site:
  52.                 url = site.replace('http://', '').replace('https://', '').replace('/', '')
  53.                 IP2 = socket.gethostbyname(url)
  54.                 print "IP: "+IP2
  55.                 open('ip_result.txt', 'a').write(IP2+'\n')
  56.    
  57.         except:
  58.             pass
  59.            
  60. nam=raw_input('Domain List name :')
  61. with open(nam) as f:
  62.     for i in f:
  63.         getIP(i)
Add Comment
Please, Sign In to add comment