1 for ttl in range(1, 65): 2 ttl_result = [] # empty set to log responses 3 for _ in range(3): 4 send packet to dst_ip with TTL=ttl 5 wait for a corresponding valid/relevant response 6 7 if no valid/relevant response received: 8 add an empty address to ttl_result 9 10 if valid/relevant ICMP Time Exceeded response received: 11 add source IP of that数据包ttl_result 12 13如果有效/相关的ICMP目标无法接收到未接收:14将dst_ip添加到ttl_result 15退出外循环16 17打印ttl_result#响应此ttl