Bing-ip2hosts:一款针对Bing.com的基于IP地址的网络爬虫工具

Bing-ip2hosts

Bing-ip2hosts是一款针对Bing.com站点的网络爬虫工具,该工具基于IP地址实现,能够通过目标IP地址来寻找主机名。

众所周知,Bing是微软公司旗下的旗舰搜索引擎,Bing.com此前还曾被取名为MSN搜索或Live搜索。

该搜索工具提供了搜索引擎独有的一个功能,即允许根据IP地址来进行数据搜索,而Bing-ip2hosts正是基于该功能来实现的。

该工具可以用来发现子域名以及相关域名,而且它还可以帮助研究人员识别托管在共享环境中的站点。这项技术非常适用于渗透测试和漏洞挖掘的初期阶段,也就是网络侦察阶段,以收集到更多的信息,并扩展目标的攻击面。

跟其他网络爬取工具相比,Bing-ip2hosts的不同之处就在于,该工具提供了智能爬取特性,可以最大限度地发现目标主机名。

功能介绍

 1、 智能抓取行为,最大限度地发现主机名。
 2、 在用户控制台界面显示爬取进度。
 3、 根据IP地址查找子域名和目标主机名。
 4、 可以根据主机名或IP地址进行搜索。
 5、 带或不带URL前缀输出数据。
 6、 以列表或CSV格式输出到文件。
 7、 不需要Bing API密钥。
 8、 选择搜索语言和范围。
 9、 从命令行或文件中指定目标。
 10、 轻量级Bash shell脚本,不需要大量依赖项。

工具运行演示

Bing提供了搜索引擎的一种特有功能,即允许通过IP地址来进行数据搜索。首先,我们访问Bing.com,然后搜索IP:40.113.200.201,此时搜索引擎应显示microsoft.com相关的结果,如果显示的是空结果,那么我们可以添加一个“.”。

帮助信息

广大研究人员可以使用下列命令查看工具帮助信息:

bing-ip2hosts is a Bing.com web scraper that discovers websites by IP address.
Use for OSINT and discovering attack-surface of penetration test targets.
Usage: ./bing-ip2hosts [OPTIONS] IP|hostname
OPTIONS are:
-o FILE Output hostnames to FILE.
-i FILE Input list of IP addresses or hostnames from FILE.
-n NUM  Stop after NUM scraped pages return no new results (Default: 5).
-l  Select the language for use in the setlang parameter (Default: en-us).
-m  Select the market for use in the setmkt parameter (Default is unset).
-u  Only display hostnames. Default is to include URL prefixes.
-c  CSV output. Outputs the IP and hostname on each line, separated by a comma.
-q  Quiet. Disable output except for final results.
-t DIR  Use this directory instead of /tmp.
-V  Display the version number of bing-ip2hosts and exit.

工具安装

依赖组件

Bing-ip2hosts需要wget才可以正常运行,但该工具在Ubuntu Linux和Kali Linux平台上已经默认安装了。在macOS平台上,我们可以使用homebrew来安装wget:

homebrew install wget

当然了,我们也可以使用apt在Debian和Ubuntu上安装wget:

sudo apt install wget

安装命令

首先,使用下列命令将项目源码克隆至本地:

git clone https://github.com/urbanadventurer/bing-ip2hosts.git

然后将Bing-ip2hosts的路径地址写到$PATH环境变量中:

sudo cp ./bing-ip2hosts /usr/local/bin/

工具兼容性

Bing-ip2hosts使用了Bash脚本语言,并且支持在下列操作系统中运行:

Ubuntu Linux

GNU bash, version 4.4.20(1)-release (x86_64-pc-linux-gnu)

Copyright (C) 2016 Free Software Foundation, Inc.

License GPLv3+: GNU GPL version 3 or later < http://gnu.org/licenses/gpl.html >

This is free software; you are free to change and redistribute it.

There is NO WARRANTY, to the extent permitted by law.

macOS Catalina

GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin19)
Copyright (C) 2007 Free Software Foundation, Inc.

项目地址

Bing-ip2hosts:【 GitHub传送门

参考来源

urbanadventurer