python3批量查询域名是否注册
#!/usr/local/bin/python3
#coding=utf-8 import re,sys,os,random,time, base64
import urllib.parse, urllib.request
import socket timeout = 10
socket.setdefaulttimeout(timeout) proxy_list = [
{'ip':"222.217.99.129", 'port':"", 'type':"http"},
{'ip':"59.53.92.7", 'port':"", 'type':"http"},
{'ip':"58.83.224.217", 'port':"", 'type':"http"},
{'ip':"218.247.244.155", 'port':"", 'type':"http"},
{'ip':"59.173.247.162", 'port':"", 'type':"http"},
{'ip':"125.39.93.68", 'port':"", 'type':"http"},
{'ip':"221.2.80.126", 'port':"", 'type':"http"},
{'ip':"221.235.205.66", 'port':"", 'type':"http"},
{'ip':"220.181.159.60", 'port':"", 'type':"http"},
{'ip':"218.247.244.23", 'port':"", 'type':"http"},
{'ip':"218.241.153.43", 'port':"", 'type':"http"},
{'ip':"125.39.93.69", 'port':"", 'type':"http"},
{'ip':"211.144.76.7", 'port':"", 'type':"http"},
{'ip':"58.53.192.218", 'port':"", 'type':"http"},
{'ip':"222.92.141.155", 'port':"", 'type':"http"},
{'ip':"59.108.53.1", 'port':"", 'type':"http"},
{'ip':"203.93.28.166", 'port':"", 'type':"http"},
{'ip':"60.190.189.214", 'port':"", 'type':"http"},
{'ip':"59.36.183.178", 'port':"", 'type':"http"},
{'ip':"121.11.149.250", 'port':"", 'type':"http"},
{'ip':"212.50.244.8", 'port':"", 'type':"http"},
{'ip':"216.113.208.185", 'port':"", 'type':"http"},
{'ip':"220.181.159.23", 'port':"", 'type':"http"},
{'ip':"59.44.204.198", 'port':"", 'type':"http"},
{'ip':"221.2.174.164", 'port':"", 'type':"http"},
{'ip':"178.135.59.142", 'port':"", 'type':"http"},
{'ip':"202.57.4.124", 'port':"", 'type':"http"},
{'ip':"211.100.52.196", 'port':"", 'type':"http"},
{'ip':"211.144.76.58", 'port':"", 'type':"http"}
] def request_domain(domain):
have_error = True
while have_error:
try:
url = 'http://pandavip.www.net.cn/check/check_ac1.cgi'
user_agent = 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)'
values = {'domain' : domain,}
headers = { 'User-Agent' : user_agent }
data = urllib.parse.urlencode(values).encode()
req = urllib.request.Request(url, data, headers) index = random.randint(0, len(proxy_list) - 1)
proxy = proxy_list[index] if True:
proxy_support = urllib.request.ProxyHandler({proxy['type']: proxy['ip'] +':' + proxy['port']})
opener = urllib.request.build_opener(proxy_support)
urllib.request.install_opener(opener) response = urllib.request.urlopen(req)
the_page = response.read().decode("utf8") except Exception as e:
have_error = True
proxy_list.pop(index)
## print(">>>>>>>>>>> EXCEPTION: " + proxy['ip']+ " " + str(e))
else:
have_error = False
else:
return the_page def construct_domain():
domainList = []
domainList.append({'pre': "doucube", 'ext': "com"})
domainList.append({'pre': "doucube", 'ext': "net"})
domainList.append({'pre': "doucube", 'ext': "org"})
domainList.append({'pre': "doucube", 'ext': "cn"}) for i in range(97, 123):
domain_pre = chr(i)
domainList.append({'pre': domain_pre, 'ext': "cn"}) return domainList def main(): domains = construct_domain() for i in range(0, len(domains)):
domain_full = domains[i]['pre'] + "." + domains[i]['ext']
result = request_domain(domain_full)
cur_time = str(time.strftime("%H:%M:%S", time.localtime()))
if result.find("is not available") != -1:
print(cur_time + "\t" + domain_full + "\tOccupied!")
elif result.find("is available") != -1:
print(cur_time + "\t" + domain_full + "\tFREE! ------->$")
else:
print(cur_time + "\t" + domain_full + "\t" + result) if __name__ == '__main__':
main()
print(base64.b64decode(b'Q29weXJpZ2h0IChjKSAyMDEyIERvdWN1YmUgSW5jLiBBbGwgcmlnaHRzIHJlc2VydmVkLg==').decode())
运行结果:
*** Python 3.2.3 (default, Apr 11 2012, 07:15:24) [MSC v.1500 32 bit (Intel)] on win32. ***
>>>
*** Remote Interpreter Reinitialized ***
>>>
12:21:12 doucube.com Occupied!
12:21:15 doucube.net FREE! ------->$
12:21:29 doucube.org FREE! ------->$
12:21:30 doucube.cn FREE! ------->$
12:21:30 a.cn Occupied!
12:21:33 b.cn Occupied!
12:21:35 c.cn Occupied!
12:21:35 d.cn Occupied!
12:21:37 e.cn Occupied!
12:21:38 f.cn Occupied!
12:21:38 g.cn Occupied!
12:21:42 h.cn Occupied!
12:21:42 i.cn Occupied!
12:21:43 j.cn Occupied!
12:21:45 k.cn Occupied!
12:21:49 l.cn Occupied!
12:21:50 m.cn Occupied!
12:21:50 n.cn Occupied!
12:21:50 o.cn Occupied!
12:21:53 p.cn Occupied!
12:21:53 q.cn Occupied!
12:21:56 r.cn Occupied!
12:21:56 s.cn Occupied!
12:22:06 t.cn Occupied!
12:22:07 u.cn Occupied!
12:22:08 v.cn Occupied!
12:22:08 w.cn Occupied!
12:22:08 x.cn Occupied!
12:22:10 y.cn Occupied!
12:22:11 z.cn Occupied! Copyright (c) 2012 Doucube Inc. All rights reserved. >>>
python3批量查询域名是否注册的更多相关文章
- 未注册wang域名批量查询工具
一.支持规则查询 可自定义生成域名进行查询,可生成任意位数的字母数字域名,根据[声母].[韵母]生成单拼,双拼,三拼等域名,还可根据字典生成,支持全拼.首拼识别,全国城市区号.城市全拼.城市首拼.热门 ...
- linux下查询域名或IP注册信息的操作记录(whois)
在运维工作中,有时需要查询某些域名的注册信息(域名的NS,注册用户,注册邮箱等),可以使用whois这个命令.whois命令令用来查找并显示指定帐号(或域名)的用户相关信息,因为它是到Network ...
- 根据域名查注册人信息,查询邮箱下注册过哪些IP,社工渗透,获取个人信息
根据域名查询注册人信息 举个例子.随便找一个网站 iappp.cn 通过whois查询,得到以下信息 我们可以得知这个域名的注册商(腾讯云),以及注册人真实姓名(也有可能是假的),还有注册人邮箱等等一 ...
- 【Python】批量查询-提取站长之家IP批量查询的结果加强版本v3.0
1.工具说明 写报告的时候为了细致性,要把IP地址对应的地区给整理出来.500多条IP地址找出对应地区复制粘贴到报告里整了一个上午. 为了下次更好的完成这项重复性很高的工作,所以写了这个小的脚本. 某 ...
- Shell 命令行,实现对若干网站状态批量查询是否正常的脚本
Shell 命令行,实现对若干网站状态批量查询是否正常的脚本 如果你有比较多的网站,这些网站的运行状态是否正常则是一件需要关心的事情.但是逐一打开检查那简直是一件太糟心的事情了.所以,我想写一个 sh ...
- 《Advanced Bash-scripting Guide》学习(十):利用whois查询域名信息
本文所选的例子来自于<Advanced Bash-scripting Gudie>一书,译者 杨春敏 黄毅 Example 4-6. wh,whois域名查询 #!/bin/bash #做 ...
- 个人永久性免费-Excel催化剂功能第99波-手机号码归属地批量查询
高潮过往趋于平静,送上简单的手机号码归属地查询,因接口有数量限制,仅能满足少量数据需求,如有大规模数据却又想免费获得,这就成为无解了,数据有价,且用且珍惜. 业务使用场景 除了日常自带的手机各种管家为 ...
- 提取站长之家IP批量查询
1.工具说明 写报告的时候为了细致性,要把IP地址对应的地区给整理出来.500多条IP地址找出对应地区复制粘贴到报告里整了一个上午. 为了下次更好的完成这项重复性很高的工作,所以写了这个小的脚本. 使 ...
- Python + MySQL 批量查询百度收录
做SEO的同学,经常会遇到几百或几千个站点,然后对于收录情况去做分析的情况 那么多余常用的一些工具在面对几千个站点需要去做收录分析的时候,那么就显得不是很合适. 在此特意分享给大家一个批量查询百度收录 ...
随机推荐
- 关于stm32的启动模式
1)用户闪存 = 芯片内置的Flash,这个应该就是在Keil中选择那个,每个芯片的flash不一样,具体可以在建立工程时查看内置flash的大小. 2)SRAM = 芯片内置的RAM区,就是内存啦. ...
- 关于重定向RedirectAttributes的用法(转)
原文地址:https://zhuanlan.zhihu.com/p/21353217?refer=pengsong-java RedirectAttributes 是Spring mvc 3.1版本之 ...
- POJ 1887 Testing the CATCHER(LIS的反面 最大递减子序列)
Language: Default Testing the CATCHER Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 1 ...
- 嵌入式/X86下linux系统死机及内存优化
一. CPU 过高或死锁导致系统卡死 1. CPU占用过高 (1)开线程太多导致CPU占用过高,系统卡死 解决:优化应用层业务逻辑,有些业务不必开线程就不开 (2)频繁清缓存导致读spi-flash ...
- [AHK]自定义默认浏览器
https://blog.csdn.net/liuyukuan/article/details/78844383
- mysql分区功能(三个文件储存一张表)(分区作用)(分区方式)
mysql分区功能(三个文件储存一张表)(分区作用)(分区方式) 一.总结 1.mysql数据表的存储方式(三个文件储存一张表): 一张表主要对应着三个文件,一个是frm存放表结构的,一个是myd存放 ...
- windows下python安装uwsgi
1.使用pip安装 pip install uwsgi 报错:os没有uname() 解决: 定位到uwsgiconfig.py文件中,首先import platform后,将os.unam()都改为 ...
- Android 软键盘监听事件
Android软键盘的隐藏显示研究 Android是一个针对触摸屏专门设计的操作系统,当点击编辑框,系统自动为用户弹出软键盘,以便用户进行输入. 那么,弹出软键盘后必然会造成原有布局高度的减少 ...
- javaScript基本事件
点击事件: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <tit ...
- 微信开发之八 页面获取周围beacon设备
原文链接:https://blog.csdn.net/qq_37936542/article/details/78912197 --注意:微信测试号不具备这个功能 步骤一:绑定域名 注意不要加ht ...