需要通过TCP发送[syn,ack]数据包

时间:2019-04-27 11:30:42

标签: c# tcp handshake

我需要让我的PC回复Windows应用程序,该应用程序不断发送[SYN]数据包,并期望从我的PC获得[SYN,ACK]。我的目标是使用Wireshark记录从该应用程序收到的消息。为此,我需要编写一个可以将回复发送到该PC的应用程序。我没有TCP协议方面的经验,因此需要建议如何发送带有某些C#代码的[SYN,ACK]答复? Wireshark Capture

namespace TCP_CLIENT
{
    class Program
    {
        const int PORT_NO = 5000;
        const string SERVER_IP = "192.168.1.100";

        static void Main(string[] args)
        {
            //---listen at the specified IP and port no.---
            IPAddress localAdd = IPAddress.Parse(SERVER_IP);
            TcpListener listener = new TcpListener(localAdd, PORT_NO);
            Console.WriteLine("Listening...");
            listener.Start();
        }
    }
}

0 个答案:

没有答案
相关问题