Miscellaneous

6.1 Reclaim memory space

We can attempt to reclaim memory space on the router by killing some of the unneccessary processes

View current processes:

UART console
# ps
...
264 root       3332 S   resetbutton
329 root       2440 S   tftpd -s /tmp -c -l -P E150
330 root       2168 S   cron
333 root       3864 S   httpd
336 root       3864 S   /tmp/gn-httpd -p 51000 -G
340 root       2272 S   dnsmasq -R -h -i br1 -i br0 -c 0 -r /tmp/resolv.conf
345 root       1024 S   cesmDNS -o /tmp/.mdns_host_info -d -h CISCO007 -l 192
347 root       6936 S   /tmp/gn-dhcpd -cf /tmp/dhcpd-br1.conf -lf /tmp/dhcpd-
349 root       6936 S   dhcpd -cf /tmp/dhcpd-br0.conf -lf /tmp/dhcpd.leases -
354 root       3164 S   upnp -D -W vlan2
385 root       2180 S   /bin/eapd
388 root       2576 S   nas
392 root       3764 S   /bin/wps_monitor
394 root       2156 S   netbios /tmp/samba/lib/netbios.conf
419 root       1436 S   /usr/sbin/lld2d br0
473 root       2804 S   /sbin/monitor_cable
536 root       1772 S   /bin/sh

View more information about a particular process:

Kill the process

  • From the known running processes, we can consider killing the following:

  • May lose DHCP/DNS name resolution

  • UART access and /tmp/gn-httpd unaffected

  • Lose wifi capabilities

  • Ethernet + UART unaffected

  • Other processes that are safe to kill

DO NOT KILL THE FOLLOWING

Verify newly reclaimed memory:

6.2 Transfer binary from host to device

Remember to always check the available memory space available on the device, before transferring files

Before we continue, let's install the busybox binary on the device (via UART), which provides us with a more comprehensive set of tools

Host:

Device (UART console):

6.3 Transfer binary from device to host

6.3.1 tftp

Host:

  • Enable tftp server

Device (UART console):

6.3.2 Netcat (busybox)

Device (UART console):

Host:

  • We can now access the vulnerable binary from /path/to/gn-httpd on the host machine

Last updated