Skip to content
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
Merged

Conversation

rwhitcroft
Copy link
Contributor

@rwhitcroft 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).

@@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Damn.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@wvu wvu 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]),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should be nil by default if none specified.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are nil!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean they're already nil.

@wvu wvu merged commit 04f11b0 into rapid7:master Mar 15, 2017
wvu added a commit that referenced this pull request Mar 15, 2017
@wvu
Copy link
Contributor

wvu commented Mar 15, 2017

456ddce

@rwhitcroft rwhitcroft deleted the fix_migrate_by_name branch March 16, 2017 00:07
@pbarry-r7
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 release notes fix label Mar 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug module rn-fix release notes fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

post/windows/manage/migrate doesn't migrate to NAME variable; PID works
5 participants