Code Monkey home page Code Monkey logo

firewall's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

firewall's Issues

Integrare il lavoro di subaddiction per wordpress

https://github.com/subaddiction/liveFirewall

https://github.com/subaddiction/liveFirewall/blob/master/wp-firewall.sh

Subaddiction ha introdotto un'analisi dei tentativi su wp-login.php
in pratica:

#!/bin/bash

# Configuration
FILE="/etc/iptables/firewall/log/wp-login.log"
DEFRULES="/etc/iptables/firewall/rules/default"
RULES="/etc/iptables/firewall/rules/wordpress"
MAXATTEMPTS=10

# Restore default iptables
iptables-restore $DEFRULES

# Count requests per ip matching a pattern
cat /var/log/apache2/other_vhosts_access.log | grep -i "wp-login.php" | awk '{print $2}' | sort | uniq -dc > $FILE

# General example
# cat /path/to/apache/logs | grep -i "malicious_pattern" | awk '{print $ip_position_in_log_line}' | sort | uniq -dc > $FILE

# Plesk example
# find /var/www/vhosts -name "access_log.processed" -print0 | xargs -0 cat |grep -i "wp-login.php" | awk '{print $1}' | sort | uniq -dc > $FILE

# Ban malicious IPs
ATTACKER=false
ATTACK=false

while read line
do
ATTACK=$(echo $line | awk '{print $1}')
#echo "$ATTACK"
ATTACKER=$(echo $line | awk '{print $2}')
#echo "$ATTACKER"
if [ "$ATTACK" -gt "$MAXATTEMPTS" ]
then
echo "$ATTACKER attempted $ATTACK times: BANNED"
iptables -A INPUT -p tcp --dport 80 -s "$ATTACKER" -j REJECT
fi
done < $FILE

iptables-save > $RULES

quando integrato riportare con precisione i crediti

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.