问题
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?
回答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