mirror of
https://github.com/bettercap/bettercap
synced 2025-08-21 05:53:20 -07:00
Refactoring modules
This commit is contained in:
parent
c0d3c314fc
commit
ed652622e2
89 changed files with 186 additions and 138 deletions
32
modules/net_sniff/net_sniff_teamviewer.go
Normal file
32
modules/net_sniff/net_sniff_teamviewer.go
Normal file
|
@ -0,0 +1,32 @@
|
|||
package net_sniff
|
||||
|
||||
import (
|
||||
"github.com/bettercap/bettercap/packets"
|
||||
|
||||
"github.com/google/gopacket"
|
||||
"github.com/google/gopacket/layers"
|
||||
|
||||
"github.com/evilsocket/islazy/tui"
|
||||
)
|
||||
|
||||
func teamViewerParser(ip *layers.IPv4, 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(),
|
||||
nil,
|
||||
"%s %s %s > %s",
|
||||
tui.Wrap(tui.BACKYELLOW+tui.FOREWHITE, "teamviewer"),
|
||||
vIP(ip.SrcIP),
|
||||
tui.Yellow(tv.Command),
|
||||
vIP(ip.DstIP),
|
||||
).Push()
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue