From 8e83f0ee306a61f208ab0ed4dfef6f965641b4d6 Mon Sep 17 00:00:00 2001 From: Carlos Perez Date: Sun, 9 Jun 2013 20:41:46 -0400 Subject: [PATCH 1/2] Add Windows 8 and 2012 to regex matching --- modules/post/windows/gather/smart_hashdump.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/post/windows/gather/smart_hashdump.rb b/modules/post/windows/gather/smart_hashdump.rb index 1e994d5c2c..98edb822e7 100644 --- a/modules/post/windows/gather/smart_hashdump.rb +++ b/modules/post/windows/gather/smart_hashdump.rb @@ -447,7 +447,7 @@ class Metasploit3 < Msf::Post rescue::Exception => e print_error("Failed to dump hashes as SYSTEM, trying to migrate to another process") - if sysinfo['OS'] =~ /(Windows 2008)/i + if sysinfo['OS'] =~ /Windows 2008/i move_to_sys file_local_write(pwdfile,inject_hashdump) else @@ -474,7 +474,7 @@ class Metasploit3 < Msf::Post results = session.priv.getsystem if results[0] print_good("Got SYSTEM privilege") - if session.sys.config.sysinfo['OS'] =~ /(Windows 2008)/i + if session.sys.config.sysinfo['OS'] =~ /Windows (2008|2012)/i # Migrate process since on Windows 2008 R2 getsystem # does not set certain privilege tokens required to # inject and dump the hashes. @@ -489,7 +489,7 @@ class Metasploit3 < Msf::Post end end - elsif sysinfo['OS'] =~ /(Windows 7|2008|Vista)/i + elsif sysinfo['OS'] =~ /Windows (7|8|2008|2012|Vista)/i if migrate_system print_status("Trying to get SYSTEM privilege") results = session.priv.getsystem From a9df55c27aa5a6407e09a39d260879903c79a817 Mon Sep 17 00:00:00 2001 From: Carlos Perez Date: Sun, 9 Jun 2013 20:46:44 -0400 Subject: [PATCH 2/2] Add Windows 2012 to regex matching --- modules/post/windows/gather/smart_hashdump.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/post/windows/gather/smart_hashdump.rb b/modules/post/windows/gather/smart_hashdump.rb index 98edb822e7..a28dcf0fdc 100644 --- a/modules/post/windows/gather/smart_hashdump.rb +++ b/modules/post/windows/gather/smart_hashdump.rb @@ -447,7 +447,7 @@ class Metasploit3 < Msf::Post rescue::Exception => e print_error("Failed to dump hashes as SYSTEM, trying to migrate to another process") - if sysinfo['OS'] =~ /Windows 2008/i + if sysinfo['OS'] =~ /Windows (2008|2012)/i move_to_sys file_local_write(pwdfile,inject_hashdump) else