From 8bff4c79d960f7e8f5069178585d69dd773ed464 Mon Sep 17 00:00:00 2001 From: Christian Ulrich Date: Thu, 8 Oct 2020 18:13:30 +0200 Subject: [PATCH] debug messages for both incoming and outgoing SYNs --- tcp_syni.nim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tcp_syni.nim b/tcp_syni.nim index 82cca21..68ba2d2 100644 --- a/tcp_syni.nim +++ b/tcp_syni.nim @@ -282,6 +282,7 @@ proc accept*(puncher: TcpSyniPuncher, srcPort: Port, dstIp: IpAddress, tcpPortSrc: attempt.srcPort, tcpPortDst: dstPort, tcpSeqNumber: rand(uint32), tcpAckNumber: 0, tcpFlags: {SYN}, tcpWindowSize: 1452 * 10) + echo &"[{synOut.ipAddrSrc}:{synOut.tcpPortSrc} -> {synOut.ipAddrDst}:{synOut.tcpPortDst}, SEQ {synOut.tcpSeqNumber}] injecting outgoing SYN" await rawFd.injectTcpPacket(synOut) for seqNum in attempt.seqNums: let synIn = IpPacket(protocol: tcp, ipAddrSrc: attempt.dstIp, @@ -290,7 +291,7 @@ proc accept*(puncher: TcpSyniPuncher, srcPort: Port, dstIp: IpAddress, tcpPortDst: attempt.srcPort, tcpSeqNumber: seqNum, tcpAckNumber: 0, tcpFlags: {SYN}, tcpWindowSize: 1452 * 10) - echo &"[{synIn.ipAddrSrc}:{synIn.tcpPortSrc} -> {synIn.ipAddrDst}:{synIn.tcpPortDst}, SEQ {synIn.tcpSeqNumber}] injecting SYN" + echo &"[{synIn.ipAddrSrc}:{synIn.tcpPortSrc} -> {synIn.ipAddrDst}:{synIn.tcpPortDst}, SEQ {synIn.tcpSeqNumber}] injecting incoming SYN" await rawFd.injectTcpPacket(synIn) closeSocket(rawFd) await attempt.future or sleepAsync(Timeout)