通过 PHP 从页面获取内容时有没有办法欺骗 IP 地址
嘿伙计们,
我想知道当我通过 file_get_contents/curl 从 url 获取内容时是否可以欺骗我的服务器 IP 地址。我尝试使用curl来X-Forwarded-For,但是第二页(正在获取的页面)上的[REMOTE_ADDRESS]仍然与我的真实服务器地址相同。
如何从以下位置获取内容 example.com/1234.php,应该使用什么代码 我放在我的页面上 (example.com/abcd.php)这样当 [REMOTE_ADDRESS] 被调用 example.com/1234.php 这是我的东西 从 abcd.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 (that's what makes it exciting), I promise I won't use it on other sites (still would be interesting to know)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你最好使用匿名代理。您通过添加标头所做的一切就是让服务器认为您是代理,但很可能您的 IP 仍然是可见的。
有些服务器甚至会在看到这些标头进行验证时重新检查 IP,并且很可能您不会允许传入连接。 ;-)(匿名代理不会发送标头或披露其来源,它们只是发出初始请求并盲目地将信息传递回客户端)。
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).
除了代理之外,没有任何实用的方法可以欺骗 IP 地址来让您真正执行完整的 TCP 事务。唯一的例外是您控制您和目标服务器之间的所有路由器。
基本上,TCP 需要 3 次握手才能传输任何数据。如果您欺骗您的 IP 地址,则只会执行此三向的第一阶段,因为来自目标的初始响应将发送至欺骗的 IP 地址,而不是您。想象一下在信封上写错了寄信人地址。您可以将一连串信件中的第一封发送给某人,但他们的回复将发送到回信地址所说的任何地方,而这不是您的地址。
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.