Skip to content

Commit

Permalink
Return network prefixes when available
Browse files Browse the repository at this point in the history
Solves #6525 on Vista+.  Win2k still works using the old MIB method
(which doesn't support ipv6).  Win2k3 and XP are still busted for
unknown reasons.
  • Loading branch information
egypt committed Apr 5, 2012
1 parent 98bd9a7 commit cde7fcc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Binary file modified data/meterpreter/ext_server_stdapi.dll
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,9 @@ DWORD get_interfaces_windows(Remote *remote, Packet *response) {
if (pAddr->Length > 44) {
// Then this is Vista+ and the OnLinkPrefixLength member
// will be populated
pPrefix = NULL;
prefixes[prefixes_cnt] = htonl(pAddr->OnLinkPrefixLength);
}
if (pPrefix && 0 == prefixes[prefixes_cnt]) {
} else if (pPrefix) {
// Otherwise, we have to walk the FirstPrefix linked list
prefixes[prefixes_cnt] = htonl(pPrefix->PrefixLength);
pPrefix = pPrefix->Next;
Expand All @@ -221,10 +221,8 @@ DWORD get_interfaces_windows(Remote *remote, Packet *response) {
// return IPv6 addresses. Older versions (e.g. NT4, 2k)
// don't have GetAdapterAddresses, so they will have fallen
// through earlier to the MIB implementation.
free(entries);
free(pAdapters);
return get_interfaces_windows_mib(remote, response);
}
packet_add_tlv_uint(response, TLV_TYPE_EXIT_CODE, prefixes[prefixes_cnt]);

if (prefixes[prefixes_cnt]) {
entries[tlv_cnt].header.length = 4;
Expand Down

0 comments on commit cde7fcc

Please sign in to comment.