在Ubuntu 20.04上安装SpiderFoot

在本教程中,您将学习如何在 Ubuntu 20.04 上安装 SpiderFoot。SpiderFoot 是一种侦察工具,可自动查询 100 多个公共数据源 (OSINT),以收集有关 IP 地址、域名、电子邮件地址、名称等的情报。您只需指定要调查的目标,选择要启用的模块,然后 SpiderFoot 将收集数据以建立对所有实体及其相互关系的理解

SpiderFoot 的一些常见用例包括:

在 Ubuntu 20.04 上安装 SpiderFoot

先决条件

为了在 Ubuntu 20.04 上安装 SpiderFoot,您需要安装一些软件包依赖项。

运行系统更新

更新和升级您的系统包;

apt update
apt upgrade

在 Ubuntu 20.04 上安装 Python 3

SpiderFoot 是一个基于 Python 的应用程序,因此它需要 Python 3.6+ 才能运行。Ubuntu 20.04 预装了 Python 3。您可以通过运行以下命令来检查已安装的 Python3 版本;

apt list -a python3
python3/focal,now 3.8.2-0ubuntu2 amd64 [installed]

如您所见,我们有 Python 3.8.2,这很好。

安装 Python 3 PIP

运行以下命令安装 Python 3 PIP;

apt install python3-pip

在 Ubuntu 20.04 上安装 SpiderFoot

Github 存储库下载 SipderFoot 源代码的最新稳定版本,在撰写本文时为 v3.2.1;

您可以使用以下命令简单地将其拉出并同时提取;

curl -Ls https://github.com/smicallef/spiderfoot/archive/v3.2.1.tar.gz | tar xz

如果查看当前目录,应该会看到这样一个文件夹;

ls
spiderfoot-3.2.1

要安装包含其他包要求的 SpiderFoot,请导航到上面的目录并运行安装,如下所示;

cd spiderfoot-3.2.1
pip3 install -r requirements.txt

运行蜘蛛脚

安装完成后,SpiderFoot 可以在两种模式下运行;

  • 扫描模式:在命令行上运行 SpiderFoot 扫描,没有启动 web ui。
  • Web UI 模式:使用其内置的 Web 服务器启动 SpiderFoot,以启用来自浏览器的扫描和配置管理。

在扫描模式下运行 SpiderFoot

要在扫描模式下运行 SpiderFoot,请使用以下命令;

cd spiderfoot-3.2.1
python3 sf.py OPTION

可以通过运行命令列出可用选项;

python3 sf.py --help
usage: sf.py [-h] [-d] [-l IP:port] [-m mod1,mod2,...] [-M] [-s TARGET] [-t type1,type2,...] [-T] [-o tab|csv|json] [-H] [-n] [-r] [-S LENGTH] [-D DELIMITER] [-f]
             [-F type1,type2,...] [-x] [-q]

SpiderFoot 3.2.1: Open Source Intelligence Automation.

optional arguments:
  -h, --help          show this help message and exit
  -d, --debug         Enable debug output.
  -l IP:port          IP and port to listen on.
  -m mod1,mod2,...    Modules to enable.
  -M, --modules       List available modules.
  -s TARGET           Target for the scan.
  -t type1,type2,...  Event types to collect (modules selected automatically).
  -T, --types         List available event types.
  -o tab|csv|json     Output format. Tab is default. If using json, -q is enforced.
  -H                  Don't print field headers, just data.
  -n                  Strip newlines from data.
  -r                  Include the source data field in tab/csv output.
  -S LENGTH           Maximum data length to display. By default, all data is shown.
  -D DELIMITER        Delimiter to use for CSV output. Default is ,.
  -f                  Filter out other event types that weren't requested with -t.
  -F type1,type2,...  Show only a set of event types, comma-separated.
  -x                  STRICT MODE. Will only enable modules that can directly consume your target, and if -t was specified only those events will be consumed by modules.
                      This overrides -t and -m options.
  -q                  Disable logging. This will also hide errors!

选项是不言自明的。

在 Web UI 模式下运行 SpiderFoot

为了能够从 Web 界面访问和运行 SpiderFoot 扫描,您可以在 Web ui 模式下启动 SpiderFoot。为此,您需要指定用于访问 SpiderFoot 的接口 IP 和端口。请注意,只要没有其他应用程序使用相同的端口,您就可以使用任何端口。

cd spiderfoot-3.2.1
python3 sf.py -l 192.168.57.3:8080

上面的命令允许使用地址从浏览器访问 SpiderFoot,http://192.168.57.3:8080

Starting web server at 192.168.57.3:8080 ...

********************************************************************
Warning: passwd file contains no passwords. Authentication disabled.
********************************************************************


*************************************************************
 Use SpiderFoot by starting your web browser of choice and 
 browse to http://192.168.57.3:8080
*************************************************************


[19/Jan/2021:18:43:55] ENGINE Listening for SIGTERM.
[19/Jan/2021:18:43:55] ENGINE Listening for SIGHUP.
[19/Jan/2021:18:43:55] ENGINE Listening for SIGUSR1.
[19/Jan/2021:18:43:55] ENGINE Bus STARTING
[19/Jan/2021:18:43:55] ENGINE Serving on http://192.168.57.3:8080
[19/Jan/2021:18:43:55] ENGINE Bus STARTED

如果防火墙正在运行,请打开端口以允许外部访问。

ufw allow 8080/tcp

启用 SpiderFoot 基本身份验证

默认情况下,SpiderFoot 不对 Web UI 实施任何身份验证,任何人都可以访问仪表板。要启用基本身份验证,请输入用户名和密码到 SpiderFoot 目录中的文件格式(尽管仍然是纯文本);

username:password

您可以简单地将用户名和密码回显到文件中;

echo "admin:password" > passwd

重启SpiderFoot,验证基本认证;

python3 sf.py -l 192.168.57.3:8080
python3 sf.py -l 192.168.57.3:8080
Starting web server at 192.168.57.3:8080 ...
Enabling authentication based on supplied passwd file.


*************************************************************
 Use SpiderFoot by starting your web browser of choice and 
 browse to http://192.168.57.3:8080
*************************************************************


[19/Jan/2021:18:54:38] ENGINE Listening for SIGTERM.
[19/Jan/2021:18:54:38] ENGINE Listening for SIGHUP.
[19/Jan/2021:18:54:38] ENGINE Listening for SIGUSR1.
[19/Jan/2021:18:54:38] ENGINE Bus STARTING
[19/Jan/2021:18:54:38] ENGINE Serving on http://192.168.57.3:8080
[19/Jan/2021:18:54:38] ENGINE Bus STARTED

浏览 SpiderFoot Web UI 以执行所需的扫描。

这就是如何在 Ubuntu 20.04 上安装 SpiderFoot。随意探索此工具并根据需要使用它

参考和进一步阅读

为了进一步配置和设置 SpiderFoot,请参阅其文档页面。

SpiderFoot 文档

 收藏 (0) 打赏

您可以选择一种方式赞助本站

支付宝扫一扫赞助

微信钱包扫描赞助

未经允许不得转载:番茄网 » 在Ubuntu 20.04上安装SpiderFoot

分享到: 生成海报

评论 抢沙发

  • QQ号
  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

像番茄一样 表里如一

表里如一表里如一
切换注册

登录

忘记密码 ?

切换登录

注册

我们将发送一封验证邮件至你的邮箱, 请正确填写以完成账号注册和激活