Brute-force cracking of website background passwords

Source: Internet
Author: User
Tags website server

The company's website server is usually infrequently accessed, but every time from the early morning to around 8 o'clock, the website background will be attacked by many brute force account cracking attacks, resulting in frequent alerts for the website to nagios at night. Solution: According to access. log Access records, which are collected every 20 minutes. php blocks IP addresses more than 100 times. Of course, when awk conditions match, you can add error codes .. #! /Bin/bash # cron-/20 # set-x_FILE = '/home/logs/access _****. log 'awk'/logging. php/{stat [$1] ++} END {for (I in stat) {if (stat [I]> = '20140901 ') print I} '$ _ FILE>/tmp/badip. $ (date must contain f0000.txt for ip in 'sort-u/tmp/badip. $ (date should contain f0000.txt 'doif/sbin/iptables-nL | grep DROP | grep $ ip>/dev/null 2> & 1; then: else/sbin/iptables-I INPUT 10-s $ ip-j DROP [$? = 0] & echo "Time: $ (date +" % F % T "): $ ip" >>/ root/ycan/drop_record.txtfidone 2. add to scheduled task */20 00-08 ***/root/ycan/badip. sh

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.