I will commit myself

Source: Internet
Author: User

The title is a bit domineering, haha!

Before the beginning, I would like to talk about one thing that happened to us. Do you remember the case of CSDN account leakage recently well known in China? This leak of personal information and password of about 6 million members was taken away (details can be seen in the http://tech.qq.com/a/20111221/000485.htm), this batch of information for those who have ulterior motives is too valuable, according to statistics, 80% of people have the same Login ID and password on each website. Have you ever wondered what will happen if these people use these resources to guess the login status of other websites? The harm is self-evident.

So what exactly is the cause of CSDN asset leakage? According to industry insiders, the reason is that CSDN's own people put their member resources compressed and put them in the website directory. They guessed it and then gave it back directly, doesn't it sound so boring! In fact, it is no accident that many programmers make such a mistake. Please refer to the picture below.

The content in is the 404 error that I captured with PHP. Whenever a 404 error occurs, PHP will automatically send an Email to me to inform me of the details below:

Let's see, the other party's intention is obvious, that is, to guess whether there are any compressed files on my website that I forgot to delete. If I really forgot to delete the compressed files, i'm afraid the CSDN issue will be repeated again. however, not to mention that the opponent's guess tool is really quite useful. In a short period of time, it will not only waste my network bandwidth, the server will also be slowed down by sending emails without interruption. the most terrible thing is that if the server is guessed by the other party, the harm will be self-evident.

Are there any punitive measures for the younger generation? Of course, there are some methods. If there is no solution, I will not be swallowed up here. :) In fact, the simplest way is to block the IP address of the other party, once you find this kind of speculation, immediately block the IP address of the other party, you may say that the other party is a floating ip address, and the ip address is changed when you dial again. In fact, I also think about this, the simplest way is to change 10 ip addresses for the other party, and change 100 to 100. as long as he tries to guess, he will block his current IP address, so that unless his software can achieve immediate disconnection and IP address replacement, otherwise, no matter how useful his guess software is, he can only guess one ip address at a time. this greatly reduces the risk of website servers.

The implementation method is divided into two branches: the first branch is the linux server, and the second branch is the windows server.

First of all, let's talk about the practice of linux Server: Compared with windows Server, linux is much simpler, because linux shell can fully control the server, which is incomparable to windows. The practice is as follows:

1. Use nginx or apache to redirect a 404 error to a php file (if this file is called lock. php). When a 404 error occurs, the php file will be called.

2. lock. php captures visitors' ip addresses and other information. In addition, this file also needs to be used to send emails. The most important thing is that this file can be used to generate shell files and grant 0700 permissions, make it executable by PHP

3. since the generated shell can be executed by PHP, you can do whatever you want in this shell, you can use it to operate the hardware firewall to block ip addresses, or use it to operate the firewall that comes with linux, which depends on your mood.

Linux is so simple, only three steps are required. Next, let's talk about the practices of windows Servers:

1. Use nginx or apache to redirect a 404 error to a php file (if this file is called lock. php). When a 404 error occurs, the php file will be called.

2. lock. php captures visitors' ip addresses and other information. In addition, this file also needs to be used to send emails. The most important thing is that this file can be used to generate a bat file so that it can be executed by PHP.

3. the content of the bat file can be used to operate the hardware firewall, if you do not have a hardware firewall, you can use it to operate the ip Security Policy on the server to implement ip address blocking (For details, refer to the netsh command that comes with windows ).

 

Facts have proved that these two sets of practices are very effective because I have my own servers and have been often guessed recently, so I was forced out of this practice. Through the above practices, I found that the efficiency is very high, it takes less than one second to guess from the other end to the completion of the blocking. If you have your own server, try again.

If you disagree with this article, you are welcome to join our group for discussion. QQ group: 223494678

Related Article

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.