Fiddler Core best practices to capture raw form and cookie data in transmit buffer

632 views
Skip to first unread message

Dr DB Karron

unread,
Jun 19, 2015, 4:43:01 PM6/19/15
to httpf...@googlegroups.com
I'm trying to reverse engineer a web CLIENT that is sending header data that triggers a new window and displays a 'waiting... working...'
page before the real page arrives.

I can't capture the real page in Fiddler core; I only have a handle on the first page... the page that spins a 'working...' popup window in a new thread.

I need the session cookies and the form data the client has accumulated from the user. I'm using Fiddler core and I have the
beforeRequest deligate anonymous process. I'm pouring through the Fiddler.Session, looking at ClientChatter and ServerChatter.

I don't see any place for POST form data and cookies. On the first request (the one that returns waiting... there is no request body)
Where should I look for this? I have the code generator for the request too but that is too exotic to recompile a request at run time.

When I use the Fiddler application, there is a tab for cookies and forms. Looks good. I can re-transmit the request and get a good answer.
But from MY application thread I don't want this spawning off new browsers. I have the NewWindow and NewWindow2 and NewWindow3 session.
I have the COM BrowserExtension stuff compiled, thought it throws an exception somewhere and does not work.But the main component browser
is giving me the new browser window event and I can cancel it and re-issue an in thread request and hopefully keep this puppy from
jumping out of the thread.

I am getting the NewWindow fired after the beforeRequest. I just want to keep the request in my working thread and using my browser.

Where, oh Where are the cookies and forms in the Fiddler core?

EricLaw

unread,
Jun 19, 2015, 4:51:36 PM6/19/15
to httpf...@googlegroups.com
I don't understand what "I can't capture the real page in Fiddler core" means. FiddlerCore is the core proxy engine underneath Fiddler, and it captures everything Fiddler does (basically, all HTTP & HTTPS traffic).

Clients send cookies to servers in the "Cookie" header; you can retrieve this from a session via oS.oRequest["Cookie"] or by the more longwinded oS.oRequest.headers["Cookie"].
Servers send cookies to clients in the "Set-Cookie" header; you can retrieve this from a session via oS.oResponse["Set-Cookie"] or by the more longwinded oS.oResponse.headers.FindAll("Set-Cookie"); which will give you more than one result if the server sent more than one.

The easiest way to get a request body that is a string is oS.GetRequestBodyAsString().

To be clear, new browser windows are typically created by responses, not requests; an api like window.open() is usually called from JavaScript.

It's unclear what you're using FiddlerCore for here... if you're trapping the NewWindow3 event, you should create a new Web Browser object and return its pointer in the ppDisp parameter of that event. The script will then drive the browser instance that you provided. 

Dr DB Karron

unread,
Jun 24, 2015, 12:17:34 PM6/24/15
to httpf...@googlegroups.com
Thank you ! Eric;

I am trying to capture and redirect NewWindow, NewWindow2 and NewWindow3 events.
Preferably I would like to nit have to redirect but prevent window.Open() from spawning a new browser from inside the
web browser control.

I tried casting the WebBrowser item as so:
           RenderAXHTMLBrowser=(SHDocVw.WebBrowser) RenderHTMLIn_WebBrowser.ActiveXInstance;

I get a runtime invalid cast error.


I want to capture a NewWindow event, cancel it, after I get the context for the new window.
That consists of the URI, the cookies and the form data.

I will test out your suggestions.  I'm concerned that the window request I'm looking for is generated by the response java,
as you pointed out.

How can I capture that if the browser window flies out the thread I am working in and spawns a new IE browser?

I think posibly the reason I can't find the form data is they are not in the immediately navigated window but in a window
generated in the response javascript.

dB


EricLaw

unread,
Jun 30, 2015, 12:24:44 PM6/30/15
to httpf...@googlegroups.com
Unfortunately, this is a general Web Browser Control question not related to Fiddler. As such, you're more likely to find an answer on a general programming forum like StackOverflow.



Reply all
Reply to author
Forward
0 new messages