首页 > 其他 > 详细

子域名查询

时间:2015-05-04 20:28:01      阅读:284      评论:0      收藏:0      [点我收藏+]

学了一天python的 写了个小工具

接口调用的是:http://i.links.cn/subdomain/

#coding:utf-8
#date : 2015年5月4日
#author : sanr
import requests,re

def domain(url):
	payload = {‘domain‘ : url, ‘b2‘ : ‘1‘, ‘b3‘ : ‘1‘, ‘b4‘ : ‘1‘}
	r = requests.get("http://i.links.cn/subdomain/", params=payload)	
	file=r.text.encode(‘ISO-8859-1‘)
	#正则
	regex = re.compile(‘value="(.+?)"><input‘)
	#匹配
	result=regex.findall(file)
	#list转换str
	list = ‘\n‘.join(result)
	#把匹配到的结果写入txt  txt名字取用户输入
	f=open(url+‘.txt‘,‘w‘)
	f.write(list) 
	f.close()
	return;
url=raw_input("url:")
domain(url)


本文出自 “Sanr” 博客,请务必保留此出处http://0x007.blog.51cto.com/6330498/1641743

子域名查询

原文:http://0x007.blog.51cto.com/6330498/1641743

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!