How to spoof a tcp/http response in C#

為{幸葍}努か 提交于 2021-01-28 07:41:30

问题


I have an app that makes a request to a server and gets authenticated. I'm wondering if it is a possible to write a listener that listens for requests and if any request matches that particular request the listener sends back a message, without it actually getting to the server.

In essence I want to make the app. think it has been authenticated when it actually hasn't.

This is what the tcp stream looks like on WireShack. The highlighted response is exactly what I want my code to respond to.

Is this possible?

enter image description here


回答1:


Yes. It's called a "proxy", and you can do that in C# by using System.Net.Sockets namespace. Or you can use Fiddler and forget about programming at all. :) (Btw - AFAIK Fiddler is written in C# too)



来源:https://stackoverflow.com/questions/13322346/how-to-spoof-a-tcp-http-response-in-c-sharp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!