Skip to content
This repository has been archived by the owner on Jan 22, 2024. It is now read-only.

POSIX and Windows meterpreter, inconsistent return types for interface in routes #99

Open
todb-r7 opened this issue Oct 6, 2014 · 0 comments
Labels

Comments

@todb-r7
Copy link

todb-r7 commented Oct 6, 2014

This issue was RM8702, originally filed by by @jlee-r7

Expected:
The interface attribute of Rex::Post::Meterpreter::Extensions::Stdapi::Net::Route should be comparable to an attribute on Rex::Post::Meterpreter::Extensions::Stdapi::Net::Interface. As it stands, Windows returns a Stringified version of Interface#index, while Linux returns Interface#mac_name.

Actual:
In this example, I have two sessions, the first Windows, the second Linux.

framework.sessions.values.each { |s| p s.net.config.routes.first.interface }; nil
# Returns:
"11"
"eth0"

@OJ asked what it should look like, and @jlee-r7 responded: I think that depends on whether we can rely on Linux's indexes to remain consistent. If so, then it should just be a TLV_TYPE_UINT for the index on both. Otherwise, I think we have to use the name, which sorta sucks because they're ridiculous on windows.

@jlee-r7 also provided a workaround on the Ruby side, here:
jlee-r7/metasploit-framework@c6e1e59#diff-6f1044d7b2cf3f1f66d9c1871ede170cR327

@todb-r7 todb-r7 added the bug label Oct 6, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant