I want to find a function to prevent the locomotive from collecting code for nearly two years. Recently, I made a stand for it myself. Some information was dragged by the locomotive. Find a complete function module for anti-locomotive collection. After a long time, the idea is as follows: for example, if the ip address is repeatedly requested in a certain period of time, the ip address is disabled, if necessary, I can post my entire search for an anti-locomotive collection function.
I haven't moved the code for almost two years. recently I made a website for fun.
Some information was dragged by the locomotive.
Find a complete function module for anti-locomotive collection.
I got this idea for a long time. for example, in a certain period of time, the ip address is disabled after multiple requests.
If necessary, I can post the entire code process I wrote.
------ Solution --------------------
Discussion
I haven't moved the code for almost two years. recently I made a website for fun.
Some information was dragged by the locomotive.
Find a complete function module for anti-locomotive collection.
I got this idea for a long time. for example, in a certain period of time, the ip address is disabled after multiple requests.
If necessary, I can post the entire code process I wrote.
------ Solution --------------------
You can also store a file. an Ip address is a file and multiple directories are created according to the 4-byte ipv4 address. the stored content is to serialize an array, and the element of the array is the first access time, the other is the count since the first access, which is easy to control.
------ Solution --------------------
Mark, this function is good.
------ Solution --------------------
Discussion
Reference:
I haven't moved the code for almost two years. recently I made a website for fun.
Some information was dragged by the locomotive.
Find a complete function module for anti-locomotive collection.
I got this idea for a long time. for example, in a certain period of time, the ip address is disabled after multiple requests.
If necessary, I can post the entire code process I wrote.
This function is very easy to use. it is enough to enclose a function at the top of each page.
What is this function?
$ _ SERVER get the IP address ,......
------ Solution --------------------
I support this
Discussion
Reference:
Reference:
I haven't moved the code for almost two years. recently I made a website for fun.
Some information was dragged by the locomotive.
Find a complete function module for anti-locomotive collection.
I got this idea for a long time. for example, in a certain period of time, the ip address is disabled after multiple requests.
If necessary, I can post the entire code process I wrote.
This function is very easy to use. it is enough to enclose a function at the top of each page.
What is this function?
......
------ Solution --------------------
It is not enough to identify ip addresses only.
If the access is from the LAN, normal access may be blocked.
------ Solution --------------------
Discussion
Reference:
It is not enough to identify ip addresses only.
If the access is from the LAN, normal access may be blocked.
Well, I also thought about this last night. It seems to be a little troublesome. it seems that we need to block it from the source.
------ Solution --------------------
Discussion
This is indeed troublesome. if it is deployed on the server, you don't need to consider the LAN! The idea that the 9th floor is supported
------ Solution --------------------
Combine session or cookie token (hereinafter referred to as the key) with IP
During the specified time interval, check whether the key exists from the second access by the same ip address
Illegal intrusion if not found
If yes (the collection program will also simulate the key mechanism), record and check whether the unique key in the request shows the sorting rule of the list page
If more than three items comply with the rules, they are deemed as illegal intrusions.
------ Solution --------------------
Yes, anti-cheating policies must be comprehensively considered and gradually corrected. it is unrealistic to put a single step in place.
IP-based clients use only a few egress IP addresses, especially for schools and large enterprises. This group of users has the following features:
1. the IP address is the same and access is frequent.
2. different cookies.
For such normal users, a white list should be designed, that is, the general idea of black, white, and black.
The bad guys use IP restrictions, and the good guys use Sessions. this is simple. other complicated judgments can be added by yourself, such as old users who have been registered for a long time and are active, the frequency allowed is slightly higher. The number of logged-on users is slightly higher than that of non-logged-on users.
To be honest, cookies are untrusted, but they can be used to reduce false positives. If the IP frequency exceeds the limit, check the SESSION and allow access based on the access frequency and access records recorded in the SESSION. However, you need to know that the bad guys will not submit cookies with your weak judgment, therefore, it is also important to record "access records" in Sessions. Mistaken killing is inevitable. In most cases, manual sealing and unblocking are required. Therefore, cookies and sessions are used to track more user behaviors. for example, when using JavaScript to submit access records and mouse tracks on the page, of course, cooki uid indicates the unique identity of the user. it is too difficult to rely solely on the server to determine the identity. in a moment, the user will be evicted.
------ Solution --------------------
Discussion
Reference:
I haven't moved the code for almost two years. recently I made a website for fun.
Some information was dragged by the locomotive.
Find a complete function module for anti-locomotive collection.
I got this idea for a long time. for example, in a certain period of time, the ip address is disabled after multiple requests.
If necessary, I can post the entire code process I wrote.
This function is very easy to use. it is enough to enclose a function at the top of each page.
What is this function?
$ _ SERVER get the IP address ,......
------ Solution --------------------
Discussion
It is not enough to identify ip addresses only.
If the access is from the LAN, normal access may be blocked.
------ Solution --------------------
The idea needs to be improved,
------ Solution --------------------
Let me help you solve this problem. many people have encountered this problem and can only gradually improve according to your user access rules.
------ Solution --------------------
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service