mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 10:46:57 -07:00
new: net.sniff now supports ipv6
This commit is contained in:
parent
bef4c6abaa
commit
cbc1432358
13 changed files with 122 additions and 83 deletions
|
@ -2,6 +2,7 @@ package net_sniff
|
|||
|
||||
import (
|
||||
"github.com/bettercap/bettercap/packets"
|
||||
"net"
|
||||
|
||||
"github.com/google/gopacket"
|
||||
"github.com/google/gopacket/layers"
|
||||
|
@ -9,20 +10,20 @@ import (
|
|||
"github.com/evilsocket/islazy/tui"
|
||||
)
|
||||
|
||||
func teamViewerParser(ip *layers.IPv4, pkt gopacket.Packet, tcp *layers.TCP) bool {
|
||||
func teamViewerParser(srcIP, dstIP net.IP, payload []byte, pkt gopacket.Packet, tcp *layers.TCP) bool {
|
||||
if tcp.SrcPort == packets.TeamViewerPort || tcp.DstPort == packets.TeamViewerPort {
|
||||
if tv := packets.ParseTeamViewer(tcp.Payload); tv != nil {
|
||||
NewSnifferEvent(
|
||||
pkt.Metadata().Timestamp,
|
||||
"teamviewer",
|
||||
ip.SrcIP.String(),
|
||||
ip.DstIP.String(),
|
||||
srcIP.String(),
|
||||
dstIP.String(),
|
||||
nil,
|
||||
"%s %s %s > %s",
|
||||
tui.Wrap(tui.BACKYELLOW+tui.FOREWHITE, "teamviewer"),
|
||||
vIP(ip.SrcIP),
|
||||
vIP(srcIP),
|
||||
tui.Yellow(tv.Command),
|
||||
vIP(ip.DstIP),
|
||||
vIP(dstIP),
|
||||
).Push()
|
||||
return true
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue