new: showing user agent while sniffing http requests

This commit is contained in:
evilsocket 2018-01-10 14:43:38 +01:00
parent bb5b1295ed
commit 63f389643d
3 changed files with 18 additions and 5 deletions

View file

@ -5,6 +5,7 @@ import (
"github.com/evilsocket/bettercap-ng/core"
"github.com/evilsocket/bettercap-ng/log"
"github.com/evilsocket/bettercap-ng/session"
"github.com/google/gopacket"
"github.com/google/gopacket/layers"
@ -12,7 +13,11 @@ import (
type SniffPrinterType func(format string, args ...interface{}) (int, error)
var SniffPrinter = SniffPrinterType(fmt.Printf)
var SniffPrinter = SniffPrinterType(func(format string, args ...interface{}) (n int, e error) {
n, e = fmt.Printf(format, args...)
session.I.Input.Refresh()
return
})
func tcpParser(ip *layers.IPv4, pkt gopacket.Packet, verbose bool) {
tcp := pkt.Layer(layers.LayerTypeTCP).(*layers.TCP)