We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
场景:将一个发送到外网IP的http请求地址替换成局域网IP,其中该局域网服务器已经建立同样的web服务,浏览器可以正常访问。
使用下面代码进行拦截替换,但浏览器访问超时加载失败,使用wireshark抓包发现TCP握手时前两次成功,第三次ack确认包并没有发送,而是重发了第二次握手的包。 请问问题可能出在哪里?帮忙分析一下。
static async Task Main(string[] args) { var filter = Filter.True.And(f => f.IsIP && f.IsTcp); using var divert = new WinDivert(filter, WinDivertLayer.Network); using var packet = new WinDivertPacket(); using var addr = new WinDivertAddress(); while (true) { var recvLength = await divert.RecvAsync(packet, addr); var result = packet.GetParseResult(); unsafe { var parsedResult = packet.GetParseResult(); // 改包 if (parsedResult.IPV4Header != null) { var src = parsedResult.IPV4Header->SrcAddr; var dst = parsedResult.IPV4Header->DstAddr; string targetIpAddress = "192.168.1.10"; string findIpAddress = "100.100.100.100"; var findIp = System.Net.IPAddress.Parse(findIpAddress); var targetIp = System.Net.IPAddress.Parse(targetIpAddress); if (dst.Equals(findIp)) { parsedResult.IPV4Header->DstAddr = targetIp; } } } var checkState = packet.CalcChecksums(addr); var sendLength = await divert.SendAsync(packet, addr); } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
场景:将一个发送到外网IP的http请求地址替换成局域网IP,其中该局域网服务器已经建立同样的web服务,浏览器可以正常访问。
使用下面代码进行拦截替换,但浏览器访问超时加载失败,使用wireshark抓包发现TCP握手时前两次成功,第三次ack确认包并没有发送,而是重发了第二次握手的包。
请问问题可能出在哪里?帮忙分析一下。
The text was updated successfully, but these errors were encountered: