AdrianSz
Occasional Visitor
I wanted to raise the concern of potentially lacking internal router hardening in cases where router is hijicked/exploited by any means.
Such means could be attacker getting into router via software exploit/bug of any of the services that are enabled in the router. Routers are open for customizations and execution of partner software/plugins and majority of people trust too much on the 3pps; including trusting non stock firmware.
Note: I know too little about the this router internal FS structure hence I am not sure listed things below are really a big deal.
File permissions
First thing I wonder why file permissions are so wide open on various files? Example of /tmp.
In case of attacker gets into router, he can easily delete audit trail logs:
-rw-rw-rw- 1 admin root 1048600 Feb 24 13:59 syslog.log-1
-rw-rw-rw- 1 admin root 99541 Feb 24 14:09 syslog.log
-rw-rw-rw- 1 admin root 47 May 5 2018 resolv.conf
When I see executables that are world writeable I get always really nervous.
-rw-rw-rw- 1 admin root 237 May 5 2018 run_lldpd.sh
I guess something like su -l nobody rm -rf /; reboot would be a good test.
Kernel version
I feel personally bit bothered buying new router, having kernel 4.1 from mid 2015. Which is indeed LTS, but hey, way too old with respect to optimizations, security hardening and feature set. Why not picking 4.14 LTS as baseline and later switch to 4.19 LTS / 5.x LTS at end of the year.
Daemon execution
All daemons seem to execute under single admin user.
10441 admin 2696 R dropbear -p 5022 -a
1103 admin 3192 S avahi-daemon: running [RT-AX88U-3958.local]
1148 admin 9620 S erp_monitor
985 admin 3184 S /sbin/syslogd -m 0 -S -O /tmp/syslog.log -s 1024 -l 6
Kernel module bloat
Modules loaded, but not really used.
When I saw huawei_cdc_ncm loaded I had to quickly investigate what the heck this is, and that this is used in 3G/4G WAN access via mobile use cases. Which I am not using and most users wont be using.
Sandboxing & confinement
Connected to above as well. seccomp / selinux / cgroups / containers not used. Perhaps performance hit is too big ?
Perhaps the embedded SW mindset in the past considered this is not needed, but now with the SW extendability its less obvious running without any confinements.
Server socket bindings including WAN interface
admin@RT-AX88U:/# netstat -antu | grep 0.0.0.0:[[:digit:]]
tcp 0 0 0.0.0.0:5473 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:18017 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:3394 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:7788 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:56461 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:5022 0.0.0.0:* LISTEN
udp 0 0 0.0.0.0:67 0.0.0.0:*
udp 0 0 0.0.0.0:18018 0.0.0.0:*
udp 0 0 0.0.0.0:7788 0.0.0.0:*
udp 0 0 0.0.0.0:59000 0.0.0.0:*
udp 0 0 0.0.0.0:5353 0.0.0.0:*
udp 0 0 0.0.0.0:9999 0.0.0.0:*
udp 0 0 0.0.0.0:5474 0.0.0.0:*
udp 0 0 0.0.0.0:1900 0.0.0.0:*
udp 0 0 0.0.0.0:55178 0.0.0.0:*
ubuntu@ax88u-compile:~/$ nmap -p 1-60000 -A -T4 ***masked wan ip***
Nmap scan report for ***masked*** (***masked***)
Not shown: 59994 closed ports
PORT STATE SERVICE VERSION
3394/tcp open d2k-tapestry2?
5022/tcp open ssh Dropbear sshd 2016.74 (protocol 2.0)
5473/tcp open apsolab-tags?
7788/tcp open tcpwrapped
18017/tcp open http Asus wanduck WAN monitor httpd
|_http-server-header: wanduck
56461/tcp open upnp MiniUPnP 1.9 (AsusWRT 9.0.0.4; UPnP 1.1)
Service Info: OS: Linux; Device: WAP; CPE: cpe:/o:linux:linux_kernel, cpe:/o:asus:asuswrt:9.0.0.4
Depending how the thread goes perhaps slogan can be renamed.
Such means could be attacker getting into router via software exploit/bug of any of the services that are enabled in the router. Routers are open for customizations and execution of partner software/plugins and majority of people trust too much on the 3pps; including trusting non stock firmware.
Note: I know too little about the this router internal FS structure hence I am not sure listed things below are really a big deal.
File permissions
First thing I wonder why file permissions are so wide open on various files? Example of /tmp.
In case of attacker gets into router, he can easily delete audit trail logs:
-rw-rw-rw- 1 admin root 1048600 Feb 24 13:59 syslog.log-1
-rw-rw-rw- 1 admin root 99541 Feb 24 14:09 syslog.log
-rw-rw-rw- 1 admin root 47 May 5 2018 resolv.conf
When I see executables that are world writeable I get always really nervous.
-rw-rw-rw- 1 admin root 237 May 5 2018 run_lldpd.sh
I guess something like su -l nobody rm -rf /; reboot would be a good test.
Kernel version
I feel personally bit bothered buying new router, having kernel 4.1 from mid 2015. Which is indeed LTS, but hey, way too old with respect to optimizations, security hardening and feature set. Why not picking 4.14 LTS as baseline and later switch to 4.19 LTS / 5.x LTS at end of the year.
Daemon execution
All daemons seem to execute under single admin user.
10441 admin 2696 R dropbear -p 5022 -a
1103 admin 3192 S avahi-daemon: running [RT-AX88U-3958.local]
1148 admin 9620 S erp_monitor
985 admin 3184 S /sbin/syslogd -m 0 -S -O /tmp/syslog.log -s 1024 -l 6
Kernel module bloat
Modules loaded, but not really used.
When I saw huawei_cdc_ncm loaded I had to quickly investigate what the heck this is, and that this is used in 3G/4G WAN access via mobile use cases. Which I am not using and most users wont be using.
Sandboxing & confinement
Connected to above as well. seccomp / selinux / cgroups / containers not used. Perhaps performance hit is too big ?
Perhaps the embedded SW mindset in the past considered this is not needed, but now with the SW extendability its less obvious running without any confinements.
Server socket bindings including WAN interface
admin@RT-AX88U:/# netstat -antu | grep 0.0.0.0:[[:digit:]]
tcp 0 0 0.0.0.0:5473 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:18017 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:3394 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:7788 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:56461 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:5022 0.0.0.0:* LISTEN
udp 0 0 0.0.0.0:67 0.0.0.0:*
udp 0 0 0.0.0.0:18018 0.0.0.0:*
udp 0 0 0.0.0.0:7788 0.0.0.0:*
udp 0 0 0.0.0.0:59000 0.0.0.0:*
udp 0 0 0.0.0.0:5353 0.0.0.0:*
udp 0 0 0.0.0.0:9999 0.0.0.0:*
udp 0 0 0.0.0.0:5474 0.0.0.0:*
udp 0 0 0.0.0.0:1900 0.0.0.0:*
udp 0 0 0.0.0.0:55178 0.0.0.0:*
ubuntu@ax88u-compile:~/$ nmap -p 1-60000 -A -T4 ***masked wan ip***
Nmap scan report for ***masked*** (***masked***)
Not shown: 59994 closed ports
PORT STATE SERVICE VERSION
3394/tcp open d2k-tapestry2?
5022/tcp open ssh Dropbear sshd 2016.74 (protocol 2.0)
5473/tcp open apsolab-tags?
7788/tcp open tcpwrapped
18017/tcp open http Asus wanduck WAN monitor httpd
|_http-server-header: wanduck
56461/tcp open upnp MiniUPnP 1.9 (AsusWRT 9.0.0.4; UPnP 1.1)
Service Info: OS: Linux; Device: WAP; CPE: cpe:/o:linux:linux_kernel, cpe:/o:asus:asuswrt:9.0.0.4
Depending how the thread goes perhaps slogan can be renamed.
Last edited: