| 1 | package net_sniffscip-go gomod github.com/bettercap/bettercap . `github.com/bettercap/bettercap/modules/net_sniff`/ |
| 2 | |
| 3 | import ( |
| 4 | "fmtscip-go gomod github.com/golang/go/src go1.16 fmt/" |
| 5 | "netscip-go gomod github.com/golang/go/src go1.16 net/" |
| 6 | |
| 7 | "github.com/bettercap/bettercap/packetsscip-go gomod github.com/bettercap/bettercap . `github.com/bettercap/bettercap/packets`/" |
| 8 | |
| 9 | "github.com/google/gopacketscip-go gomod github.com/google/gopacket v1.1.19 `github.com/google/gopacket`/" |
| 10 | "github.com/google/gopacket/layersscip-go gomod github.com/google/gopacket v1.1.19 `github.com/google/gopacket/layers`/" |
| 11 | |
| 12 | "github.com/evilsocket/islazy/strscip-go gomod github.com/evilsocket/islazy v1.11.0 `github.com/evilsocket/islazy/str`/" |
| 13 | "github.com/evilsocket/islazy/tuiscip-go gomod github.com/evilsocket/islazy v1.11.0 `github.com/evilsocket/islazy/tui`/" |
| 14 | ) |
| 15 | |
| 16 | func upnpParserscip-go gomod github.com/bettercap/bettercap . `github.com/bettercap/bettercap/modules/net_sniff`/upnpParser().(srcIP, dstIP netscip-go gomod github.com/golang/go/src go1.16 net/.IPscip-go gomod github.com/golang/go/src go1.16 net/IP#, payload []byte, pkt gopacketscip-go gomod github.com/google/gopacket v1.1.19 `github.com/google/gopacket`/.Packetscip-go gomod github.com/google/gopacket v1.1.19 `github.com/google/gopacket`/Packet#, udp *layersscip-go gomod github.com/google/gopacket v1.1.19 `github.com/google/gopacket/layers`/.UDPscip-go gomod github.com/google/gopacket v1.1.19 `github.com/google/gopacket/layers`/UDP#) bool { |
| 17 | if data := packetsscip-go gomod github.com/bettercap/bettercap . `github.com/bettercap/bettercap/packets`/.UPNPGetMetascip-go gomod github.com/bettercap/bettercap . `github.com/bettercap/bettercap/packets`/UPNPGetMeta().(pkt); len(data) > 0 { |
| 18 | s := "" |
| 19 | for name, value := range data { |
| 20 | s += fmtscip-go gomod github.com/golang/go/src go1.16 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.16 fmt/Sprintf().("%s:%s ", tuiscip-go gomod github.com/evilsocket/islazy v1.11.0 `github.com/evilsocket/islazy/tui`/.Bluescip-go gomod github.com/evilsocket/islazy v1.11.0 `github.com/evilsocket/islazy/tui`/Blue().(name), tuiscip-go gomod github.com/evilsocket/islazy v1.11.0 `github.com/evilsocket/islazy/tui`/.Yellowscip-go gomod github.com/evilsocket/islazy v1.11.0 `github.com/evilsocket/islazy/tui`/Yellow().(value)) |
| 21 | } |
| 22 | |
| 23 | NewSnifferEventscip-go gomod github.com/bettercap/bettercap . `github.com/bettercap/bettercap/modules/net_sniff`/NewSnifferEvent().( |
| 24 | pkt.Metadatascip-go gomod github.com/google/gopacket v1.1.19 `github.com/google/gopacket`/Packet#Metadata().().Timestampscip-go gomod github.com/google/gopacket v1.1.19 `github.com/google/gopacket`/CaptureInfo#Timestamp., |
| 25 | "upnp", |
| 26 | srcIP.Stringscip-go gomod github.com/golang/go/src go1.16 net/IP#String().(), |
| 27 | dstIP.Stringscip-go gomod github.com/golang/go/src go1.16 net/IP#String().(), |
| 28 | nil, |
| 29 | "%s %s -> %s : %s", |
| 30 | tuiscip-go gomod github.com/evilsocket/islazy v1.11.0 `github.com/evilsocket/islazy/tui`/.Wrapscip-go gomod github.com/evilsocket/islazy v1.11.0 `github.com/evilsocket/islazy/tui`/Wrap().(tuiscip-go gomod github.com/evilsocket/islazy v1.11.0 `github.com/evilsocket/islazy/tui`/.BACKREDscip-go gomod github.com/evilsocket/islazy v1.11.0 `github.com/evilsocket/islazy/tui`/BACKRED.+tuiscip-go gomod github.com/evilsocket/islazy v1.11.0 `github.com/evilsocket/islazy/tui`/.FOREBLACKscip-go gomod github.com/evilsocket/islazy v1.11.0 `github.com/evilsocket/islazy/tui`/FOREBLACK., "upnp"), |
| 31 | vIPscip-go gomod github.com/bettercap/bettercap . `github.com/bettercap/bettercap/modules/net_sniff`/vIP().(srcIP), |
| 32 | vIPscip-go gomod github.com/bettercap/bettercap . `github.com/bettercap/bettercap/modules/net_sniff`/vIP().(dstIP), |
| 33 | strscip-go gomod github.com/evilsocket/islazy v1.11.0 `github.com/evilsocket/islazy/str`/.Trimscip-go gomod github.com/evilsocket/islazy v1.11.0 `github.com/evilsocket/islazy/str`/Trim().(s), |
| 34 | ).Pushscip-go gomod github.com/bettercap/bettercap . `github.com/bettercap/bettercap/modules/net_sniff`/SnifferEvent#Push().() |
| 35 | |
| 36 | return true |
| 37 | } |
| 38 | |
| 39 | return false |
| 40 | } |