如何确定访问者的ip?

发布于 2024-07-19 19:54:05 字数 217 浏览 7 评论 0原文

我有一个博客聚合网站,

故事按访问次数排序

我认为我面临着垃圾邮件,

因为某些博客的故事在传出 IP 地址的同一秒内收到大量访问

我的网站不允许来自相同的IP; 然而,我的访客以某种方式改变了他们的IP。

他们有什么解决方案来检测这种垃圾邮件访问吗?我想知道Google adSense如何解决这样的问题?

谢谢

I have a blog aggregation website

the stories are ordered by the number of visits

I think I am facing a spam of visits

because some blogs' stories receive a lot of visits in the same second with efferent ip address

my website does not allow visits from the same ip; however, my visitors somehow changing their ips.

is their any solution to detect this spam visits?, I wonder how Google adSense solves such a problem?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

久伴你 2024-07-26 19:54:05

简而言之,如果仅需要一次未经验证的访问来改变故事的顺序,那么就不可能阻止坚定的攻击者。
您可能需要考虑实施注册用户投票系统。

但是,您可以收集几条信息并将它们组合起来:

1)用户代理
2) IP地址
3) X-Forwarded-For 标头(如果可用)

通常,攻击者会比较懒,不会循环使用不同的用户代理。 如果您将系统设置为以一定的时间间隔(而不是实时)处理访问信息,则可能会过滤掉使用同一确切用户代理同时发生的大量访问。

您始终可以从 antiproxy.com 等网站下载代理数据库,但事实是,当今大多数精心策划的攻击都来自尚未记录的僵尸网络节点。 您的网站完全有可能成为异构流量攻击的目标,这些流量与普通访问者无法区分。

至少,我建议更改您的实现,以便用户可以对故事进行投票并需要验证码。

The short answer is that it's impossible to stop a determined attacker if a single unverified visit is the only thing required to alter the order of your story.
You may want to think about implementing a registered user voting system.

However, You can collect several pieces of information and combine all of them:

1) User Agent
2) IP Address
3) X-Forwarded-For header (if available)

Often times attackers will be lazy and not cycle through different user agents. If you setup your system to process visit information at a certain interval (and not in real-time), you could potentially filter out large collections of visits occuring at the same time with the same exact user agent.

You could always download databases of proxies from websites such as antiproxy.com, but the truth is that most well planned attacks today come from botnet nodes which have yet to be documented. It is fully possible for your website to be targeted by an attack with heterogeneous traffic which is indistinguishable from normal visitors.

At the very least, I would suggest changing your implementation so that users can vote on stories and require a captcha.

迎风吟唱 2024-07-26 19:54:05

使用 PHP,您可以根据 IP 地址检查 $_SERVER ["HTTP_X_FORWARDED_FOR"] 变量,以进一步确保客户端就是他所说的那个人。 这将有助于通过一些代理来识别人员。

With PHP you can check the $_SERVER ["HTTP_X_FORWARDED_FOR"] variable against the IP adress for a little more assurance that the client is who he says he is. This will help identify people through some proxies.

暖树树初阳… 2024-07-26 19:54:05

我有时会使用这个功能。 但正如其他人所说,要 100% 获得正确的 IP 可能很困难。

我不记得从哪里得到这个功能,但它似乎在互联网上相当常见。

function getRealIpAddr()
{
    if (!empty($_SERVER['HTTP_CLIENT_IP']))   
    {
      $ip=$_SERVER['HTTP_CLIENT_IP'];
    }
    elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
    {
      $ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
    }
    else
    {
      $ip=$_SERVER['REMOTE_ADDR'];
    }
    return $ip;
}

I use this function sometimes. But as others have said, it can be tough to get the correct IP 100 per cent of the time.

I can't remember where I got the function from, but it seems to be fairly common on the internet.

function getRealIpAddr()
{
    if (!empty($_SERVER['HTTP_CLIENT_IP']))   
    {
      $ip=$_SERVER['HTTP_CLIENT_IP'];
    }
    elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
    {
      $ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
    }
    else
    {
      $ip=$_SERVER['REMOTE_ADDR'];
    }
    return $ip;
}
红墙和绿瓦 2024-07-26 19:54:05

您无法可靠地检测 IP。

它可能是通过代理发送的,也可能是被欺骗的。

You cannot reliably detect an IP.

It may be coming through a proxy or it may be spoofed.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文