simplify cleanup code, remove duplicate logic
This commit is contained in:
parent
9d13df3a25
commit
8b050fcc9b
|
@ -112,16 +112,16 @@ class MetasploitModule < Msf::Post
|
||||||
|
|
||||||
print_status("Attempting to get password hashes...")
|
print_status("Attempting to get password hashes...")
|
||||||
|
|
||||||
get_hash_result = run_sql(query, instance_name)
|
res = run_sql(query, instance_name)
|
||||||
|
|
||||||
if get_hash_result.include?('0x')
|
if res.include?('0x')
|
||||||
# Parse Data
|
# Parse Data
|
||||||
if hash_type == "mssql12"
|
if hash_type == "mssql12"
|
||||||
crlfRepair = get_hash_result.unpack('H*')[0].gsub("200d0a","PLACEHOLDER").gsub("0d0a","").gsub("PLACEHOLDER","0d0a").gsub(/../) { |pair| pair.hex.chr }
|
res = res.unpack('H*')[0].gsub("200d0a", "_CRLF_").gsub("0d0a", "").gsub("_CRLF_", "0d0a").gsub(/../) {
|
||||||
hash_array = crlfRepair.split("\r\n").grep(/0x/)
|
|pair| pair.hex.chr
|
||||||
else
|
}
|
||||||
hash_array = get_hash_result.split("\r\n").grep(/0x/)
|
|
||||||
end
|
end
|
||||||
|
hash_array = res.split("\r\n").grep(/0x/)
|
||||||
|
|
||||||
store_hashes(hash_array, hash_type)
|
store_hashes(hash_array, hash_type)
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue