在 Kali Linux 上安装和验证 Gobuster

Beginner
立即练习

引言

Gobuster 是一个强大的工具,用于目录和文件暴力破解、DNS 子域暴力破解以及 S3 存储桶枚举。它是渗透测试人员和安全爱好者发现 Web 服务器上隐藏路径和资源的重要实用程序。

在本实验中,你将学习在 Kali Linux 环境中安装 Gobuster 的基本步骤。你将使用 apt 包管理器来安装该工具,然后通过检查其版本和浏览其帮助菜单来验证安装是否成功。这些实践经验将为你开始使用 Gobuster 进行安全评估提供必要的技能。

在 Kali Linux 中打开终端

在此步骤中,你将在 Kali Linux 环境中打开一个终端窗口。终端是你将执行所有安装和验证 Gobuster 命令的地方。

要打开终端,你通常可以在桌面或应用程序菜单中找到一个图标。打开后,你将看到一个命令提示符,通常显示你的用户名和当前目录,例如 labex@labex-vm:~/project$

## 这里没有需要执行的命令,只需打开终端。

使用 apt 更新软件包列表

在此步骤中,你将更新 Kali Linux 系统的软件包列表。这可以确保你的系统拥有关于可用软件包及其版本的最新信息,这在安装新软件之前至关重要。

使用 sudo apt update 命令刷新软件包列表。sudo 命令允许你以超级用户权限运行命令,这对于更新软件包列表等系统级操作是必需的。

sudo apt update

你应该会看到类似以下的输出,表明软件包列表正在更新:

Hit:1 http://kali.download/kali kali-rolling InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.

使用 apt 安装 Gobuster

在此步骤中,你将使用 apt 包管理器安装 Gobuster。Kali Linux 软件源中包含了 Gobuster,这使得安装过程非常直接。

执行 sudo apt install gobuster -y 命令。-y 标志会在安装过程中自动确认所有提示,从而实现非交互式安装。

sudo apt install gobuster -y

你应该会看到类似以下的输出,表明安装进度:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  gobuster
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 3,500 kB of archives.
After this operation, 12.5 MB of additional disk space will be used.
Get:1 http://kali.download/kali kali-rolling/main amd64 gobuster amd64 3.1.0-1kali1 [3,500 kB]
Fetched 3,500 kB in 1s (3,000 kB/s)
Selecting previously unselected package gobuster.
(Reading database ... 300000 files and directories currently installed.)
Preparing to unpack .../gobuster_3.1.0-1kali1_amd64.deb ...
Unpacking gobuster (3.1.0-1kali1) ...
Setting up gobuster (3.1.0-1kali1) ...
Processing triggers for man-db (2.10.2-1) ...

通过检查版本来验证安装

在此步骤中,你将通过检查其版本来验证 Gobuster 是否已成功安装。这是确认命令行工具可访问且运行正常的常用方法。

运行 gobuster --version 命令。此命令将输出已安装的 Gobuster 版本。

gobuster --version

你应该会看到类似以下的输出,表明版本号:

gobuster v3.1.0

显示 Gobuster 帮助菜单

在最后一步中,你将显示 Gobuster 帮助菜单。这是了解该工具功能、可用命令和选项的概览的好方法。它也确认 Gobuster 可执行文件已完全正常工作。

执行 gobuster -h 命令来显示主帮助菜单。

gobuster -h

你将看到一个全面的输出,列出了 Gobuster 的各种模式(例如 dirdnsvhosts3gcsfuzz)及其各自的选项。这表明 Gobuster 已准备就绪。

Usage:
  gobuster [command]

Available Commands:
  dir         Uses directory/file brute-forcing mode
  dns         Uses DNS subdomain brute-forcing mode
  fuzz        Uses fuzzing mode
  help        Help about any command
  s3          Uses AWS S3 bucket enumeration mode
  gcs         Uses Google Cloud Storage bucket enumeration mode
  vhost       Uses VHOST brute-forcing mode

Flags:
  -z, --no-color          Disable color output
  -q, --quiet             Don't print the banner and other noise
  -v, --verbose           Verbose output (errors)
  -h, --help              help for gobuster
  -V, --version           version for gobuster

Use "gobuster [command] --help" for more information about a command.

总结

在此实验中,你使用 apt 包管理器在 Kali Linux 环境中成功安装了 Gobuster。你学会了如何更新系统的包列表、安装新软件,然后通过检查工具版本和显示其帮助菜单来验证安装。

现在你已经设置好了 Gobuster,可以将其用于各种安全任务,例如目录和文件暴力破解。对于任何希望执行 Web 应用程序安全评估或探索目标系统上隐藏资源的人来说,这些基础知识至关重要。