-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwhois.py
24 lines (22 loc) · 1.42 KB
/
whois.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import requests
import colorama
def test():
print("WHOIS")
param = input("Input a domain: ")
if param == '' :
return test()
print("Loading ... ")
r = requests.get('https://whois.inet.vn/api/whois/domainspecify/' + param, json={})
response = r.json()
print(colorama.Fore.LIGHTCYAN_EX + 'Message: ' + colorama.Fore.LIGHTYELLOW_EX+f'{response.get("message")}')
print(colorama.Fore.LIGHTCYAN_EX + 'Code: ' + colorama.Fore.LIGHTYELLOW_EX+f'{"Not register" if response.get("code") == "1" else "Registered"}')
print(colorama.Fore.LIGHTCYAN_EX + 'Domain Name: ' + colorama.Fore.LIGHTYELLOW_EX+f'{response.get("domainName")}')
print(colorama.Fore.LIGHTCYAN_EX + 'Registrar: ' + colorama.Fore.LIGHTYELLOW_EX+f'{response.get("registrar")}')
print(colorama.Fore.LIGHTCYAN_EX + 'Registrant: ' + colorama.Fore.LIGHTYELLOW_EX+f'{response.get("Registrant")}')
print(colorama.Fore.LIGHTCYAN_EX + 'Creation Date: ' + colorama.Fore.LIGHTYELLOW_EX+f'{response.get("creationDate")}')
print(colorama.Fore.LIGHTCYAN_EX + 'Expiry Date: ' + colorama.Fore.LIGHTYELLOW_EX+f'{response.get("expirationDate")}')
print(colorama.Fore.LIGHTCYAN_EX + 'Name Server: ' + colorama.Fore.LIGHTYELLOW_EX+f'{response.get("nameServer")}')
print(colorama.Fore.LIGHTCYAN_EX + 'Status: ' + colorama.Fore.LIGHTYELLOW_EX+f'{response.get("status")}')
print(colorama.Fore.RESET)
input("Press any key to exit! ")
return False