diff --git a/lib/msf/core/db.rb b/lib/msf/core/db.rb index 60c843ed03..c0963cd03c 100644 --- a/lib/msf/core/db.rb +++ b/lib/msf/core/db.rb @@ -1944,7 +1944,7 @@ class DBManager return REXML::Document.new(data) rescue REXML::ParseException => e dlog("REXML error: Badly formatted XML, attempting to recover. Error was: #{e.inspect}") - return REXML::Document.new(data.gsub(/([\x00-\x08\x0b\x0c\x0e-\x19\x80-\xff])/){ |x| "\\x%.2x" % x.unpack("C*")[0] }) + return REXML::Document.new(data.gsub(/([\x00-\x08\x0b\x0c\x0e-\x1f\x80-\xff])/){ |x| "\\x%.2x" % x.unpack("C*")[0] }) end end end diff --git a/lib/msf/core/db_export.rb b/lib/msf/core/db_export.rb index e245c316f4..8ad1a03929 100644 --- a/lib/msf/core/db_export.rb +++ b/lib/msf/core/db_export.rb @@ -306,7 +306,7 @@ class Export if value data = marshalize(value) data.force_encoding(Encoding::BINARY) if data.respond_to?('force_encoding') - data.gsub!(/([\x00-\x08\x0b\x0c\x0e-\x19\x80-\xFF])/){ |x| "\\x%.2x" % x.unpack("C*")[0] } + data.gsub!(/([\x00-\x08\x0b\x0c\x0e-\x1f\x80-\xFF])/){ |x| "\\x%.2x" % x.unpack("C*")[0] } el << REXML::Text.new(data) end return el diff --git a/modules/auxiliary/scanner/ssh/ssh_login_pubkey.rb b/modules/auxiliary/scanner/ssh/ssh_login_pubkey.rb index c32b407c38..67ccab7a26 100644 --- a/modules/auxiliary/scanner/ssh/ssh_login_pubkey.rb +++ b/modules/auxiliary/scanner/ssh/ssh_login_pubkey.rb @@ -114,7 +114,7 @@ class Metasploit3 < Msf::Auxiliary # Needs an end next unless key =~ /\n-----END [RD]SA PRIVATE KEY-----\x0d?\x0a$/m # Shouldn't have binary. - next unless key.scan(/[\x00-\x08\x0b\x0c\x0e-\x19\x80-\xff]/).empty? + next unless key.scan(/[\x00-\x08\x0b\x0c\x0e-\x1f\x80-\xff]/).empty? # Add more tests to taste. keepers << key end