gpt4 book ai didi

java - 从服务器 JSP 获取客户端 IP [安全]

转载 作者:行者123 更新时间:2023-12-01 15:43:36 25 4
gpt4 key购买 nike

我想知道使用jsp方法request.getRemoteAddr();的安全问题。

我想过滤一些客户端IP(我不能使用防火墙:-()。

我想知道攻击者可以通过这种方式更改HTTP请求的ip源吗?

或者客户端 IP 是从第 3 层构建的?

我想检查此方法的安全性,以防止伪造 HTTP 请求(类似于基于第 3 层 IP 的 IP 欺骗)。

谢谢大家,

安德里亚

最佳答案

HTTP 请求的“客户端”IP 地址实际上是最后一个 HTTP 代理的 IP 地址。客户端无法欺骗它,但如果客户端使用代理(很多人都这样做),那么 IP 地址对于识别请求来源不会有太大帮助。

<小时/>

I want just to be sure that the all the request come to my server through a proxy, and I don't want that a client can change this information in order to let the server think that is coming from a proxy while it's not...

理论上,客户端可以欺骗代理的 IP 地址,但这并不容易。

关于java - 从服务器 JSP 获取客户端 IP [安全],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7579943/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com