Sign in to follow this  
Followers 0
ken3ss

[C#] Problem With Fiddlercore

4 posts in this topic

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


Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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
1 person likes this

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0