From 4499c09e853001c5fb8bcc0d944b8f21b11c2a22 Mon Sep 17 00:00:00 2001 From: Christian Ulrich Date: Fri, 17 Jul 2020 21:32:33 +0200 Subject: [PATCH] fix direction --- tcp_syni.nim | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tcp_syni.nim b/tcp_syni.nim index 904c815..5312041 100644 --- a/tcp_syni.nim +++ b/tcp_syni.nim @@ -84,13 +84,13 @@ proc injectSyns(rawFd: AsyncFD, srcIp: IpAddress, srcPort: Port, seqNums: seq[uint32]) {.async.} = for seqNum in seqNums: let ipPacket = IpPacket(protocol: tcp, - tcpIpSrc: srcIp, - tcpIpDst: dstIp, - tcpPortSrc: dstPort, - tcpPortDst: srcPort, + tcpIpSrc: dstIp, + tcpIpDst: srcIp, + tcpPortSrc: srcPort, + tcpPortDst: dstPort, tcpSeqNumber: seqNum, tcpFlags: {SYN}) - echo &"injecting {srcIP}:{srcPort.int} -> {dstIp}:{dstPort.int} (seq {seqNum})" + echo &"injecting {dstIP}:{dstPort.int} -> {srcIp}:{srcPort.int} (seq {seqNum})" try: let packet = serialize(ipPacket) var sockaddr: Sockaddr_storage @@ -148,7 +148,7 @@ proc doAccept(srcIp: IpAddress, srcPort: Port, dstIp: IpAddress, dstPort: Port, let connectedSock = await sock.accept() future.complete(connectedSock) except OSError as e: - echo &"connection {srcIP}:{srcPort.int} -> {dstIp}:{dstPort.int} failed: ", e.msg + echo &"accepting connection {srcIP}:{srcPort.int} -> {dstIp}:{dstPort.int} failed: ", e.msg discard proc connect*(puncher: TcpSyniPuncher,