New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix migrate by process name #8110

Merged
merged 1 commit into from Mar 15, 2017

Conversation

Projects
None yet
5 participants
@rwhitcroft
Copy link
Contributor

rwhitcroft commented Mar 14, 2017

Fixes #8109

This fixes the ability to migrate into a process by name (e.g., explorer.exe). The if/else block would never reach the NAME check because pid != 0 is always true (unless for some reason you specifically set it to 0).

Rich Whitcroft
@@ -42,7 +42,7 @@ def run
if datastore['SPAWN']
print_status("Spawning notepad.exe process to migrate to")
target_pid = create_temp_proc
elsif datastore['PID'] != 0

This comment has been minimized.

@wvu-r7

wvu-r7 Mar 14, 2017

Contributor

Damn.

This comment has been minimized.

@jeffmcjunkin

jeffmcjunkin Mar 14, 2017

Aha! That does make sense, I should've noticed that and mentioned it in #8109. Thanks!

@wvu-r7 wvu-r7 self-assigned this Mar 15, 2017

@@ -23,8 +23,8 @@ def initialize(info={})
register_options(
[
OptBool.new( 'SPAWN',[ false,'Spawn process to migrate to. If name for process not given notepad.exe is used.', true]),
OptInt.new( 'PID', [false, 'PID of process to migrate to.']),
OptString.new( 'NAME', [false, 'Name of process to migrate to.']),
OptInt.new( 'PID', [false, 'PID of process to migrate to.', nil]),

This comment has been minimized.

@wvu-r7

wvu-r7 Mar 15, 2017

Contributor

These should be nil by default if none specified.

This comment has been minimized.

@rwhitcroft

rwhitcroft Mar 15, 2017

Contributor

They are nil!

This comment has been minimized.

@wvu-r7

wvu-r7 Mar 15, 2017

Contributor

I mean they're already nil.

@wvu-r7 wvu-r7 added bug module labels Mar 15, 2017

@wvu-r7 wvu-r7 merged commit 04f11b0 into rapid7:master Mar 15, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

wvu-r7 added a commit that referenced this pull request Mar 15, 2017

@wvu-r7

This comment has been minimized.

Copy link
Contributor

wvu-r7 commented Mar 15, 2017

@rwhitcroft rwhitcroft deleted the rwhitcroft:fix_migrate_by_name branch Mar 16, 2017

@pbarry-r7

This comment has been minimized.

Copy link
Contributor

pbarry-r7 commented Mar 21, 2017

Release Notes

This fix resolves an issue that prevented process migration through a specified process name from being handled as expected on Windows systems.

@tdoan-r7 tdoan-r7 added the rn-fix label Mar 22, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment