1
mirror of https://github.com/rapid7/metasploit-payloads synced 2025-01-02 11:36:22 +01: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:
Alex Romero 2023-03-07 21:32:37 +03:30 committed by GitHub
parent 5df4982d73
commit 885d63d568
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,28 +45,20 @@ DWORD get_arp_table(Remote *remote, Packet *response)
arp[1].buffer = (PUCHAR)pIpNetTable->table[i].bPhysAddr;
arp[2].header.type = TLV_TYPE_MAC_NAME;
BOOL has_description = FALSE;
MIB_IFROW iface;
iface.dwIndex = pIpNetTable->table[i].dwIndex;
MIB_IFROW iface = { .dwIndex = pIpNetTable->table[i].dwIndex };
result = GetIfEntry(&iface);
if (result == NO_ERROR)
{
if (iface.bDescr)
{
arp[2].header.length = (DWORD)strlen(iface.bDescr) + 1;
arp[2].buffer = (PUCHAR)iface.bDescr;
has_description = TRUE;
}
if ((result == NO_ERROR) && (iface.bDescr)) {
arp[2].header.length = (DWORD)strlen(iface.bDescr) + 1;
arp[2].buffer = (PUCHAR)iface.bDescr;
}
if (!has_description) {
else {
char interface_index[10];
sprintf_s(interface_index, sizeof(interface_index), "%d", pIpNetTable->table[i].dwIndex);
arp[2].header.length = (DWORD)strlen(interface_index) + 1;
arp[2].buffer = (PUCHAR)interface_index;
}
met_api->packet.add_tlv_group(response, TLV_TYPE_ARP_ENTRY, arp, 3);
}
}