diff --git a/.gitignore b/.gitignore index 71cdfc8..89c49e6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ .vscode/ - +env/ *.pyc */__pycache__ diff --git a/dark-fantasy.py b/dark-fantasy.py index 51b43a7..5060579 100755 --- a/dark-fantasy.py +++ b/dark-fantasy.py @@ -7,6 +7,7 @@ from modules.email import email from modules.subdomain_scanner import scan_subdomains from modules.dir_buster import scan_urls +from modules.whois_lookup import whois_lookup def ask_host(): @@ -22,13 +23,13 @@ def main(): print("-"*60+"\n") print(" Dark Fantasy - Hack Tool ") print("-"*60+"\n") - print("1.Port Scanning\n2.DDOS\n3.Banner Grabbing\n4.Web spider(gather all URLs for web hacking)\n5.FTP Password Cracker\n6.Email Scraping\n7.Subdomain Scanner\n8.Website Directory Buster") + print("1.Port Scanning\n2.DDOS\n3.Banner Grabbing\n4.Web spider(gather all URLs for web hacking)\n5.FTP Password Cracker\n6.Email Scraping\n7.Subdomain Scanner\n8.Website Directory Buster\n9.Whois Lookup") try: choice = int(input("Enter Your Choice: ")) except (ValueError, EOFError, KeyboardInterrupt): return print('\n[!] Interrupted! or Wrong Value') - if choice not in range(9): + if choice not in range(10): return print('Invalid choice') hostname = ask_host() @@ -49,6 +50,9 @@ def main(): scan_subdomains(hostname) elif choice == 8: scan_urls(hostname) + elif choice == 9: + whois_lookup(hostname) + else: print("Invalid choice") diff --git a/modules/whois_lookup.py b/modules/whois_lookup.py new file mode 100644 index 0000000..bbdccd1 --- /dev/null +++ b/modules/whois_lookup.py @@ -0,0 +1,62 @@ +import whois + + +def whois_lookup(host): + i = 1 + w = whois.whois(host) + + #print(w) + + if type(w.get("domain_name")) is list: + print("Domain name: " + str(w.get("domain_name")[0]).lower()) + elif type(w.get("domain_name")) is not list: + print("Domain name: " + str(w.get("domain_name")).lower()) + + print("Registrar: " + w.get("registrar")) + print("Whois Server: " + w.get("whois_server")) + if type(w.get("updated_date")) is list: + for date in w.get("updated_date"): + print("Last Updated: " + str(date)) + else: + print("Last Updated: " + str(w.get("updated_date"))) + + if type(w.get("creation_date")) is list: + for date in w.get("creation_date"): + print("Domain Created: " + str(date)) + else: + print("Domain Created: " + str(w.get("creation_date"))) + + if type(w.get("expiration_date")) is list: + for date in w.get("expiration_date"): + print("Domain Expires: " + str(date)) + else: + print("Domain Expires: " + str(w.get("expiration_date"))) + + for nameserver in w.get("name_servers"): + print("Name server " + str(i) + ": " + nameserver) + i = i + 1 + + for status in w.get("status"): + print("Status: " + str(status).split()[0]) + + if type(w.get("emails")) is list: + for email in w.get("emails"): + print("Email: " + email) + else: + print("Email: " + str(w.get("email"))) + + print("DNSSEC: " + str(w.get("dnssec"))) + print("\nName: " + str(w.get("name"))) + print("Organization: " + str(w.get("org"))) + print("Address:\n" + str(w.get("address")) + "\n" + str(w.get("city")) + " " + str(w.get("state"))) + print(str(w.get("registrant_postal_code"))) + print(str(w.get("country"))) + + + + +whois_lookup("stackoverflow.com") + + + + diff --git a/requirements.txt b/requirements.txt index ac5d357..ec22cf3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,14 @@ -datetime -html2text -requests -termcolor +certifi==2024.2.2 +charset-normalizer==3.3.2 +DateTime==5.5 +html2text==2024.2.26 +idna==3.6 +python-dateutil==2.9.0.post0 +python-whois==0.9.3 +pytz==2024.1 +requests==2.31.0 +setuptools==69.2.0 +six==1.16.0 +termcolor==2.4.0 +urllib3==2.2.1 +zope.interface==6.2