1.可以直接读取目标URL.txt进行批量子域名扫描
2.所有的子域名信息进行集中汇总成ips.txt和urls.txt**
这样可以省了很多时间,只要每次把要扫描的目标批量放进txt文档,就会自动生成纯ip和纯url的txt文档,省去了整理筛选的时间,直接可以进行下一步调用nmap扫描全端口,dirmap扫描敏感目录的批量操作。
原始工具下载地址
https://github.com/lijiejie/subDomainsBrute/
lijiejie的subDomainsBrute,挺好用的子域名扫描工具,但是作者一直没有增加批量扫描读取文件的选项,看了下代码,不是很难,就简单的改造下。
主要在主函数中添加如下的代码,简单判处参数中是否有.txt后缀,有的话,把目标url读取进来,接着打印下总的参数、目标,最后就是依次读取URL进行扫描了。
if '.txt' in args[0]:
with open(args[0], 'r') as f:
target_urls = f.readlines()
else:
target_urls = args[0].split()
print "options:\n"+str(options)
print "target:\n"+args[0]
print "target_urls:\n"+str(target_urls)
for target_url in target_urls:
target_url = target_url.rstrip('\n')
print target_url
最后会自动合并所有子域名的文件,生成ips.txt和urls.txt两个子文件,是汇总所有的
urls = ''
ips = ''
with open(out_file_name, 'r') as f:
for line in f:
line = line.strip('\n')
urls = urls + line.split('\t')[0] + '\n'
ips = ips + line.split('\t')[1].split(',')[0] + '\n'
with open("ips.txt", 'a+') as f:
f.write(ips)
with open("urls.txt", 'a+') as f:
f.write(urls)
使用方法不变
Usage: subDomainsBrute.py [options] target.com
Options:
--version show program's version number and exit
-h, --help show this help message and exit
-f FILE File contains new line delimited subs, default is
subnames.txt.
--full Full scan, NAMES FILE subnames_full.txt will be used
to brute
-i, --ignore-intranet
Ignore domains pointed to private IPs
-t THREADS, --threads=THREADS
Num of scan threads, 200 by default
-p PROCESS, --process=PROCESS
Num of scan Process, 6 by default
-o OUTPUT, --output=OUTPUT
Output file name. default is {target}.txt
只是增加了读取文件的功能,举例两种常用方式,默认6个进程,200个线程,可以瞬间撑爆CPU,建议减低点
python subDomainsBrute.py -p 6 -t 30 --full www.baidu.com
python subDomainsBrute.py -p 6 -t 30 -full target.txt
修改后的下载地址:
链接:https://pan.baidu.com/s/1svzvIEKxuO1pkMVRNzMXUA
提取码:mlg0