Free site + protect www server

  • Warning!: The site is vulnerable to SQLi attacks - if someone wants to, he can rewrite the page as follows:

    Code
    1. https://youtu.be/DXji_JiuTdo
    • Yes, I noticed after the video had been released, that the code I wrote had two errors.


    I also recommend adding a captcha for registration, login and display of the full ranking. The site also has an advanced administrator system.


    Website (one change - 99% of original files from BombWorkStudio):

    Code
    1. https://www23.zippyshare.com/v/eo4JElK4/file.html


    Scan:

    Code
    1. https://www.virustotal.com/#/file-analysis/YzJjNDUyOGY0MzJlZGI5ZDgwMWFlYWVmMzBmYzE0OGY6MTUzMDQ2NDcwNQ==


    Layout:

    Code
    1. https://www.mpcforum.pl/applications/core/interface/imageproxy/imageproxy.php?img=http://i.imgur.com/jySgsmk.jpg&key=6f9f51e6dc2b4695eef338e253b46d36f714e9f3ae3b035c720b15909e791c07


    Web server protection against two idiots (Internet terror - DejmieN & Komar1911)


    ## CHECKING IP, WHICH MAKE THE BIGGEST ATTACKS ##

    Code
    1. cat /var/log/apache2/access.log |awk '{print $1}' |sort |uniq -c |sort -n


    ## CHECKING IPs WHICH MAKE THE BIGGEST ATTACKS AND BLOCKING THEIR ##

    Code
    1. FILE=/var/log/apache2/access.log; for ip in `cat $FILE |cut -d ' ' -f 1 |sort |uniq`; do { COUNT=`grep ^$ip $FILE |wc -l`; if [[ "$COUNT" -gt "500" ]]; then iptables -A INPUT -s $ip -j DROP; fi }; done

    Where 500 - is responsible for the number of connections from one ip - after exceeding this number, the bot will be blocked.


    ## DISPLAYING ALL IP ADDRESSES AND NUMBER OF ATTACKS FROM ANY IP ##

    Code
    1. FILE=/var/log/apache2/access.log; for ip in `cat $FILE |cut -d ' ' -f 1 |sort |uniq`; do { COUNT=`grep ^$ip $FILE |wc -l`; if [[ "$COUNT" -gt "500" ]]; then echo "$COUNT : $ip"; fi }; done


    ## BLOCKING ENTRIES ON THE WEBSITE + CLOUDFLARE UNLOCKING ##

    Code
    1. iptables -A INPUT -s YOUR_IP_MACHINE_THAT_YOU_WILL_PROTECT -j DROP iptables -A INPUT -p tcp -m multiport --dports http,https -j DROP ip6tables -A INPUT -p tcp -m multiport --dports http,https -j DROP


    You enter the IP addresses one by one

    Code
    1. https://www.cloudflare.com/ips-v4
    Code
    1. iptables -I INPUT -p tcp -m multiport --dports http,https -s HERE_IPV4_ADRESS -j ACCEPT


    Code
    1. https://www.cloudflare.com/ips-v6
    Code
    1. iptables -I INPUT -p tcp -m multiport --dports http,https -s HERE_IPV6_ADRESS -j ACCEPT


    ## CONFIGURATION jail.local - FAIL2BAN ##

    Where ignoreip is responsible for IP addresses CLOUDFLARE


    ## BLOCKING EMPTY GETS VIA .htaccess ##

    Code
    1. RewriteEngine On
    2. RewriteCond %{HTTP_USER_AGENT} ^-?$
    3. RewriteRule ^ - [F]
  • Dieses Thema enthält 5 weitere Beiträge, die nur für registrierte Benutzer sichtbar sind, bitte registrieren Sie sich oder melden Sie sich an um diese lesen zu können.