Home Backend Development PHP Tutorial 防火车头采集的功能

防火车头采集的功能

Jun 13, 2016 pm 01:21 PM
cookie ip server session

求一个防火车头采集的功能
快两年没动代码了,最近自己弄了一个站玩。
有些资料老被火车头拖来拖去的。
求一个完整的防火车头采集的功能模块。
自己弄了半天 思路是这样的比如在某一个时间段ip多次请求 就把该ip禁止掉,没搞好
如有需要我可以贴出我写的整个代码流程。

------解决方案--------------------

探讨
快两年没动代码了,最近自己弄了一个站玩。
有些资料老被火车头拖来拖去的。
求一个完整的防火车头采集的功能模块。
自己弄了半天 思路是这样的比如在某一个时间段ip多次请求 就把该ip禁止掉,没搞好
如有需要我可以贴出我写的整个代码流程。

------解决方案--------------------
存文件也行,一个Ip一个文件,按照ipv4的4字节建多级目录,存储的内容是序列化一个数组,数组的元素一个是首次访问时间,另一个是从首次访问以来的计数,这样控制很简单。
------解决方案--------------------
mark,这个功能不错,如果消耗不大的话
------解决方案--------------------
探讨

引用:
快两年没动代码了,最近自己弄了一个站玩。
有些资料老被火车头拖来拖去的。
求一个完整的防火车头采集的功能模块。
自己弄了半天 思路是这样的比如在某一个时间段ip多次请求 就把该ip禁止掉,没搞好
如有需要我可以贴出我写的整个代码流程。


这个功能很好做, 封一个函数, 每个页面顶部包含一下就行了.

这个函数干什么呢?

$_SERVER得到IP,……

------解决方案--------------------
我比较支持这个

探讨

引用:

引用:
快两年没动代码了,最近自己弄了一个站玩。
有些资料老被火车头拖来拖去的。
求一个完整的防火车头采集的功能模块。
自己弄了半天 思路是这样的比如在某一个时间段ip多次请求 就把该ip禁止掉,没搞好
如有需要我可以贴出我写的整个代码流程。


这个功能很好做, 封一个函数, 每个页面顶部包含一下就行了.

这个函数干什么呢?
……

------解决方案--------------------
仅用 ip 识别是不够的
如果访问来自局域网,那么就可能屏蔽掉正常的访问了

------解决方案--------------------
探讨

引用:

仅用 ip 识别是不够的
如果访问来自局域网,那么就可能屏蔽掉正常的访问了
恩 这个我昨晚也考虑到了 看来还是比较麻烦 看来要从来源进行屏蔽

------解决方案--------------------
探讨
这个确实是比较麻烦,如果架到服务器上就不用考虑局域网了吧!还是比较支持9楼的思路

------解决方案--------------------
使用 session 或 cookie token (以下简称键)再结合 IP

在指定的时间间隔中,自同一 ip 第二次访问起,检查键是否存在
如不存在则视为非法入侵
如存在(采集程序也会模拟键机制),记录和检查请求中的内容唯一键是否呈现列表页的排序规则
如有 3 个以上符合,则视为非法入侵

------解决方案--------------------
对,反作弊策略必须是综合考虑的,逐渐修正的,一步到位不现实。

基于IP的就像唠叨提到的,NAT背后的客户端仅仅使用几个出口IP,尤其是学校与大型企业,很容易误杀。这群用户的特点是这样的:

1,IP相同,访问频繁。
2,COOKIE不同。

针对这种正常用户,应该设计白名单,也就是很普遍的思想,黑中有白,白中有黑。

坏人用IP限制,好人用SESSION放,就这么简单,其他更多复杂的判定可以自己考虑加进去,比如注册时间久,活跃的老用户,允许他频率稍高一些。登录用户比未登录用户要稍高一些。

就说你的,说实话COOKIE这个东西不可信,但可以拿来减少误杀也不错了。IP频率超出限制,则检查SESSION,根据SESSION里记录的访问频率和访问记录放行,但你要知道坏人借助你这个软弱的判定,就会不提交COOKIE,所以我说SESSION里记录“访问记录”也很重要。误杀再所难免,绝大多数时候需要人工封号与解封,需要借助COOKIE和SESSION追踪更多的用户行为,比如用JS在页面里定时AJAX提交访问记录,鼠标轨迹,当然有COOKI UID标记用户唯一身份,单纯依赖服务端判定太难了,一会就把用户赶走了。
------解决方案--------------------
探讨

