Mob
Mob

Reputation: 11098

How to spoof a tcp/http response in C#

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

Upvotes: 1

Views: 537

Answers (1)

Vilx-
Vilx-

Reputation: 106920

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)

Upvotes: 1

Related Questions