数字秘密的守护者

CybersecurityCybersecurityBeginner
立即练习

💡 本教程由 AI 辅助翻译自英文原版。如需查看原文,您可以 切换至英文原版

引言

在一个远超越现代数字世界的领域,坐落于古老东方土地的心脏地带,有一座具有空前历史意义的寺庙。这座寺庙笼罩在神秘和古老传说之中,由一位永恒的守护者保护着。这位守护者被称为“守护者”(The Keeper),其职责不仅仅是物理保护;他们还是古老知识和秘密的保管者。然而,他们最新的挑战超越了物理领域。在一个威胁不再仅仅挥舞刀剑,而是掌握数字力量的时代,守护者必须进化,学习数字防御的艺术,以保护寺庙的秘密免受网络入侵者的侵害。

以寺庙为背景,你作为守护者的学徒,任务是掌握 Nmap OS 和版本检测的奥秘艺术。通过这项技能,你将学会识别连接到寺庙网络的设备的操作系统和版本,从而能够检测潜在威胁并保护寺庙的数字堡垒。


Skills Graph

%%%%{init: {'theme':'neutral'}}%%%% flowchart RL cybersecurity(("`Cybersecurity`")) -.-> cybersecurity/NmapGroup(["`Nmap`"]) cybersecurity/NmapGroup -.-> cybersecurity/nmap_installation("`Nmap Installation and Setup`") cybersecurity/NmapGroup -.-> cybersecurity/nmap_port_scanning("`Nmap Port Scanning Methods`") cybersecurity/NmapGroup -.-> cybersecurity/nmap_target_specification("`Nmap Target Specification`") cybersecurity/NmapGroup -.-> cybersecurity/nmap_os_version_detection("`Nmap OS and Version Detection`") subgraph Lab Skills cybersecurity/nmap_installation -.-> lab-415925{{"`数字秘密的守护者`"}} cybersecurity/nmap_port_scanning -.-> lab-415925{{"`数字秘密的守护者`"}} cybersecurity/nmap_target_specification -.-> lab-415925{{"`数字秘密的守护者`"}} cybersecurity/nmap_os_version_detection -.-> lab-415925{{"`数字秘密的守护者`"}} end

设置你的环境

在这一步中,我们将建立本地环境来模拟扫描目标服务器,代表一个数字入侵者。这将为你磨练使用 Nmap 进行操作系统和版本检测的技能奠定基础。

首先,打开终端并确保你在正确的目录中工作:

cd /home/labex/project

接下来,我们将在你的本地网络上模拟一个服务器。

使用 netcat 工具在端口 4444 上设置一个简单的服务器。该服务器将在端口 4444 上监听传入的连接。运行以下命令:

sudo sh -c 'echo "nameserver 8.8.8.8" > /etc/resolv.conf'
nc -lvp 4444 -k

-k 标志允许 netcat 在第一个连接关闭后继续监听传入的连接。这对于模拟持久性服务非常有用。

保持此终端打开,因为它将作为我们 Nmap 扫描的目标服务器。

基本的操作系统和版本检测

在这一步中,我们将使用 Nmap 对目标服务器执行操作系统和版本检测。这将帮助你理解识别目标系统上运行的操作系统和软件版本的重要性。

现在,服务器正在运行,我们准备使用 Nmap 执行第一次扫描。打开一个新的终端窗口并导航到你的项目目录:

cd /home/labex/project

以下命令将尝试确定运行在本地主机端口 4444 上的主机的操作系统:

sudo nmap -O localhost -p 4444 > /home/labex/project/nmap_os_detection.txt

-O 选项告诉 Nmap 尝试识别目标的操作系统。

检查 nmap_os_detection.txt 文件以查看扫描结果。

cat /home/labex/project/nmap_os_detection.txt

该文件将包含 Nmap 检测到的操作系统和版本信息。

Starting Nmap 7.80 ( https://nmap.org ) at 2024-07-02 15:08 CST
Nmap scan report for localhost (127.0.0.1)
Host is up (0.000024s latency).
Other addresses for localhost (not scanned): ::1

PORT     STATE SERVICE
4444/tcp open  krb524
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running: Linux 2.6.X
OS CPE: cpe:/o:linux:linux_kernel:2.6.32
OS details: Linux 2.6.32
Network Distance: 0 hops

OS detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 1.57 seconds

总结

在本实验中,你学习了如何使用 Nmap 对目标服务器执行操作系统和版本检测。这是网络安全专业人员的一项关键技能,因为它有助于识别目标系统上运行的操作系统和软件版本。

您可能感兴趣的其他 Cybersecurity 教程