Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added whois lookup #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.vscode/

env/
*.pyc
*/__pycache__
8 changes: 6 additions & 2 deletions dark-fantasy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand All @@ -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()
Expand All @@ -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")

Expand Down
62 changes: 62 additions & 0 deletions modules/whois_lookup.py
Original file line number Diff line number Diff line change
@@ -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")




18 changes: 14 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -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