import whois import socket import sys def Query(domain): ip = socket.gethostbyname(str(domain)) # 获取IP地址 data = whois.whois(domain) print ("[+] This server IP is : "+ip) print("Basic information: ") print (data) def mainMod(name, domain): print("\n\ # 好看的字符 ******\n\ *********\n\ ** **\n\ ** **\n\ ** **\n\ ** **\n\ ** **\n\ *******\n\ ***** ") print ('[+] This is '+ name +' Mod!') print ('[+] please wait...') Query(domain) if __name__ == '__main__': if len(sys.argv) == 2: mainMod(sys.argv[0], sys.argv[1])
基本原理是调用whois库和socker库进行数据搜集。不是特别全面。第一个参数给域名就行。