views:

112

answers:

5

Hi All,

This might be one of those "huh, why?" questions, but I figured it would be worth the try.

How would one, from a server-side application, use the clients IP address as the applications IP address to another website? The basic idea is that any work the server side application does, is seen as the client itself doing the work, and not the servers static IP.

I am not sure if changing HTTP headers would work, but I could be wrong. Is there any documentation out there on this?

Thanks,

Kyle

A: 

Why on earth would a legitimate application want to spoof its IP address?

Changing HTTP headers might cut it, but most likely it won't. Depends on how naive the other server is.

It sounds like you're trying to do something the wrong way, can you give a bit more information as to what exactly the use-case is?

Yuval A
The use case is exactly how it was put above, and unfortunately that would be the only way of doing it. As I said in my comment to Michael, I too thought to myself - "Impossible.". Thanks for the answer!
Kyle Rozendo
+5  A: 

Utterly, utterly impossible. You won't even be able to open a TCP connection because the other website's server will try to handshake with the client, and fail.

An IP address isn't just any old ID, it's the actually address that servers will send any response to. Spoofing it basically only makes sense if you can fit your request into a single IP packet (which rules out TCP and thus HTTP) and are not interested in the response. Even then it can fail because your ISP's routers may have anti-spoofing rules that drop packets with "outside" IP addresses originating from "inside" networks.

Michael Borgwardt
Pretty much exactly what I thought when we as the development team were asked, hehe. Thanks. I'm going to leave this open for a bit to see if any other interesting ideas come in.
Kyle Rozendo
A: 

If there's no processing to be done in between, you can do port forwarding on your server's IP firewall, so the client connects to your server but ends up talking to the other server.

If there's more involvement of your server, then the correct thing to do would be to pass the client's IP to the other server as part of the URL (if it's a web app) or elsewhere in the data (if not) so the receiving server can know and correctly log the process without any need for fakery. Of course this would also call for a change in the other app.

Carl Smotricz
Appreciate the idea, however we do not own the websites, so we can only do changes on server side. Thanks for the answer.
Kyle Rozendo
A: 

Again assuming we're talking about HTTP, another idea that came to my mind would be to redirect your client to the other server. As long as all necessary data is in the URI, you could advise the client's browser to connect to the other server with a URI of your own creation that could carry whatever extra value your server's processing adds to the request.

Carl Smotricz
A: 

Decades ago, the designer of internet asked, "how can we prevent Kyle Rozendo from doing such a devious thing?"

If the client is cooperating, you can install some software on client machine, and do the work from there. For example, a signed java applet on your page. [kidding]If the client is not cooperating, install some trojan virus[/kidding]

irreputable