1

I have to do this project, and I honestly have NO idea where to start.

It will send a simple GET request to a web server, and then wait for a reply, and it will print out the IP that replied. The HTTP request is not the hard part, it is getting the IP that replies.

I was thinking about using a combination of netstat and grep, which are two things that I am not very fond of, so I was wondering if anyone could help me out. I could have a dedicated box for this if needed, something with like no other traffic coming in on port 80, or something like that.

4
  • Depending on what tools you want to use, and assuming you'll do something with the result of the request, too: wget shows what it resolved the name to as part of its output, you could extract it fro mthere with sed? Jul 10, 2013 at 20:15
  • @UlrichSchwarz This will not work, because it cannot simply resolve the name... It has to get the actual IP of the reply to a GET request, because the web server would be routed through a proxy with incoming requests, but not outgoing requests. Simply resolving the IP would get the proxy IP. Jul 10, 2013 at 20:29
  • At this point it seems like an assumption that the proxy doesn't also work in reverse. You should use something like wireshark to inspect the traffic to this server and see if the IP header in the reply packets actually has a different IP from the one you sent to. There might also be a way to automate this with wireshark too, since it can inspect lower level frames, not just the TCP or HTTP frames.
    – Romen
    Jul 11, 2022 at 17:17
  • “ It has to get the actual IP of the reply to a GET request, because the web server would be routed through a proxy with incoming requests…” Not going to happen. The whole purpose of the proxy is to obscure the source of the request. This is how load balancers work. The source server on the backend is never revealed. Nov 12, 2022 at 2:36

2 Answers 2

0
wget --server-response "http://google.com/" -O /dev/null 2>&1 | grep -Em 1 "\|[0-9\.]+\|" | sed -r "s/^.*\|([0-9\.]+)\|.*$/\1/g"

Just replace http://google.com/ with whatever you want to request.

2
  • This will not work, because it cannot simply resolve the name... It has to get the actual IP of the reply to a GET request, because the web server would be routed through a proxy with incoming requests, but not outgoing requests. Simply resolving the IP would get the proxy IP. Jul 10, 2013 at 20:27
  • 1
    If you are trying to penetrate the proxy that's impossible. The proxy goes and gets wherever it decides and then spits out the result as if it came from itself. Some proxies graciously tell you where it got the data, so you might be able to use that. Look at the results of the --server-response output from wget.
    – user18806
    Jul 10, 2013 at 20:53
-1

There's a Linux command called GET (all caps) that issues a plain GET HTTP request and displays the result. I am unsure if it displays the IP of the remote host in its output.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .