开发者

Is there a way to spoof ip address when fetching content from a page through PHP

Heyy guys

I'm trying to know if it's possible to spoof my server ip address while I fetch content from an url through file_get_contents/curl. I tried X-Forwarded-For with curl but [REMOTE_ADDRESS] on second page (page that is being fetched) is still the same as my real server address .

How can I fetch content from example.com/1234.php, what code should I put on my page (example.com/abcd.php) so that when [REMOTE_ADDRESS] is called on example.com/1234.php It is something I sent from abcd.php

I did some researching and few say there are ways, I tried few but couldn't understand how most of them work nor could get results

I know it sounds black (th开发者_运维百科at's what makes it exciting), I promise I won't use it on other sites (still would be interesting to know)


You're better off going with an anonymous proxy. All you're doing by adding the header is making the server think you're a proxy, but chances are your IP is still the visible one.

Some servers even re-check the IP when it sees those headers to verify, and chances are you won't allow incoming connections. ;-) (And anonymous proxies don't send headers or disclose their source, they just make the initial request and blindly pass along the information back to the client).


Other than a proxy, there's no practical way to spoof an IP address in a way that lets you actually do a full TCP transaction. The sole exception to this is if you control all the routers between you and the target server.

Basically, TCP requires a 3-way handshake before any data can flow. If you spoof your IP address, only the first stage of this 3-way will go through, as the initial response from the target will go to the spoofed IP address, not to you. Think of it was writing the wrong return address on an envelope. You can send the first of a chain of letters to someone, but their response will go whereever the return address says to, which is NOT your address.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