mirror of
https://github.com/bettercap/bettercap
synced 2025-08-20 21:43:18 -07:00
new: integrated net.sniff events into main events system ( with new.sniff.leak.* even type )
This commit is contained in:
parent
5bc00fb126
commit
e8c6c7cf92
6 changed files with 115 additions and 28 deletions
|
@ -34,14 +34,23 @@ func dnsParser(ip *layers.IPv4, pkt gopacket.Packet, udp *layers.UDP) bool {
|
|||
}
|
||||
|
||||
for hostname, ips := range m {
|
||||
SniffPrinter("[%s] %s %s > %s : %s is %s\n",
|
||||
NewSnifferEvent(
|
||||
pkt.Metadata().Timestamp,
|
||||
"dns",
|
||||
ip.SrcIP.String(),
|
||||
ip.DstIP.String(),
|
||||
SniffData{
|
||||
"Hostname": hostname,
|
||||
"Addresses": ips,
|
||||
},
|
||||
"[%s] %s %s > %s : %s is %s",
|
||||
vTime(pkt.Metadata().Timestamp),
|
||||
core.W(core.BG_DGRAY+core.FG_WHITE, "dns"),
|
||||
vIP(ip.SrcIP),
|
||||
vIP(ip.DstIP),
|
||||
core.Yellow(hostname),
|
||||
core.Dim(strings.Join(ips, ", ")),
|
||||
)
|
||||
).Push()
|
||||
}
|
||||
|
||||
return true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue