Debug: How can i look at my browsers output? - c#

I have this question https://stackoverflow.com/questions/2688464/ajax-request-from-net-give-me-unexpected-results
and i am using tamper data but i am sure firefox is formatting the data in ways i dont understand. Is there a tool i can use to check firefox post request? and perhaps my C# post request?

Recommend you download the Firebug plugin for Firefox, this will allow you to debug on the browser side more easily.
Also take a look at Wireshark (or similar) to inspect the HTTP requests that are actually going out onto the network.

Fiddler is a widely used web proxy/debugger - you can easily see incoming and outgoing requests with it. It can be used with all browsers.

Related

View contents of HttpWebRequest without tools(C#)

I want to send a put request with some json strings to a server some time in the future. I want to compare the request Im sending to the requirements I have been given, but I do not have access to that server yet so I cant test if the request Im sending is looking the way it should. The only thing I found would be ToString'ing my httpWebRequest (like in this), which is not what I need.
Is there a way to read exactly what I'm sending after (or before) I send it into the void? Or alternatively, is there a way to send a request to myself and read it that way?
Edit: I cannot install foreign software on my workstation. While using a tool like Wireshark probably solves the answer for the general public, I still need a way to do this programmatically.
Edit2: Searching for the topic may have not resulted in anything, but a random topic on the right that SO suggested actually has (almost exactly) what I wanted and all it takes is copy pasting something into the web.config file. Implementing this answer puts (amongst other things) all the connections as well as their contents into the debug console.
Try using an HTTP debugging tool like Fiddler. It acts like a proxy and can let you view the request and response of HTTP requests your program sends.
Here's how to use it with HttpWebRequest: Get HTTP requests and responses made using HttpWebRequest/HttpWebResponse to show in Fiddler
If you aren't allowed to install Fiddler you could think about making your own version of Fiddler in c# to capture traffic How to create a simple proxy in C#?

See WCF http data from Visual Studio

I am implementing the client-side of a ms webservice and i would like to see the exact http call that is made. i.e. all the parameters and how they are encoded.
I tried sniffing it with wireshark, but since it seems it is done via https i can see the data.
I am running this client straight out of visual studio. is there a way to see the data there?
Teletic Fiddler is great tool to debug any http communication. http://www.telerik.com/fiddler. I can show request and response information in raw views, xml, JSON etc
It can even inspect https traffic. Follow this guide.
There is a similar question here.

Tracking HTTP requests and responses

Is it possible to get all HTTP requests of a browser?
For example: we have opened the browser, navigated to google.com, searched for a string, clicked on any link and I got some error.
Now I want to track all HTTP requests from opening browser.
We have been using 'fiddler' to do so. But we want to use C# code to track all HTTP requests as well as HTTP responses. And we want to use the failed HTTP responses in our program.
Any information on this will be very helpful.
You could use SharpPcap to implement your own 'sniffer', or use a HttpListener to create a proxy that forwards web requests.
AFAICS, there is no way of implementing this which does not replicate what you are already doing with fiddler (albeit that you could implement a passive sniffer rather than a proxy).

Intercept HTTP requests

I've some fishy application that makes HTTP requests to a website, i would like to intersect that request and send other data to the server. Is that possible in C#,java or C++?
EDIT: The application isn't mine, i just know the endpoint that it sends http requests
Fiddler might provide the functionality you need. At the very least it may enable you to see what is being sent to the web site.
in Java You can intercept request from Filter
You may want to look into using an HttpModule, whose purpose is to intercept incoming HTTP requests.
The ASP Column: HTTP Modules
Firstly are you aware of how it is connecting to the internet? For example, is it using the settings from Internet Explorer, or is it establishing a direct connection? If the latter, this may be tricky, there is no direct port forwarding as there in Linux, so you'll need some third-party tools to redirect the traffic to a server (which you can write in Java, C++ or C#, I would go for C# if you know it for pure speed of development) In that server you can intercept the request, and then create your own to actually send to the real destination.
Sounds like a cludge, but I think you're stuck with this approach due to the lack of direct port forwarding. You'll have to configure the third-party tool that you use to forward someother well known port to 80, and your server should write to this.

Monitor which site is open

I want to check which web sites is open in browsers ( IE, Firefox, Chrome ) to write a program in C# which can block web site which is in list of forbidden web site. Is there some API of browsers?
The better solution can be to write a TCP/IP filter, like most firewalls do.
UPD: this topic can be relevant: How do I hook the TCP stack in Windows to sniff and modify packets?
There is no generic "browser API" that allows access to this kind of information across all browsers.
I'm pretty sure the idea of doing this by accessing the browsers is doomed from the start. It is going to be almost impossible to implement, require frequent updates, and always extremely easy to circumvent (there are dozens and dozens of browsers that your program will not know.).
The only reliable way is to filter traffic on network level. I would recommend looking into using an existing proxy server or TCP filtering program. There are several Open Source ones that I'm sure you can use as a basis to rewrite or hook into.
The easier solution is to write an http listener that logs the requests.
Fiddler2 is one of these, you can check it out. it logs all incomming and outcomming http content.

Categories