Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I use http tunnel to ping or traceroute through a proxy with firewall?

I don't know if there is a way to ping a target outside my LAN proxy which accepts only Http requests through a squid proxy... I read somewhere that one way to deal with such problem is to use a http tunnel so that the proxy still sees the request as a Http request. Can I use this to ping,say, www.google.com which otherwise is giving the following error because the firewall is rejecting the request:

$ ping www.google.com
ping: unknown host www.google.com

If so how is it done...?

I have installed httptunnel.Any help in how to use it will be much appreciated.

like image 606
pflz Avatar asked Feb 04 '11 21:02

pflz


People also ask

Can traceroute command work across the firewall?

To be able to use traceroute via a firewall the firewall needs to allow echo replies/requests. The way traceroute works is by sending packets toward the final destination and incrementing ttl with each packet sent.

Does ping work through proxy?

In general you can't. ping needs a direct network connection on the IP level to do its work. A proxy works on a higher layer of the TCP/IP network model, where there is no direct access to the IP protocol.

Does traceroute use proxy?

Traceroute is used to know the communication route of a request between one computer to another across a network. However, traceroute are services using ICMP protocol, so HTTP proxy won't be able to tunnel them.

What is a tunnel and how you can bypass a HTTP proxy?

The tunnel is created by an intermediary called a proxy server which is usually located in a DMZ. Or. HTTP tunneling is used to bypass firewalls and other network restrictions and anHTTP tunnel is used to create a direct network link between two locations.


1 Answers

No. Ping and traceroute make use of lower layer network protocols (ICMP and/or UDP, in particular, which are layer 4 protocols) and will not work over an HTTP (layer 7) tunnel. In any case, even if you could convince the HTTP proxy to open a raw TCP session for you (which is how some HTTP tunneling works) you would not receive the necessary packets to confirm that the host is reachable. (ICMP echo reply, in the case of ping, or the time-to-live expired ICMP packets in the case of traceroute)

To test for connectivity in this situation, I think the best you can do is an HTTP "ping". (Try to establish an HTTP connection with the remote host and see if it works.) For example, you could do something like:

$ http_proxy=http://webproxy.example.com:3128 \
> curl -I http://google.com/ > /dev/null 2>&1 \
> && echo success || echo failure

Assuming you have curl installed, this would print "success" if google.com is reachable through your proxy and "failure" if not.

like image 149
mpontillo Avatar answered Sep 30 '22 02:09

mpontillo