mirror of
https://github.com/rapid7/metasploit-payloads
synced 2025-04-24 10:09:49 +02:00
Update c/meterpreter/source/extensions/stdapi/server/net/config/arp.c
Co-authored-by: Spencer McIntyre <58950994+smcintyre-r7@users.noreply.github.com>
This commit is contained in:
parent
5df4982d73
commit
885d63d568
@ -45,28 +45,20 @@ DWORD get_arp_table(Remote *remote, Packet *response)
|
|||||||
arp[1].buffer = (PUCHAR)pIpNetTable->table[i].bPhysAddr;
|
arp[1].buffer = (PUCHAR)pIpNetTable->table[i].bPhysAddr;
|
||||||
|
|
||||||
arp[2].header.type = TLV_TYPE_MAC_NAME;
|
arp[2].header.type = TLV_TYPE_MAC_NAME;
|
||||||
|
MIB_IFROW iface = { .dwIndex = pIpNetTable->table[i].dwIndex };
|
||||||
BOOL has_description = FALSE;
|
|
||||||
MIB_IFROW iface;
|
|
||||||
iface.dwIndex = pIpNetTable->table[i].dwIndex;
|
|
||||||
result = GetIfEntry(&iface);
|
result = GetIfEntry(&iface);
|
||||||
if (result == NO_ERROR)
|
if ((result == NO_ERROR) && (iface.bDescr)) {
|
||||||
{
|
arp[2].header.length = (DWORD)strlen(iface.bDescr) + 1;
|
||||||
if (iface.bDescr)
|
arp[2].buffer = (PUCHAR)iface.bDescr;
|
||||||
{
|
|
||||||
arp[2].header.length = (DWORD)strlen(iface.bDescr) + 1;
|
|
||||||
arp[2].buffer = (PUCHAR)iface.bDescr;
|
|
||||||
has_description = TRUE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
if (!has_description) {
|
|
||||||
char interface_index[10];
|
char interface_index[10];
|
||||||
sprintf_s(interface_index, sizeof(interface_index), "%d", pIpNetTable->table[i].dwIndex);
|
sprintf_s(interface_index, sizeof(interface_index), "%d", pIpNetTable->table[i].dwIndex);
|
||||||
arp[2].header.length = (DWORD)strlen(interface_index) + 1;
|
arp[2].header.length = (DWORD)strlen(interface_index) + 1;
|
||||||
arp[2].buffer = (PUCHAR)interface_index;
|
arp[2].buffer = (PUCHAR)interface_index;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
met_api->packet.add_tlv_group(response, TLV_TYPE_ARP_ENTRY, arp, 3);
|
met_api->packet.add_tlv_group(response, TLV_TYPE_ARP_ENTRY, arp, 3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user