user3621633
user3621633

Reputation: 1721

How to get client IP in Fiddler from machine that ran fiddlercap capture

I've searched and found a number of different resources which describe how to get the client IP address in fiddler.

public static BindUIColumn("ClientIP")
function CalcMethodColClientIP(oS: Session){
    if (null != oS.oRequest) return oS.oFlags["X-ClientIP"]; else return String.Empty; 
}

I believe oSession.clientIP should also work. First of all, all that gives me is 127.0.0.1. It doesn't tell me the IP address of the machine, just the localhost loopback IP address. I'm looking for the actual IP address of the machine.

My main objective is getting the client IP address in a fiddlercap capture that was run on another person's machine. This person sent me the fiddercap log, which I view with fiddler. I want to retrieve his machine's IP address with fiddler. How can I accomplish this?

Any help would be appreciated. Thank you.

Upvotes: 1

Views: 8384

Answers (2)

Jason Ralston
Jason Ralston

Reputation: 1

Well, if it SharePoint Server you can get on the server, run
Get-SpServer | Select ID

Then use the following code in fiddler to see what SharePoint Server responded. Just add the below code to the Main() function entry point. You will find this in Rules > Custom Rules > the CRTL F to find the Main() Function to add this code to. One you do it. You will have a EncodedServerId column that you will see the last half of your get-spserver ID that uniquely identifies your SharePoint Server. You get the id for every server in the farm and you will know regardless of load balancer which server sent the response.

 public static BindUIColumn("EncodedServerId",65,1)
    function CalcMachineId(oSession: Session){
        if (null != oSession.oResponse && oSession.oResponse.headers!= null) { 
            if (oSession.oResponse.headers.Exists("SPRequestGuid") || oSession.oResponse.headers.Exists("request-id")){
                if(oSession.oResponse.headers.Exists("SPRequestGuid")){
                    var requestGuid = Guid.Parse(oSession.oResponse.headers["SPRequestGuid"]);
                }
                else{
                    var requestGuid = Guid.Parse(oSession.oResponse.headers["request-id"]);
                }
                var bytes = requestGuid.ToByteArray();
                var partOne = parseInt(bytes[8]) << 12;
                var partTwo = parseInt(bytes[9]) << 4;
                var partThree = parseInt(bytes[10]) >> 4;
                var id = partOne + partTwo + partThree;
                return String.Format("{0}",id);
            }
            return String.Empty;
            }         return "None";   
    }

Upvotes: 0

EricLaw
EricLaw

Reputation: 57115

Unfortunately, the FiddlerCap log will not provide this information by default. I'd considered adding a button to capture machine info (e.g. out of MSInfo32) automatically as a Session in the capture, but that was never implemented.

The X-ClientIP field only holds the IP address which the client used to talk to the proxy; in almost all cases, this is 127.0.0.1.

Upvotes: 4

Related Questions