Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 312 Vote(s) - 3.63 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fiddler - send request for proxied client

#1
I have Fiddler configured as a reverse proxy so as to act as a man in the middle between a client and server. I have a custom rule that will send a request from the proxy given a certain response uri:

static function OnBeforeResponse(oSession: Session) {
...
if (oSession.uriContains("something.aspx")) {

var request = "..."
FiddlerObject.utilIssueRequest(request);
}
...
}

Is there any way to route the request issued by utilIssueRequest back to the client machine?
Reply

#2
You could, but it's very complicated to do it that way. Typically what you'd do is simply modify the request inside the OnBeforeRequest handler so that the URL/Host header point at the new target server.
Reply

#3
I apologize - my question ended up requiring more detail than I was aware of at the time of asking. If anyone is interested, I solved this problem using this weird method:

Topology: Windows Client --> Fiddler Proxy on Windows Client --> Fiddler Reverse Proxy on man-in-the-middle --> Windows Server

Code in Windows Client CustomRules.js:

static function OnBeforeRequest(oSession: Session) {

//detect prefetch response
if (oSession.oRequest.headers.Exists("X-FiddlerPrefetch")) {
//dump response into a variable
oSession.utilDecodeRequest();
prefetchResponse = System.Text.Encoding.UTF8.GetString(oSession.requestBodyBytes);
}

//detect uri that was prefetched
if (oSession.uriContains("/some_uri")) {
//wait for prefetch - cant find any docs for how to 'sleep' here
// while (prefetchResponse === "") {
// Sleep(1);
// }

//use cached response
oSession.utilCreateResponseAndBypassServer();
oSession.utilSetResponseBody(prefetchResponse);

}

//redirect traffic to man-in-the-middle
if (oSession.HostnameIs("some_server")) {
oSession["x-overrideHost"] = "man-in-the-middle:443";
}
...


Code in man-in-the-middle CustomRules.js:


static function OnBeforeResponse(oSession: Session) {

//intercept response containing prefetch material
if (oSession.uriContains("some_response")) {

//parse response body for some prefetch info
...

//compose request
var request = "POST " + uri + " HTTP/1.1" + "\n" +
"X-FiddlerOpt: test\n" +
...

//send off to server
FiddlerObject.utilIssueRequest(request);
}


//detect the prefetch response, send to client
if (oSession.oRequest.headers.Exists("X-FiddlerOpt")) {

oSession.utilDecodeResponse();
var payload = System.Text.Encoding.UTF8.GetString(oSession.responseBodyBytes);;

//compose request
var request = "GET " + "http://windows_client:8888/ HTTP/1.1" + "\n" +
"Content-Length: " + payload.length + "\n" +
"X-FiddlerPrefetch: test\n" +
"\n" +
payload

//send request
FiddlerObject.utilIssueRequest(request);
}
...

As I'm sure there are simpler or better ways to do this, any feedback is welcome.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through