Is it possible to edit an http Response?

Asked

Viewed 91 times

2

Is it possible to edit an http Response before it is rendered by the browser? Something with this scheme: Receiving the answer -> Editing the answer -> Streaming the answer to the browser.

  • which browser are you talking about ?

  • There’s the problem, I’ve managed to perform this procedure on a webbrowser, but I want to expand it to any browser that the person is using, I’ve seen something similar in some apps, but I can’t think of a way to do it.

  • then... If it is Chrome... it would have to have an extension in Chrome that does this... even pro Mozilla... iexplorer that would have the possibility to do by C#, but the browser should be started by the application in C# and not by windows... I find it very complicated, maybe the simplest is Chrome. Adblock should work that way

  • The Kaspersky antivirus does something similar without extensions, it adds a <script></script> tag on every page you access, regardless of your browser. There is no way to do this by identifying http Response on the network card before it is sent to the browser?

  • 1

    no... on the network card would still be in tcp packets, and certainly partitioned, in addition to encrypted, ssl and such, Kaspersky must have a component that is installed together for each browser, similar to bank access programs. Avast has something similar, but for other purposes, and it’s also with components installed in the browser

  • You can do this with a proxy?

  • then I can’t help you, I’ve never done anything like =/

  • Only use a proxy server.

  • Can you elaborate on what you wish to do? Do you want to make this modification on the client side, right after receiving the reply, or on the server side, before forwarding the response? Apart from these two, you can use a proxy as an intermediate entity (What are Proxy, Gateway and Tunnel in HTTP protocol?), as the LINQ commented.

Show 4 more comments

1 answer

1


You can use some class methods HttpResponse while it’s still on the server. Generally frameworks like pure ASP.NET and ASP.NET MVC give you an instance variable belonging to the page or controller for that. I.e.: you can do something like:

Response.Write("Isto é um teste");

And this text will be included in the reply sent to the browser.

When the control leaves the server the response manipulation becomes more complex, for two reasons:

  • The editing of content transmitted by the network has to be done "in the nail", since outside the protocols used in the network (IP/TCP/HTTP/SOAP, for example), the format of messages is not usually standardized. You will brush strings and this can be a very thankless job.

  • Any action in this direction is an attack of the type man-in-the-Middle, then be ready to deal with security mechanisms that will get in your way depending on the context.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.