From 6bd88bc7e36e253cf78095e604f914512f6dccbd Mon Sep 17 00:00:00 2001 From: evilsocket Date: Mon, 29 Jan 2018 15:30:30 +0100 Subject: [PATCH] fix: dont' show interface twice if it is the gateway --- modules/events_stream.go | 2 +- modules/net_recon_show.go | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/events_stream.go b/modules/events_stream.go index d9105e39..830db7cc 100644 --- a/modules/events_stream.go +++ b/modules/events_stream.go @@ -81,7 +81,7 @@ func (s *EventsStream) dumpEvent(e session.Event) { if e.Tag == "sys.log" { fmt.Printf("[%s] [%s] (%s) %s\n", tm, core.Green(e.Tag), e.Label(), e.Data.(session.LogMessage).Message) } else { - fmt.Printf("[%s] [%s] %v\n", tm, core.Green(e.Tag), e) + fmt.Printf("[%s] [%s] %+v\n", tm, core.Green(e.Tag), e) } s.Session.Refresh() diff --git a/modules/net_recon_show.go b/modules/net_recon_show.go index a51d3c42..af8d2858 100644 --- a/modules/net_recon_show.go +++ b/modules/net_recon_show.go @@ -126,7 +126,12 @@ func (d *Discovery) Show(by string) error { sort.Sort(ByAddressSorter(targets)) } - targets = append([]*net.Endpoint{d.Session.Interface, d.Session.Gateway}, targets...) + if d.Session.Interface.HwAddress == d.Session.Gateway.HwAddress { + targets = append([]*net.Endpoint{d.Session.Interface}, targets...) + } else { + targets = append([]*net.Endpoint{d.Session.Interface, d.Session.Gateway}, targets...) + } + rows := make([][]string, 0) for i, t := range targets { rows = append(rows, d.getRow(t))