Closed AnErrupTion closed 4 years ago
httpRequest.Response["Header-Name"]
Hm, still doesn't work. All my proxies show as Elite, while clearly most of them are Transparent or even Anonymous. This is because it can't find such hidden header. Maybe Leaf.xNet can't find them?
As seen in this first screenshot, using "req.Response.ContainsHeader("X)" just doesn't work:
And, when using this proxy and going to http://proxydb.net/anon, we can see it's a transparent proxy:
Hello, this is not a response header but the content on site so you will need to use regex, an HTML parser, or substring to get the detail you need.
No, I'm not talking about the content on that website. I'm talking about the hidden headers like Via, X-Forwarded-For, etc... When using a proxy, transparent for example, it generally sets the X-Forwarded-For header to your IP Address, and a few others to mark that you're using a proxy. However, when checking a transparent proxy, it can't find those headers even though they clearly exist.
You can try this site https://azenv.net/
Nope, still doesn't show those headers.
Those headers are not represented in request or response headers but in response content. You should first understand basics of request first I guess. You can also get the source code of azenvironment and see how things work internally.
Headers aren't in response content... for example, with curl, you can view those hidden headers. Also, I saw the response content, it only shows "REMOTE_ADDR" which shows the proxy address or your IP address, so not even useful for me. I just need to see those headers with Leaf.xNet for my proxy checker... perhaps it's not a feature in Leaf.xNet?
You can use this way.
var res = req.Get("https://azenv.net/");
var source = res.ToString();
var REMOTE_ADDR = source.Substring("REMOTE_ADDR = ", Environment.NewLine);
I said that REMOTE_ADDR wasn't useful to me as it only shows the proxy address.
I gave you a basic example to read header values. If you want everything spoonfed then here it is.
var res = req.Get("https://azenv.net/");
var src = res.ToString();
var rawHeadersStr = src.Substring("<pre>", "</pre>");
var rawheaders = rawHeadersStr.Split(new string[] { "\n" }, StringSplitOptions.RemoveEmptyEntries);
var headers = new Dictionary<string, string>();
foreach (var item in rawheaders)
{
if (item.Contains(" = "))
{
var headerData = item.Split(new string[] { " = " }, StringSplitOptions.None);
headers.Add(headerData[0], headerData[1]);
}
}
var connection = headers["HTTP_CONNECTION"];
if (headers.ContainsKey("HTTP_UPGRADE_INSECURE_REQUESTS"))
{
//do something
}
I know how to parse, but azenv is useless, it doesn't contain the infos I need.
I know how to parse, but azenv is useless, it doesn't contain the infos I need.
Has worked for me in past very well actually. Idk you can use any site you want.
What I just want to do is read those hidden headers, not parse anything from a website...
Well, azenv shows only headers which are true so if they do not exist in the source then it's simple they are false.
ooooooh... I didn't know that... my issue is now fixed lol. Thanks :p
Is there a way to read hidden HTTP headers such as Via, X-Forwarded-For, and such ones? I'm making a proxy checker and I'm trying to check the anonymity level of each one. However, when I do request["Via"] or any hidden header (request being the HttpRequest) it just returns nothing, while they clearly exist.
How am I supposed to do this?