From 57c6f10314781d50a4b763b12441ebb53468594a Mon Sep 17 00:00:00 2001 From: Spencer McIntyre Date: Mon, 29 Mar 2021 17:31:28 -0400 Subject: [PATCH] Use the first entry returned by getaddrinfo Fixes #479 --- python/meterpreter/ext_server_stdapi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/meterpreter/ext_server_stdapi.py b/python/meterpreter/ext_server_stdapi.py index fd4dec8d..31f4d161 100644 --- a/python/meterpreter/ext_server_stdapi.py +++ b/python/meterpreter/ext_server_stdapi.py @@ -953,7 +953,7 @@ def netlink_request(req_type, req_data): def resolve_host(hostname, family): address_info = getaddrinfo(hostname, family=family, socktype=socket.SOCK_DGRAM, proto=socket.IPPROTO_UDP) - address = address_info['sockaddr'][0] + address = address_info[0]['sockaddr'][0] return {'family': family, 'address': address, 'packed_address': inet_pton(family, address)} def tlv_pack_local_addrinfo(sock):