mirror of
https://github.com/bettercap/bettercap
synced 2025-08-20 13:33:21 -07:00
[net.sniff] Add net.sniff.truncate param (default bool true) in order to toggle shortening / truncating (...) of long URLs in HTTP requests on demand
This commit is contained in:
parent
366978e303
commit
839d5da9f2
4 changed files with 40 additions and 8 deletions
|
@ -23,6 +23,10 @@ func NewSniffer(s *session.Session) *Sniffer {
|
|||
Stats: nil,
|
||||
}
|
||||
|
||||
sniff.AddParam(session.NewBoolParameter("net.sniff.truncate",
|
||||
"true",
|
||||
"If true, will truncate long request URLs so user-agent fits on same line when possible, otherwise extra verbose / full URLs."))
|
||||
|
||||
sniff.AddParam(session.NewBoolParameter("net.sniff.verbose",
|
||||
"true",
|
||||
"If true, will print every captured packet, otherwise only selected ones."))
|
||||
|
@ -112,7 +116,7 @@ func (s Sniffer) isLocalPacket(packet gopacket.Packet) bool {
|
|||
}
|
||||
|
||||
func (s *Sniffer) onPacketMatched(pkt gopacket.Packet) {
|
||||
if mainParser(pkt, s.Ctx.Verbose) == true {
|
||||
if mainParser(pkt, s.Ctx.Verbose, s.Ctx.Truncate) == true {
|
||||
s.Stats.NumDumped++
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue