debug messages for both incoming and outgoing SYNs
This commit is contained in:
parent
b0032c534c
commit
8bff4c79d9
|
@ -282,6 +282,7 @@ proc accept*(puncher: TcpSyniPuncher, srcPort: Port, dstIp: IpAddress,
|
||||||
tcpPortSrc: attempt.srcPort, tcpPortDst: dstPort,
|
tcpPortSrc: attempt.srcPort, tcpPortDst: dstPort,
|
||||||
tcpSeqNumber: rand(uint32), tcpAckNumber: 0,
|
tcpSeqNumber: rand(uint32), tcpAckNumber: 0,
|
||||||
tcpFlags: {SYN}, tcpWindowSize: 1452 * 10)
|
tcpFlags: {SYN}, tcpWindowSize: 1452 * 10)
|
||||||
|
echo &"[{synOut.ipAddrSrc}:{synOut.tcpPortSrc} -> {synOut.ipAddrDst}:{synOut.tcpPortDst}, SEQ {synOut.tcpSeqNumber}] injecting outgoing SYN"
|
||||||
await rawFd.injectTcpPacket(synOut)
|
await rawFd.injectTcpPacket(synOut)
|
||||||
for seqNum in attempt.seqNums:
|
for seqNum in attempt.seqNums:
|
||||||
let synIn = IpPacket(protocol: tcp, ipAddrSrc: attempt.dstIp,
|
let synIn = IpPacket(protocol: tcp, ipAddrSrc: attempt.dstIp,
|
||||||
|
@ -290,7 +291,7 @@ proc accept*(puncher: TcpSyniPuncher, srcPort: Port, dstIp: IpAddress,
|
||||||
tcpPortDst: attempt.srcPort,
|
tcpPortDst: attempt.srcPort,
|
||||||
tcpSeqNumber: seqNum, tcpAckNumber: 0,
|
tcpSeqNumber: seqNum, tcpAckNumber: 0,
|
||||||
tcpFlags: {SYN}, tcpWindowSize: 1452 * 10)
|
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)
|
await rawFd.injectTcpPacket(synIn)
|
||||||
closeSocket(rawFd)
|
closeSocket(rawFd)
|
||||||
await attempt.future or sleepAsync(Timeout)
|
await attempt.future or sleepAsync(Timeout)
|
||||||
|
|
Loading…
Reference in New Issue