mirror of
https://github.com/bettercap/bettercap
synced 2025-08-20 21:43:18 -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
|
@ -16,6 +16,7 @@ import (
|
|||
type SnifferContext struct {
|
||||
Handle *pcap.Handle
|
||||
DumpLocal bool
|
||||
Truncate bool
|
||||
Verbose bool
|
||||
Filter string
|
||||
Expression string
|
||||
|
@ -42,6 +43,10 @@ func (s *Sniffer) GetContext() (error, *SnifferContext) {
|
|||
return err, ctx
|
||||
}
|
||||
|
||||
if err, ctx.Truncate = s.BoolParam("net.sniff.truncate"); err != nil {
|
||||
return err, ctx
|
||||
}
|
||||
|
||||
if err, ctx.Filter = s.StringParam("net.sniff.filter"); err != nil {
|
||||
return err, ctx
|
||||
} else if ctx.Filter != "" {
|
||||
|
@ -77,6 +82,7 @@ func NewSnifferContext() *SnifferContext {
|
|||
return &SnifferContext{
|
||||
Handle: nil,
|
||||
DumpLocal: false,
|
||||
Truncate: true,
|
||||
Verbose: true,
|
||||
Filter: "",
|
||||
Expression: "",
|
||||
|
@ -99,6 +105,12 @@ func (c *SnifferContext) Log(sess *session.Session) {
|
|||
log.Info("Skip local packets : %s", yes)
|
||||
}
|
||||
|
||||
if c.Truncate {
|
||||
log.Info("Truncate : %s", yes)
|
||||
} else {
|
||||
log.Info("Truncate : %s", no)
|
||||
}
|
||||
|
||||
if c.Verbose {
|
||||
log.Info("Verbose : %s", yes)
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue