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

Feature: Autoadd for /post/windows/manage/autoroute.rb #6515

Merged
merged 3 commits into from Apr 6, 2016

Conversation

sn0wfa11
Copy link
Contributor

Background

While working on a project demonstration, I noticed that the auto_add_route plugin wasn't wanting to work for Meterpreter Reverse HTTPS payloads. It was even preventing the running of AutoRunScripts after session creation. So I turned to the /post/windows/manage/autoroute module as a different option. However, it didn't have the same functionality to search for subnets and add them to routing automatically.

Work

I took the core functionality of the auto_add_route plugin and added it to the autoroute post module. Cleaned up the code from the plugin and added some error handling. Added an "autoadd" switch to the "CMD" datastore. In this PR the "autoadd" switch is set to default, but the default can be switched back to "add" if it looks like it may break people's scripts.

Testing

The added feature was successfully tested on the following:

(Using both Reverse TCP and Reverse HTTPS payloads)
Win XP
Win Vista
Win 7
Win 8.1
Win 10
Server 2008 R2
Server 2012 RT

Testing method

  • Run post module on sessions with additional subnets.
  • See if pivoting is available.
  • Start another session with same additional subnets to make sure it doesn't double up routes.
  • Start a session with no additional subnets, make sure it reports back that no additional subnets were found.

Screenshots

Operation with session that has additional subnets.

usage1

Operation with session that has no new subnets.

usage2

Pivot test - Attack WinXP SP0 machine on internal subnet.

pivottest

@wchen-r7 wchen-r7 self-assigned this Apr 5, 2016
wchen-r7 added a commit to wchen-r7/metasploit-framework that referenced this pull request Apr 6, 2016
@wchen-r7 wchen-r7 merged commit 3d4b7af into rapid7:master Apr 6, 2016
@sn0wfa11 sn0wfa11 deleted the add_auto_route_autoadd branch April 14, 2016 04:23
@sn0wfa11
Copy link
Contributor Author

@wchen-r7, Please see PR #6780. There were some errors in the is_routable? function that were causing invalid routes to be added.

@wchen-r7
Copy link
Contributor

@jhale85446 Ah ok, sorry about that. I'll land #6780, thanks!

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

Successfully merging this pull request may close these issues.

None yet

3 participants