mirror of
https://github.com/bettercap/bettercap
synced 2025-08-20 21:43:18 -07:00
misc
This commit is contained in:
parent
02871b0ae6
commit
7e1cb69071
2 changed files with 13 additions and 3 deletions
|
@ -44,14 +44,21 @@ func (mod *EventsStream) viewZeroConfEvent(output io.Writer, e session.Event) {
|
|||
instPart = fmt.Sprintf(" and instances %s", strings.Join(instances, ", "))
|
||||
}
|
||||
|
||||
fmt.Fprintf(output, "[%s] [%s] %s is browsing (%s) for services %s%s\n",
|
||||
textPart := ""
|
||||
if len(event.Text) > 0 {
|
||||
textPart = fmt.Sprintf("\n text records: %s\n", strings.Join(event.Text, ", "))
|
||||
}
|
||||
|
||||
fmt.Fprintf(output, "[%s] [%s] %s is browsing (%s) for services %s%s\n%s",
|
||||
e.Time.Format(mod.timeFormat),
|
||||
tui.Green(e.Tag),
|
||||
source,
|
||||
ops.Ternary(event.Query.QR, "RESPONSE", "QUERY"),
|
||||
strings.Join(services, ", "),
|
||||
instPart,
|
||||
textPart,
|
||||
)
|
||||
|
||||
} else {
|
||||
fmt.Fprintf(output, "[%s] [%s] %v\n", e.Time.Format(mod.timeFormat), tui.Green(e.Tag), e)
|
||||
}
|
||||
|
|
|
@ -27,6 +27,7 @@ type BrowsingEvent struct {
|
|||
Endpoint *network.Endpoint `json:"endpoint"`
|
||||
Services []string `json:"services"`
|
||||
Instances []string `json:"instances"`
|
||||
Text []string `json:"text"`
|
||||
Query layers.DNS `json:"query"`
|
||||
}
|
||||
|
||||
|
@ -258,11 +259,12 @@ func (mod *ZeroGod) onPacket(pkt gopacket.Packet) {
|
|||
}
|
||||
|
||||
instances := make([]string, 0)
|
||||
text := make([]string, 0)
|
||||
for _, answer := range append(append(dns.Answers, dns.Additionals...), dns.Authorities...) {
|
||||
if answer.Class == layers.DNSClassIN && answer.Type == layers.DNSTypePTR {
|
||||
instances = append(instances, string(answer.PTR))
|
||||
} else {
|
||||
instances = append(instances, answer.String())
|
||||
} else if answer.Type == layers.DNSTypeTXT {
|
||||
text = append(text, string(answer.TXT))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -271,6 +273,7 @@ func (mod *ZeroGod) onPacket(pkt gopacket.Packet) {
|
|||
Query: dns,
|
||||
Services: services,
|
||||
Instances: instances,
|
||||
Text: text,
|
||||
Endpoint: mod.Session.Lan.GetByIp(srcIP.String()),
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue