Jump to content


Photo
- - - - -

[C#] Problem With Fiddlercore


  • Please log in to reply
3 replies to this topic

#1 ken3ss

ken3ss

    Newbie

  • (Junior)
  • 1 posts


  • Thailand


Posted 26 July 2013 - 07:51 AM

Hi, I'm trying to bypassing the server check by using fiddlercore in order to produce a 'fake' autoresponse back into the software in order to trick the program

 

here's come the problem, the code I made didn't wait for the operation, but it just executed and exit like nothing happended

 

this is my sauce:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Fiddler;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            List<Fiddler.Session> oAllSessions = new List<Fiddler.Session>();

            Fiddler.FiddlerApplication.BeforeRequest += delegate(Fiddler.Session oS)
            {
                oS.bBufferResponse = false;
                oAllSessions.Add(oS);

                if (oS.uriContains("http://example.com/license.asp")) //DEMO
                {
                    DateTime dateTime = DateTime.UtcNow.Date;
                    oS.utilCreateResponseAndBypassServer();
                    oS.oResponse.headers.HTTPResponseStatus = "HTTP/1.1 200 OK";
                    oS.oResponse["Cache-Control"] = "private, max-age=0";
                    oS.oResponse["Content-Length"] = "365";
                    oS.oResponse["Content-Type"] = "text/xml; charset=utf-8";
                    oS.oResponse["Server"] = "Microsoft-IIS/7.0";
                    oS.oResponse["X-AspNet-Version"] = "2.0.50727";
                    oS.oResponse["X-Powered-By"] = "ASP.NET";
                    oS.oResponse["Date"] = dateTime.ToString("ddd") + ", " + dateTime.ToString("d MMM yyyy HH:MM:SS") + " GMT";
                    oS.utilSetResponseBody("OK");
                }
            };
        }
    }
}

this program dosen't have foreground interfaces.

 

 

Thank you



#2 LordCoder

LordCoder

    TEAM REiS

  • (Full Member)
  • 198 posts
  • Gender:Male


  • Spain


Posted 26 July 2013 - 02:41 PM

This is because you need to do a loop. The loop will stay there until it does that. When you run it now it just execute it but it's not running the server connection to produce the fake info so it bypass it. To avoid that put a loop with a Boolean to see when the application connects with that server.

 

Example:

 

// Boolean Expression
while (ServerIsConnected) {
// Some tasks
}
 
The ServerIsConnected it's a boolean to check if the application it's getting the information from there.


#3 NOP

NOP

    Mega Poster

  • (Full Member)
  • 103 posts


  • United Kingdom


Posted 27 July 2013 - 08:57 AM

This is because you need to do a loop. The loop will stay there until it does that. When you run it now it just execute it but it's not running the server connection to produce the fake info so it bypass it. To avoid that put a loop with a Boolean to see when the application connects with that server.


You dont need a loop for fiddlercore, it is raised as a proxy event delegate on Fiddler.FiddlerApplication.BeforeRequest & Fiddler.FiddlerApplication.BeforeResponse
 

Hi, I'm trying to bypassing the server check by using fiddlercore in order to produce a 'fake' autoresponse back into the software in order to trick the program
 
here's come the problem, the code I made didn't wait for the operation, but it just executed and exit like nothing happended

 
Try changing...

if (oS.uriContains("http://example.com/license.asp")) //DEMO

To...

if (oS.url.Contains("http://example.com/license.asp")) //DEMO

You need to change the example URL to the correct one, set the port, start the proxy & make sure your browser is set to use the proxy you have setup or the app suitable redirected to your proxy (127.0.0.1 with the port you have set)
 

iSecureEndpointPort = 8888;
FiddlerCoreStartupFlags oFCSF = FiddlerCoreStartupFlags.Default;
Fiddler.FiddlerApplication.Startup(0, oFCSF);
oSecureEndpoint = FiddlerApplication.CreateProxyEndpoint(iSecureEndpointPort, true, sSecureEndpointHostname);
if (null != oSecureEndpoint)
{
FiddlerApplication.Log.LogFormat("Created secure end point listening on port {0}, using a HTTPS certificate for '{1}'", iSecureEndpointPort, sSecureEndpointHostname);
}

Edited by NOP, 27 July 2013 - 09:16 AM.

  • LordCoder likes this

#4 ewwink

ewwink

    Member

  • (Full Member)
  • 71 posts


  • Indonesia


Posted 28 July 2013 - 07:36 AM

sometimes fiddler is passed and you need;

1. proxifier to proxify the app or

2. try to edit Control Panel => Internet Option to use fiddler proxy or

3. edit server address in the app to point to localhost.


Edited by ewwink, 28 July 2013 - 07:38 AM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users