From af9f23da9f3ce89353cf06878bf8ab49b405e331 Mon Sep 17 00:00:00 2001 From: David Timber Date: Tue, 17 Aug 2021 12:07:24 +1000 Subject: Impl full IPv6 support ... * Use different strategy for discovering IPv6 hosts on the network * Multicast IPv6 packet with bogus destination options to get ICMPv6 responses(type 4, code 2) * Send SYN packets to the hosts responds to the packet to confirm that they have target ports open * Add full scope_id support * Fix potential infinite loop when receiving raw packets --- src/proone-recon.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/proone-recon.c') diff --git a/src/proone-recon.c b/src/proone-recon.c index 43fe8d5..71ece91 100644 --- a/src/proone-recon.c +++ b/src/proone-recon.c @@ -136,21 +136,22 @@ INV_LINE: static void evt_cb (void *ctx, const prne_net_endpoint_t *ep) { char addr_str[prne_op_max(INET_ADDRSTRLEN, INET6_ADDRSTRLEN)]; - const char *fmt; switch (ep->addr.ver) { case PRNE_IPV_4: inet_ntop(AF_INET, ep->addr.addr, addr_str, sizeof(addr_str)); - fmt = "%s:%"PRIu16"\n"; + printf("%s:%"PRIu16"\n", addr_str, ep->port); break; case PRNE_IPV_6: inet_ntop(AF_INET6, ep->addr.addr, addr_str, sizeof(addr_str)); - fmt = "[%s]:%"PRIu16"\n"; + printf( + "[%s%%%"PRIu32"]:%"PRIu16"\n", + addr_str, + ep->addr.scope_id, + ep->port); break; default: abort(); } - - printf(fmt, addr_str, ep->port); } int main (const int argc, const char **args) { -- cgit