From ac401ab0a44d13db5f4b63103b911384fc47e8c6 Mon Sep 17 00:00:00 2001 From: cgranleese-r7 Date: Tue, 17 Oct 2023 14:59:20 +0100 Subject: [PATCH 1/5] Adds support for resolving multiple hosts --- python/meterpreter/ext_server_stdapi.py | 33 +++++++++++++++---- .../tests/test_ext_server_stdapi.py | 18 ++++++++++ 2 files changed, 45 insertions(+), 6 deletions(-) diff --git a/python/meterpreter/ext_server_stdapi.py b/python/meterpreter/ext_server_stdapi.py index 9bcbf84da..4f7756861 100644 --- a/python/meterpreter/ext_server_stdapi.py +++ b/python/meterpreter/ext_server_stdapi.py @@ -581,6 +581,9 @@ class RTMSG(ctypes.Structure): TLV_TYPE_SHUTDOWN_HOW = TLV_META_TYPE_UINT | 1530 +# Resolve hosts/host +TLV_TYPE_RESOLVE_HOST_ENTRY = TLV_META_TYPE_GROUP | 1550 + ## # Railgun ## @@ -1079,8 +1082,12 @@ 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[0]['sockaddr'][0] - return {'family': family, 'address': address, 'packed_address': inet_pton(family, address)} + addresses = [] + for addr in address_info: + binary_address = inet_pton(family, addr['sockaddr'][0]) + addresses.append(binary_address) + + return [{ 'family': family, 'address': addresses }] def tlv_pack_local_addrinfo(sock): local_host, local_port = sock.getsockname()[:2] @@ -2673,9 +2680,18 @@ def stdapi_net_resolve_host(request, response): family = socket.AF_INET6 else: raise Exception('invalid family') + result = resolve_host(hostname, family) - response += tlv_pack(TLV_TYPE_IP, result['packed_address']) - response += tlv_pack(TLV_TYPE_ADDR_TYPE, result['family']) + + for resolved_host in result: + host_tlv = bytes() + for ip in resolved_host['address']: + host_tlv += tlv_pack(TLV_TYPE_IP, ip) + host_tlv += tlv_pack(TLV_TYPE_ADDR_TYPE, family) + + + response += tlv_pack(TLV_TYPE_RESOLVE_HOST_ENTRY, host_tlv) + return ERROR_SUCCESS, response @register_function @@ -2693,8 +2709,13 @@ def stdapi_net_resolve_hosts(request, response): result = resolve_host(hostname, family) except socket.error: result = {'family':family, 'packed_address':''} - response += tlv_pack(TLV_TYPE_IP, result['packed_address']) - response += tlv_pack(TLV_TYPE_ADDR_TYPE, result['family']) + for resolved_host in result: + host_tlv = bytes() + for ip in resolved_host['address']: + host_tlv += tlv_pack(TLV_TYPE_IP, ip) + host_tlv += tlv_pack(TLV_TYPE_ADDR_TYPE, family) + + response += tlv_pack(TLV_TYPE_RESOLVE_HOST_ENTRY, host_tlv) return ERROR_SUCCESS, response @register_function diff --git a/python/meterpreter/tests/test_ext_server_stdapi.py b/python/meterpreter/tests/test_ext_server_stdapi.py index 6989a9cdb..31da6ed3c 100644 --- a/python/meterpreter/tests/test_ext_server_stdapi.py +++ b/python/meterpreter/tests/test_ext_server_stdapi.py @@ -320,6 +320,24 @@ def test_stdapi_sys_config_getsid(self): ).get("value") self.assertRegex(sid, "S-1-5-.*") +class ExtStdNetResolveTest(ExtServerStdApiTest): + def stdapi_net_resolve_hosts(self): + # Full request from msfconsole + request = b'\x00\x00\x00\x0c\x00\x02\x00\x01\x00\x00\x04\x00\x00\x00\x00)\x00\x01\x00\x0264769531726942037539492283558475\x00\x00\x00\x00\x13\x00\x01\x05xrapid7.com\x00\x00\x00\x00\x0c\x00\x02\x05\xa4\x00\x00\x00\x02' + response = bytes() + _result_code, result_tlvs = self.assertMethodErrorSuccess( + "stdapi_net_resolve_hosts", request, response + ) + + print(response) + + # TODO: Assert + # user_name = self.meterpreter_context["packet_get_tlv"]( + # result_tlvs, self.ext_server_stdapi["TLV_TYPE_USER_NAME"] + # ).get("value") + # + #self.assert(response, bytes('......')) + if __name__ == "__main__": unittest.main() From d448d1566690d45c119b03ac5a40941048fa8456 Mon Sep 17 00:00:00 2001 From: cgranleese-r7 Date: Thu, 26 Oct 2023 16:40:54 +0100 Subject: [PATCH 2/5] Adds PHP Meterpreter changes --- php/meterpreter/ext_server_stdapi.php | 51 ++++++++++++++++--------- python/meterpreter/ext_server_stdapi.py | 22 +++++------ 2 files changed, 43 insertions(+), 30 deletions(-) diff --git a/php/meterpreter/ext_server_stdapi.php b/php/meterpreter/ext_server_stdapi.php index 9a34a3459..e25c4c9a2 100755 --- a/php/meterpreter/ext_server_stdapi.php +++ b/php/meterpreter/ext_server_stdapi.php @@ -64,6 +64,9 @@ define("TLV_TYPE_SHUTDOWN_HOW", TLV_META_TYPE_UINT | 1530); +# Resolve hosts/host +define("TLV_TYPE_RESOLVE_HOST_ENTRY", TLV_META_TYPE_GROUP | 1550); + ## # Sys ## @@ -444,10 +447,10 @@ function add_stat_buf($path) { $st_buf .= pack_p($st['atime']); $st_buf .= pack_p($st['mtime']); $st_buf .= pack_p($st['ctime']); - + $st_buf .= pack("V", $st['blksize']); $st_buf .= pack("V", $st['blocks']); - + return create_tlv(TLV_TYPE_STAT_BUF, $st_buf); } return false; @@ -484,16 +487,14 @@ function resolve_host($hostname, $family) { return NULL; } - $result = array("family" => $family); - $record = $dns[0]; - if ($record["type"] == "A") { - $result["address"] = $record["ip"]; - } - if ($record["type"] == "AAAA") { - $result["address"] = $record["ipv6"]; - } - $result["packed_address"] = inet_pton($result["address"]); - return $result; + $addresses = []; + + foreach ($dns as $addr) { + $binary_address = inet_pton($addr['ip']); + array_push($addresses, $binary_address); + } + + return ['family' => $family, 'address' => $addresses]; } } @@ -1335,9 +1336,9 @@ function stdapi_net_config_get_arp_table($req, &$pkt) { function stdapi_net_resolve_host($req, &$pkt) { my_print("doing stdapi_net_resolve_host"); $hostname_tlv = packet_get_tlv($req, TLV_TYPE_HOST_NAME); - $hostname = $hostname['value']; + $hostname = $hostname_tlv['value']; $family_tlv = packet_get_tlv($req, TLV_TYPE_ADDR_TYPE); - $family = $family['value']; + $family = $family_tlv['value']; if ($family != WIN_AF_INET && $family != WIN_AF_INET6) { my_print('invalid family, must be AF_INET or AF_INET6'); @@ -1346,11 +1347,19 @@ function stdapi_net_resolve_host($req, &$pkt) { $ret = ERROR_FAILURE; $result = resolve_host($hostname, $family); + if ($result != NULL) { $ret = ERROR_SUCCESS; - packet_add_tlv($pkt, create_tlv(TLV_TYPE_IP, $result['packed_address'])); - packet_add_tlv($pkt, create_tlv(TLV_TYPE_ADDR_TYPE, $result['family'])); } + + $host_tlv = ""; + foreach($result['address'] as $ip){ + packet_add_tlv($host_tlv, create_tlv(TLV_TYPE_IP, $ip)); + packet_add_tlv($host_tlv, create_tlv(TLV_TYPE_ADDR_TYPE, $family)); + } + + packet_add_tlv($pkt, create_tlv(TLV_TYPE_RESOLVE_HOST_ENTRY, $host_tlv)); + return $ret; } } @@ -1375,10 +1384,16 @@ function stdapi_net_resolve_hosts($req, &$pkt) { packet_add_tlv($pkt, create_tlv(TLV_TYPE_IP, '')); packet_add_tlv($pkt, create_tlv(TLV_TYPE_ADDR_TYPE, $family)); } else { - packet_add_tlv($pkt, create_tlv(TLV_TYPE_IP, $result['packed_address'])); - packet_add_tlv($pkt, create_tlv(TLV_TYPE_ADDR_TYPE, $result['family'])); + $host_tlv = ""; + foreach($result['address'] as $ip){ + packet_add_tlv($host_tlv, create_tlv(TLV_TYPE_IP, $ip)); + packet_add_tlv($host_tlv, create_tlv(TLV_TYPE_ADDR_TYPE, $family)); + } + + packet_add_tlv($pkt, create_tlv(TLV_TYPE_RESOLVE_HOST_ENTRY, $host_tlv)); } } + return ERROR_SUCCESS; } } diff --git a/python/meterpreter/ext_server_stdapi.py b/python/meterpreter/ext_server_stdapi.py index 4f7756861..9a6e4f073 100644 --- a/python/meterpreter/ext_server_stdapi.py +++ b/python/meterpreter/ext_server_stdapi.py @@ -1087,7 +1087,7 @@ def resolve_host(hostname, family): binary_address = inet_pton(family, addr['sockaddr'][0]) addresses.append(binary_address) - return [{ 'family': family, 'address': addresses }] + return { 'family': family, 'address': addresses } def tlv_pack_local_addrinfo(sock): local_host, local_port = sock.getsockname()[:2] @@ -2683,12 +2683,10 @@ def stdapi_net_resolve_host(request, response): result = resolve_host(hostname, family) - for resolved_host in result: - host_tlv = bytes() - for ip in resolved_host['address']: - host_tlv += tlv_pack(TLV_TYPE_IP, ip) - host_tlv += tlv_pack(TLV_TYPE_ADDR_TYPE, family) - + host_tlv = bytes() + for ip in result['address']: + host_tlv += tlv_pack(TLV_TYPE_IP, ip) + host_tlv += tlv_pack(TLV_TYPE_ADDR_TYPE, family) response += tlv_pack(TLV_TYPE_RESOLVE_HOST_ENTRY, host_tlv) @@ -2709,11 +2707,11 @@ def stdapi_net_resolve_hosts(request, response): result = resolve_host(hostname, family) except socket.error: result = {'family':family, 'packed_address':''} - for resolved_host in result: - host_tlv = bytes() - for ip in resolved_host['address']: - host_tlv += tlv_pack(TLV_TYPE_IP, ip) - host_tlv += tlv_pack(TLV_TYPE_ADDR_TYPE, family) + + host_tlv = bytes() + for ip in result['address']: + host_tlv += tlv_pack(TLV_TYPE_IP, ip) + host_tlv += tlv_pack(TLV_TYPE_ADDR_TYPE, family) response += tlv_pack(TLV_TYPE_RESOLVE_HOST_ENTRY, host_tlv) return ERROR_SUCCESS, response From c3fee952fe69d690b607b9460871f55e16fb3703 Mon Sep 17 00:00:00 2001 From: cgranleese-r7 Date: Wed, 1 Nov 2023 09:19:07 +0000 Subject: [PATCH 3/5] Adds Python Meterpreter tests --- .../tests/test_ext_server_stdapi.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/python/meterpreter/tests/test_ext_server_stdapi.py b/python/meterpreter/tests/test_ext_server_stdapi.py index 31da6ed3c..24f6813f7 100644 --- a/python/meterpreter/tests/test_ext_server_stdapi.py +++ b/python/meterpreter/tests/test_ext_server_stdapi.py @@ -321,7 +321,7 @@ def test_stdapi_sys_config_getsid(self): self.assertRegex(sid, "S-1-5-.*") class ExtStdNetResolveTest(ExtServerStdApiTest): - def stdapi_net_resolve_hosts(self): + def test_stdapi_net_resolve_host(self): # Full request from msfconsole request = b'\x00\x00\x00\x0c\x00\x02\x00\x01\x00\x00\x04\x00\x00\x00\x00)\x00\x01\x00\x0264769531726942037539492283558475\x00\x00\x00\x00\x13\x00\x01\x05xrapid7.com\x00\x00\x00\x00\x0c\x00\x02\x05\xa4\x00\x00\x00\x02' response = bytes() @@ -329,15 +329,18 @@ def stdapi_net_resolve_hosts(self): "stdapi_net_resolve_hosts", request, response ) - print(response) + resolved_hosts = self.meterpreter_context["packet_get_tlv"]( + result_tlvs, self.ext_server_stdapi["TLV_TYPE_RESOLVE_HOST_ENTRY"] + ).get("value") - # TODO: Assert - # user_name = self.meterpreter_context["packet_get_tlv"]( - # result_tlvs, self.ext_server_stdapi["TLV_TYPE_USER_NAME"] - # ).get("value") - # - #self.assert(response, bytes('......')) + resolved_hosts = self.meterpreter_context["packet_enum_tlvs"]( + resolved_hosts, self.ext_server_stdapi["TLV_TYPE_IP"] + ) + for host in resolved_hosts: + ip = socket.inet_ntop(socket.AF_INET, host['value']) + # Checks if IP is a valid IP address + self.assertTrue(isinstance(socket.inet_aton(ip), bytes)) if __name__ == "__main__": unittest.main() From b552a68bda89ece9f0f42d6cbd26e4b0b1a5eb44 Mon Sep 17 00:00:00 2001 From: cgranleese-r7 Date: Wed, 1 Nov 2023 16:13:35 +0000 Subject: [PATCH 4/5] Addresses PR feedback --- php/meterpreter/ext_server_stdapi.php | 34 ++++--- python/meterpreter/ext_server_stdapi.py | 14 +-- .../tests/test_ext_server_stdapi.py | 99 +++++++++++++++++-- 3 files changed, 117 insertions(+), 30 deletions(-) diff --git a/php/meterpreter/ext_server_stdapi.php b/php/meterpreter/ext_server_stdapi.php index e25c4c9a2..1fd7467e4 100755 --- a/php/meterpreter/ext_server_stdapi.php +++ b/php/meterpreter/ext_server_stdapi.php @@ -65,7 +65,7 @@ define("TLV_TYPE_SHUTDOWN_HOW", TLV_META_TYPE_UINT | 1530); # Resolve hosts/host -define("TLV_TYPE_RESOLVE_HOST_ENTRY", TLV_META_TYPE_GROUP | 1550); +define("TLV_TYPE_RESOLVE_HOST_ENTRY", TLV_META_TYPE_GROUP | 1550); ## # Sys @@ -489,12 +489,19 @@ function resolve_host($hostname, $family) { $addresses = []; - foreach ($dns as $addr) { - $binary_address = inet_pton($addr['ip']); - array_push($addresses, $binary_address); + foreach ($dns as $record) { + if ($record["type"] == "A") { + $addr = $record["ip"]; } + if ($record["type"] == "AAAA") { + $addr = $record["ipv6"]; + } + + $binary_address = inet_pton($addr); + array_push($addresses, $binary_address); + } - return ['family' => $family, 'address' => $addresses]; + return ['family' => $family, 'addresses' => $addresses]; } } @@ -1350,15 +1357,14 @@ function stdapi_net_resolve_host($req, &$pkt) { if ($result != NULL) { $ret = ERROR_SUCCESS; - } - - $host_tlv = ""; - foreach($result['address'] as $ip){ - packet_add_tlv($host_tlv, create_tlv(TLV_TYPE_IP, $ip)); - packet_add_tlv($host_tlv, create_tlv(TLV_TYPE_ADDR_TYPE, $family)); - } + $host_tlv = ""; + foreach($result['addresses'] as $ip){ + packet_add_tlv($host_tlv, create_tlv(TLV_TYPE_IP, $ip)); + packet_add_tlv($host_tlv, create_tlv(TLV_TYPE_ADDR_TYPE, $family)); + } - packet_add_tlv($pkt, create_tlv(TLV_TYPE_RESOLVE_HOST_ENTRY, $host_tlv)); + packet_add_tlv($pkt, create_tlv(TLV_TYPE_RESOLVE_HOST_ENTRY, $host_tlv)); + } return $ret; } @@ -1385,7 +1391,7 @@ function stdapi_net_resolve_hosts($req, &$pkt) { packet_add_tlv($pkt, create_tlv(TLV_TYPE_ADDR_TYPE, $family)); } else { $host_tlv = ""; - foreach($result['address'] as $ip){ + foreach($result['addresses'] as $ip){ packet_add_tlv($host_tlv, create_tlv(TLV_TYPE_IP, $ip)); packet_add_tlv($host_tlv, create_tlv(TLV_TYPE_ADDR_TYPE, $family)); } diff --git a/python/meterpreter/ext_server_stdapi.py b/python/meterpreter/ext_server_stdapi.py index 9a6e4f073..fe3a58c67 100644 --- a/python/meterpreter/ext_server_stdapi.py +++ b/python/meterpreter/ext_server_stdapi.py @@ -582,7 +582,7 @@ class RTMSG(ctypes.Structure): TLV_TYPE_SHUTDOWN_HOW = TLV_META_TYPE_UINT | 1530 # Resolve hosts/host -TLV_TYPE_RESOLVE_HOST_ENTRY = TLV_META_TYPE_GROUP | 1550 +TLV_TYPE_RESOLVE_HOST_ENTRY = TLV_META_TYPE_GROUP | 1550 ## # Railgun @@ -1087,7 +1087,7 @@ def resolve_host(hostname, family): binary_address = inet_pton(family, addr['sockaddr'][0]) addresses.append(binary_address) - return { 'family': family, 'address': addresses } + return { 'family': family, 'addresses': addresses } def tlv_pack_local_addrinfo(sock): local_host, local_port = sock.getsockname()[:2] @@ -2683,8 +2683,8 @@ def stdapi_net_resolve_host(request, response): result = resolve_host(hostname, family) - host_tlv = bytes() - for ip in result['address']: + host_tlv = bytes() + for ip in result['addresses']: host_tlv += tlv_pack(TLV_TYPE_IP, ip) host_tlv += tlv_pack(TLV_TYPE_ADDR_TYPE, family) @@ -2708,9 +2708,9 @@ def stdapi_net_resolve_hosts(request, response): except socket.error: result = {'family':family, 'packed_address':''} - host_tlv = bytes() - for ip in result['address']: - host_tlv += tlv_pack(TLV_TYPE_IP, ip) + host_tlv = bytes() + for ip in result['addresses']: + host_tlv += tlv_pack(TLV_TYPE_IP, ip) host_tlv += tlv_pack(TLV_TYPE_ADDR_TYPE, family) response += tlv_pack(TLV_TYPE_RESOLVE_HOST_ENTRY, host_tlv) diff --git a/python/meterpreter/tests/test_ext_server_stdapi.py b/python/meterpreter/tests/test_ext_server_stdapi.py index 24f6813f7..4bced4e88 100644 --- a/python/meterpreter/tests/test_ext_server_stdapi.py +++ b/python/meterpreter/tests/test_ext_server_stdapi.py @@ -322,25 +322,106 @@ def test_stdapi_sys_config_getsid(self): class ExtStdNetResolveTest(ExtServerStdApiTest): def test_stdapi_net_resolve_host(self): - # Full request from msfconsole - request = b'\x00\x00\x00\x0c\x00\x02\x00\x01\x00\x00\x04\x00\x00\x00\x00)\x00\x01\x00\x0264769531726942037539492283558475\x00\x00\x00\x00\x13\x00\x01\x05xrapid7.com\x00\x00\x00\x00\x0c\x00\x02\x05\xa4\x00\x00\x00\x02' + MSF_AF_INET = 2 + + request = bytes() + request += self.meterpreter_context["tlv_pack"]( + self.meterpreter_context["TLV_TYPE_COMMAND_ID"], + 1024 + ) + + request += self.meterpreter_context["tlv_pack"]( + self.ext_server_stdapi["TLV_TYPE_REQUEST_ID"], + "18252822037434405542596288798302" + ) + + request += self.meterpreter_context["tlv_pack"]( + self.ext_server_stdapi["TLV_TYPE_HOST_NAME"], + "rapid7.com" + ) + + request += self.meterpreter_context["tlv_pack"]( + self.ext_server_stdapi["TLV_TYPE_ADDR_TYPE"], + MSF_AF_INET + ) + response = bytes() _result_code, result_tlvs = self.assertMethodErrorSuccess( "stdapi_net_resolve_hosts", request, response ) - resolved_hosts = self.meterpreter_context["packet_get_tlv"]( + resolve_host_entries = self.meterpreter_context["packet_get_tlv"]( result_tlvs, self.ext_server_stdapi["TLV_TYPE_RESOLVE_HOST_ENTRY"] ).get("value") - resolved_hosts = self.meterpreter_context["packet_enum_tlvs"]( - resolved_hosts, self.ext_server_stdapi["TLV_TYPE_IP"] + resolved_host_ips = self.meterpreter_context["packet_enum_tlvs"]( + resolve_host_entries, self.ext_server_stdapi["TLV_TYPE_IP"] + ) + + resolved_host_families = self.meterpreter_context["packet_enum_tlvs"]( + resolve_host_entries, self.ext_server_stdapi["TLV_TYPE_ADDR_TYPE"] + ) + + for ip in resolved_host_ips: + resolved_ip = socket.inet_ntop(socket.AF_INET, ip['value']) + self.assertTrue(isinstance(socket.inet_aton(resolved_ip), bytes)) + + for family in resolved_host_families: + self.assertEqual(family['value'], MSF_AF_INET) + + def test_stdapi_net_resolve_hosts(self): + MSF_AF_INET = 2 + + request = bytes() + request += self.meterpreter_context["tlv_pack"]( + self.meterpreter_context["TLV_TYPE_COMMAND_ID"], + 1025 + ) + + request += self.meterpreter_context["tlv_pack"]( + self.ext_server_stdapi["TLV_TYPE_REQUEST_ID"], + "11047287278261284282680986949856" + ) + + request += self.meterpreter_context["tlv_pack"]( + self.ext_server_stdapi["TLV_TYPE_ADDR_TYPE"], + MSF_AF_INET + ) + + request += self.meterpreter_context["tlv_pack"]( + self.ext_server_stdapi["TLV_TYPE_HOST_NAME"], + "rapid7.com" + ) + + request += self.meterpreter_context["tlv_pack"]( + self.ext_server_stdapi["TLV_TYPE_HOST_NAME"], + "google.com" ) - for host in resolved_hosts: - ip = socket.inet_ntop(socket.AF_INET, host['value']) - # Checks if IP is a valid IP address - self.assertTrue(isinstance(socket.inet_aton(ip), bytes)) + response = bytes() + _result_code, result_tlvs = self.assertMethodErrorSuccess( + "stdapi_net_resolve_hosts", request, response + ) + + resolved_host_entry_list = self.meterpreter_context["packet_enum_tlvs"]( + result_tlvs, self.ext_server_stdapi["TLV_TYPE_RESOLVE_HOST_ENTRY"] + ) + + for resolved_host_entry in resolved_host_entry_list: + resolved_host_ips = self.meterpreter_context["packet_enum_tlvs"]( + resolved_host_entry['value'], self.ext_server_stdapi["TLV_TYPE_IP"] + ) + + resolved_host_families = self.meterpreter_context["packet_enum_tlvs"]( + resolved_host_entry['value'], self.ext_server_stdapi["TLV_TYPE_ADDR_TYPE"] + ) + + for ip in resolved_host_ips: + resolved_ip = socket.inet_ntop(socket.AF_INET, ip['value']) + self.assertTrue(isinstance(socket.inet_aton(resolved_ip), bytes)) + + for family in resolved_host_families: + self.assertEqual(family['value'], MSF_AF_INET) if __name__ == "__main__": unittest.main() From 757db13130d0d222b0442f9f972b86628d34bd25 Mon Sep 17 00:00:00 2001 From: cgranleese-r7 Date: Tue, 7 Nov 2023 15:40:15 +0000 Subject: [PATCH 5/5] Addresses PR feedback --- python/meterpreter/tests/test_ext_server_stdapi.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/meterpreter/tests/test_ext_server_stdapi.py b/python/meterpreter/tests/test_ext_server_stdapi.py index 4bced4e88..25cf2c421 100644 --- a/python/meterpreter/tests/test_ext_server_stdapi.py +++ b/python/meterpreter/tests/test_ext_server_stdapi.py @@ -327,7 +327,7 @@ def test_stdapi_net_resolve_host(self): request = bytes() request += self.meterpreter_context["tlv_pack"]( self.meterpreter_context["TLV_TYPE_COMMAND_ID"], - 1024 + self.meterpreter_context['cmd_string_to_id']('stdapi_net_resolve_host') ) request += self.meterpreter_context["tlv_pack"]( @@ -375,7 +375,7 @@ def test_stdapi_net_resolve_hosts(self): request = bytes() request += self.meterpreter_context["tlv_pack"]( self.meterpreter_context["TLV_TYPE_COMMAND_ID"], - 1025 + self.meterpreter_context['cmd_string_to_id']('stdapi_net_resolve_hosts') ) request += self.meterpreter_context["tlv_pack"](