Telerik Forums
Fiddler Forum
3 answers
1.0K+ views

Hi,

 

I try to get cookie values in request header with GetTokenValue(), but failing.

 

Script:

var result1 = oSession.RequestHeaders.GetTokenValue("Cookie",  "target");

var result2 = oSession.RequestHeaders.GetTokenValue("Cookie",  "TEST_target");

 

[Request Header A] Cookie: target=X; TEST_target=Y

--> resut1 = X, result2=Y

 

[Request Header B] Cookie: Test_target=Y; target=X

--> resut1 = Y, result2=Y

 

Is this in the specifications? Please give me some advice.

Eric Lawrence
Telerik team
 answered on 29 Dec 2015
1 answer
318 views

I've made a method which interacts with Fiddler in C#. The code looks like this:

using Fiddler; 
namespace SmartMocks
{
    public class SmartMocks
    {
        public static void SmartMock(Session oSession, string directoryPath)
        { //etc...
After referencing the DLL in Fiddler > Options > Extensions, I add the following to the top of FiddlerScript:

import SmartMocks;

And then I can call the function in FiddlerScript like this:

SmartMocks.SmartMocks.SmartMock(oSession, "C:\\SomeFile.txt");

This works fine. However, I'd like to make SmartMock be an extension method of Fiddler.Session, so that I can use this nicer-looking syntax instead in FiddlerScript:

oSession.SmartMock("C:\\SomeFile.txt");

I'm not familiar with JScript.NET and how it handles references, so I've been having trouble adding this method to Fiddler.Session. I tried changing the code to an extension like this:

namespace SmartMocks
{
    public static class SmartMocks
    {
        public static void SmartMock(this Session oSession, string directoryPath)
        {

However, when compiling FiddlerScript, calling "oSession.SmartMock("C:\\SomeFile.txt")" gives the error "Objects of type 'Fiddler.Session' do not have such a member".

My question is:

  • How do you create an extension method to a class (like Fiddler.Session) in JScript.NET?
Eric Lawrence
Telerik team
 answered on 29 Dec 2015
1 answer
485 views

 When I started decrypting Https connection, it simply doesn't work.

Always I see below message with Untrusted Connection message. I don't remember when this started happening, but it used to be working after I upgraded to windows 10.

I use latest Firefox and Windows 10. I hit the same issue even when I use IE 11, Microsoft Edge.

lc2txe3.sharepoint.com uses an invalid security certificate. The certificate is not trusted because the issuer certificate is unknown. The server might not be sending the appropriate intermediate certificates. An additional root certificate may need to be imported. (Error code: sec_error_unknown_issuer)

 

I export the certificate and import into the Firefox, so that I can see cert name DO_NOT_TRUST_Fiddler in Certificate Manager of Firefox. Also, trusted root authority contains DO_NOT_TRUST_Fiddler certificate.

Fiddler Options : Protocols : ssl3;tls1.0;tls1.1;tls1.2 / Certificates are generated by Fiddler.DefaultCertificateProvider

Fiddler 4.6.1.4

Firefox 43.0.2

What else am I missing ?

 

Eric Lawrence
Telerik team
 answered on 28 Dec 2015
2 answers
1.9K+ views

Hi,

I have a flash application that sends flex messages to the server using POST request with application/x-amf content-type.

following piece of code:

        private static void FiddlerApplication_BeforeRequest(Session oSession)
        {
            if (oSession.oRequest.headers.ExistsAndEquals("Content-Type", "application/x-amf"))
            {
                Encoding enc = oSession.GetRequestBodyEncoding(); //we can use Encoding.UTF8..... doesn't matter - same result
                string reqBody = enc.GetString(oSession.requestBodyBytes);
                oSession.requestBodyBytes = enc.GetBytes(reqBody);
            }
        }

WOW!!! In a response i see next:

Headers:

HTTP/1.1 200 OK
Date: Fri, 25 Dec 2015 00:00:26 GMT
Server: Apache
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 275
Connection: close
Content-Type: application/x-amf;charset=utf-8

 and body:

..some content...//Unknown AMF type '-65'.Buf���/Client.Message.Encoding....

 

So the server doesn' t like my harmless operation. But i can't understand. I think i did nothing with request body actually.

Eric Lawrence
Telerik team
 answered on 28 Dec 2015
1 answer
149 views

Hi,

I am from ECS Infosolutions Pvt. Ltd. We are running one internal project for server migration for which I need information for following application regarding supporting and compatibility information on Windows server 2008 R2 and Windows server 2012 R2.

Fiddler 2.4.2.6
Fiddler 2.4.6.2
Fiddler 4.4.5.3
Fiddler (remove only)
Fiddler2 2.3.6.7
Fiddler2 2.3.8.3
Fiddler2 2.3.8.5

Appreciate your response on these applications.

Awaiting for reply.

Thank you for your time.

Regards,
Rushikesh

 

Eric Lawrence
Telerik team
 answered on 24 Dec 2015
5 answers
647 views

Hi, I got a working webservice to which I am sendig SOAP-requests. The server demands authentication of the client and authenticates itself to the client via X509-certificates. I've successfully used fiddler as a proxy to send requests to this service and watch the transmitted content by decrypting it with fiddler.

However it turns out that fiddler fails to transmit the requests if they start to get larger. For example a request with 200kb does still work and there are no problems but if I extend the request up to 300 kb it fails with fiddler throwing the following exception:

HTTP/1.1 504 Fiddler - Receive Failure
Date: Mon, 21 Dec 2015 16:05:50 GMT
Content-Type: text/html; charset=UTF-8
Connection: close
Cache-Control: no-cache, must-revalidate
Timestamp: 17:05:50.804

[Fiddler] ReadResponse() failed: The server did not return a complete response for this request. Server returned 0 bytes.

 

The request works though if I do not use fiddler. So whats the problem here? May it have to do something with the chunks of the request? I had some problems with chunking before that have led to the exact same error message. But I wouldn't know how to resolve this within fiddler...

Eric Lawrence
Telerik team
 answered on 24 Dec 2015
1 answer
126 views
Fiddler hook 4.6.1.5 verification in Firefox 43.02 failed and has been disabled.
Eric Lawrence
Telerik team
 answered on 24 Dec 2015
2 answers
94 views
I will try to explain this as clearly as possible. I installed the HTTPS decrypter setting on Fiddler, went to the local address on my iPhone and installed the certificate and then I modified my iPhone's WiFi settings to my computer's IP and port 8888. It manages to capture traffic when I use Safari and all but when I go to the App Store and some other apps they do not work. Why is this and is there a fix for it?
Mustafa
Top achievements
Rank 1
 answered on 24 Dec 2015
1 answer
201 views

Hi,

 I'm testing a web application which uses https.

 First I used the Fiddler desktop appliction to test the web application and there was a problem with the certificates so i followed this guide http://textslashplain.com/2015/10/30/reset-fiddlers-https-certificates/ and now it works.

 Now when I try to access the same https url and using FiddlerCore it doesn't work. I tried this guide http://weblog.west-wind.com/posts/2014/Jul/29/Using-FiddlerCore-to-capture-HTTP-Requests-with-NET with no luck.

 So my question is how can i do these steps using fiddlercore:

Click Tools > Fiddler Options.
Click the HTTPS tab.
Ensure that the text says Certificates generated by CertEnroll engine.
Click Actions > Reset Certificates. This may take a minute.
Accept all prompts

Thanks

Jesper
Top achievements
Rank 1
 answered on 22 Dec 2015
1 answer
354 views

I work at a place whose software interacts with web services run by other companies. Sometimes the test environments of those external web services stop, so using autoresponses to simulate external dependencies is a big deal for us. I've recently been using AutoResponder/FiddlerScript to simulate external dependencies by responding with traffic saved to disk whenever the URL and/or headers match some condition, and it's worked very well.

However, AutoResponder has one drawback: the responses from disk are sent unmodified, and sometimes I would like to change things based on the content of the request.

As a minimal example, suppose I save to disk a request/response pair like this:

 

POST https://somewebsite.com/CreateThing HTTP/1.1

{"Name":"Honeoye Falls"}

 

HTTP/1.1 200 OK

{"Name":"Honeoye Falls", "Successfully POSTed": "True"}

 

I'd like AutoResponder or FiddlerScript to be able to respond to the following request:

 

POST https://somewebsite.com/CreateThing HTTP/1.1

{"Name":"Bancorp Tower"}

 

with the following response:

 

HTTP/1.1 200 OK

{"Name":"Bancorp Tower", "Successfully POSTed": "True"}

I have a naive fantasy of building an "AutoResponder Plus" tab into Fiddler where you can drag a session in and tag parts of the request body as "magic fields" to build an "enhanced rule". In this example, the "Name" field would be a "magic field", because it occurs identically in both request and response. AutoResponder would then respond to requests matching the rule by loading the original response from disk (say, the one with "Name": "Honeoye Falls"), but overwriting "magic" fields in the response with the ones from the request (giving "Name": "Bancorp Tower").

In this minimal example, I know how to manually write FiddlerScript that would perform the substitution, but for more complicated examples with dozens of magic fields, writing FiddlerScript code for each quickly becomes time-consuming and mind-numbing. Automating the identification of "magic fields" in request/response pairs when they get drag-and-dropped into AutoResponder would be awesome, as would the ability to "intelligently" respond to requests containing them.

Here's my actual question:

  • How naive a fantasy is this? How difficult might it be for me to build such a Fiddler add-on? Is this even feasible, or worthwhile?

Other software with this capability currently exists, but is cumbersome; I'm exploring CA Service Virtualization, which is a heavyweight, complicated software suite that seems overkill, but will probably work. As a side hobby, I'm interested in making this possible in Fiddler. But again, I don't know whether this would be worthwhile or easy.

What's your opinion?

Eric Lawrence
Telerik team
 answered on 21 Dec 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?