引用:
快两年没动代码了,最近自己弄了一个站玩。
有些资料老被火车头拖来拖去的。
求一个完整的防火车头采集的功能模块。
自己弄了半天 思路是这样的比如在某一个时间段ip多次请求 就把该ip禁止掉,没搞好
如有需要我可以贴出我写的整个代码流程。


这个功能很好做, 封一个函数, 每个页面顶部包含一下就行了.

这个函数干什么呢?

$_SERVER得到IP,……

------解决方案--------------------
探讨

仅用 ip 识别是不够的
如果访问来自局域网,那么就可能屏蔽掉正常的访问了

------解决方案--------------------
思路有待提高, 

------解决方案--------------------
帮你顶一下吧,这个问题很多人都遇到,只能根据你用户的访问规则,逐渐改善。
------解决方案--------------------
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to solve session failure How to solve session failure Oct 18, 2023 pm 05:19 PM

Session failure is usually caused by the session lifetime expiration or server shutdown. The solutions: 1. Extend the lifetime of the session; 2. Use persistent storage; 3. Use cookies; 4. Update the session asynchronously; 5. Use session management middleware.

Where are the cookies on your computer? Where are the cookies on your computer? Dec 22, 2023 pm 03:46 PM

Cookies on your computer are stored in specific locations on your browser, depending on the browser and operating system used: 1. Google Chrome, stored in C:\Users\YourUsername\AppData\Local\Google\Chrome\User Data\Default \Cookies etc.

Where are cookies stored? Where are cookies stored? Dec 20, 2023 pm 03:07 PM

Cookies are usually stored in the cookie folder of the browser. Cookie files in the browser are usually stored in binary or SQLite format. If you open the cookie file directly, you may see some garbled or unreadable content, so it is best to use Use the cookie management interface provided by your browser to view and manage cookies.

How to install, uninstall, and reset Windows server backup How to install, uninstall, and reset Windows server backup Mar 06, 2024 am 10:37 AM

WindowsServerBackup is a function that comes with the WindowsServer operating system, designed to help users protect important data and system configurations, and provide complete backup and recovery solutions for small, medium and enterprise-level enterprises. Only users running Server2022 and higher can use this feature. In this article, we will explain how to install, uninstall or reset WindowsServerBackup. How to Reset Windows Server Backup If you are experiencing problems with your server backup, the backup is taking too long, or you are unable to access stored files, then you may consider resetting your Windows Server backup settings. To reset Windows

Local IP address query Local IP address query Jan 05, 2024 pm 01:42 PM

The methods for querying the IP address of this machine are: 1. Under Windows system, open the "Start Menu" and search for "cmd" to open the command prompt, enter "ipconfig", and then press the Enter key to find a line named "IPv4 Address" , the number next to it is the IP address of the machine; 2. Under macOS system, click the Apple icon in the upper left corner of the screen, select "System Preferences", find the currently connected network in the "Network" option, and click the "Advanced" button , find the IP of the machine in the "TCP/IP" tab, etc.

Where are the mobile cookies? Where are the mobile cookies? Dec 22, 2023 pm 03:40 PM

Cookies on the mobile phone are stored in the browser application of the mobile device: 1. On iOS devices, Cookies are stored in Settings -> Safari -> Advanced -> Website Data of the Safari browser; 2. On Android devices, Cookies Stored in Settings -> Site settings -> Cookies of Chrome browser, etc.

Detailed explanation of where browser cookies are stored Detailed explanation of where browser cookies are stored Jan 19, 2024 am 09:15 AM

With the popularity of the Internet, we use browsers to surf the Internet have become a way of life. In the daily use of browsers, we often encounter situations where we need to enter account passwords, such as online shopping, social networking, emails, etc. This information needs to be recorded by the browser so that it does not need to be entered again the next time you visit. This is when cookies come in handy. What are cookies? Cookie refers to a small data file sent by the server to the user's browser and stored locally. It contains user behavior of some websites.

What does IP mean? What does IP mean? Jan 05, 2024 pm 01:34 PM

The common meanings of IP include "IP address", "intellectual property", "unique selling point" and "independence": 1. IP address is a digital identifier used to identify and locate equipment in computer networks; 2. Intellectual property , refers to the rights and interests enjoyed by people’s intellectual creations, including patents, trademarks, copyrights, trade secrets, etc.; 3. Unique selling points are the unique characteristics of a product or service that distinguish it from competitors and attract customers; 4. Independence refers to the ability of a country or region to make independent decisions and manage itself without external control or interference.

See all articles