From 6c319469959f32ad4c542874de38e665db85622b Mon Sep 17 00:00:00 2001 From: Jon Hart Date: Thu, 3 Dec 2015 15:19:35 -0800 Subject: [PATCH] Slightly simplify regex --- modules/auxiliary/scanner/misc/dahua_dvr_auth_bypass.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/auxiliary/scanner/misc/dahua_dvr_auth_bypass.rb b/modules/auxiliary/scanner/misc/dahua_dvr_auth_bypass.rb index 458e8bd8cc..27d81debad 100644 --- a/modules/auxiliary/scanner/misc/dahua_dvr_auth_bypass.rb +++ b/modules/auxiliary/scanner/misc/dahua_dvr_auth_bypass.rb @@ -104,7 +104,7 @@ class Metasploit3 < Msf::Auxiliary sock.put(EMAIL) if data = sock.get_once.split('&&') print_status("Email Settings: @ #{rhost}:#{rport}!") - if data[0] =~ /([\x00]{8,}(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?+:\d+)/ + if data[0] =~ /([\x00]{8,}(?=.{1,255}$)[0-9A-Z](?:(?:[0-9A-Z]|-){0,61}[0-9A-Z])?(?:\.[0-9A-Z](?:(?:[0-9A-Z]|-){0,61}[0-9A-Z])?)*\.?+:\d+)/i if mailhost = Regexp.last_match[1].split(':') print_status(" Server: #{mailhost[0]}") unless mailhost[0].nil? print_status(" Server Port: #{mailhost[1]}") unless mailhost[1].nil? @@ -202,7 +202,7 @@ class Metasploit3 < Msf::Auxiliary print_status("Users\\Hashed Passwords\\Rights\\Description: @ #{rhost}:#{rport}!") data.each do |val| usercount += 1 - pass = "#{val[/(([\d]+)[:]([0-9A-Za-z]+)[:]([0-9A-Za-z]+))/]}" + pass = "#{val[/(([\d]+)[:]([0-9A-Z]+)[:]([0-9A-Z]+))/i]}" value = pass.split(":") user = "#{value[1]}" md5hash = "#{value[2]}"