diff --git a/tcp_syni.nim b/tcp_syni.nim index f3be199..4e51ac8 100644 --- a/tcp_syni.nim +++ b/tcp_syni.nim @@ -80,7 +80,7 @@ proc captureSeqNumbers(puncher: TcpSyniPuncher, rawFd: AsyncFD, break await cb(seqNums) -proc captureAndResendSynAck(puncher: TcpSyniPuncher, rawFd: AsyncFD) {.async.} = +proc captureAndResendAck(puncher: TcpSyniPuncher, rawFd: AsyncFD) {.async.} = while true: let packet = await rawFd.recv(4000) if packet == "": @@ -90,7 +90,7 @@ proc captureAndResendSynAck(puncher: TcpSyniPuncher, rawFd: AsyncFD) {.async.} = parsed.ipAddrSrc == puncher.srcIp and parsed.tcpPortSrc.int == puncher.srcPort.int and parsed.ipAddrDst == puncher.dstIp and - parsed.tcpFlags == {SYN, ACK}: + parsed.tcpFlags == {ACK}: for port in puncher.dstPorts: if parsed.tcpPortDst.int == port.int: let ipPacket = IpPacket(protocol: tcp, @@ -158,9 +158,9 @@ proc connect*(puncher: TcpSyniPuncher, progressCb: PunchProgressCb): Future[AsyncSocket] {.async.} = let iface = fromIpAddress(puncher.srcIp) let captureSeqFd = setupEthernetCapturingSocket(iface) - let captureSynAckFd = setupEthernetCapturingSocket(iface) + let captureAckFd = setupEthernetCapturingSocket(iface) asyncCheck puncher.captureSeqNumbers(captureSeqFd, progressCb) - asyncCheck puncher.captureAndResendSynAck(captureSynAckFd) + asyncCheck puncher.captureAndResendAck(captureAckFd) await puncher.addFirewallRules() try: result = await puncher.connectParallel()