开发者

trying to send Wireshark capture packets

开发者 https://www.devze.com 2023-04-10 21:54 出处:网络
i h开发者_StackOverflow中文版ave a Wireshark captures and i wand to wite a tool how sent all the packets to spesific IP address and got an error with my Socket

i h开发者_StackOverflow中文版ave a Wireshark captures and i wand to wite a tool how sent all the packets to spesific IP address and got an error with my Socket

        string snoopFileName = "capture.snoop";

        FileInfo fileInfo = new FileInfo(snoopFileName);
        long FileSize = fileInfo.Length;
        FileStream fileStream = new FileStream(snoopFileName, FileMode.Open, FileAccess.Read);
        BinaryReader reader = new BinaryReader(fileStream);
        byte[] buffer = new byte[FileSize];
        int nReadCount = reader.Read(buffer, 0, (int)FileSize);

        string Address = "157.55.85.212";
        int Port = 80;
        IPEndPoint ep = new IPEndPoint(IPAddress.Parse(Address), Port);
        Socket client = new Socket(AddressFamily.InterNetwork, SocketType.Raw, ProtocolType.IP);            

        for (int i = 0; i < FileSize; i++)
        {
            client.SendTo(buffer, ep);    
        }

each capture contain several different protocols and i don't know what to do so i try to change the SocketType and ProtocolType options and got several different errors, i will glad if anyone will show me how to ix it.

thanks

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号