misc: small fix or general refactoring i did not bother commenting

This commit is contained in:
evilsocket 2018-02-11 19:54:54 +01:00
commit d7103a7907
2 changed files with 21 additions and 17 deletions

View file

@ -21,20 +21,24 @@ func krb5Parser(ip *layers.IPv4, pkt gopacket.Packet, udp *layers.UDP) bool {
return false
}
s, err := req.String()
NewSnifferEvent(
pkt.Metadata().Timestamp,
"krb5",
ip.SrcIP.String(),
ip.DstIP.String(),
SniffData{
"req": req,
},
"%s %s -> %s : %s",
core.W(core.BG_RED+core.FG_BLACK, "krb-as-req"),
vIP(ip.SrcIP),
vIP(ip.DstIP),
s,
).Push()
return true
if s, err := req.String(); err == nil {
NewSnifferEvent(
pkt.Metadata().Timestamp,
"krb5",
ip.SrcIP.String(),
ip.DstIP.String(),
SniffData{
"req": req,
},
"%s %s -> %s : %s",
core.W(core.BG_RED+core.FG_BLACK, "krb-as-req"),
vIP(ip.SrcIP),
vIP(ip.DstIP),
s,
).Push()
return true
}
return false
}

View file

@ -182,7 +182,6 @@ type bintree struct {
Func func() (*asset, error)
Children map[string]*bintree
}
var _bintree = &bintree{nil, map[string]*bintree{
"net": &bintree{nil, map[string]*bintree{
"oui.dat": &bintree{netOuiDat, map[string]*bintree{}},
@ -235,3 +234,4 @@ func _filePath(dir, name string) string {
cannonicalName := strings.Replace(name, "\\", "/", -1)
return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
}