HEX
Server: Apache
System: Linux host4.dnns.net 3.10.0-1160.114.2.el7.x86_64 #1 SMP Wed Mar 20 15:54:52 UTC 2024 x86_64
User: zycomsol (1070)
PHP: 7.2.34
Disabled: NONE
Upload Files
File: //etc/rc.local
#!/bin/bash
# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
#
# It is highly advisable to create own systemd services or udev rules
# to run scripts during boot instead of using this file.
#
# In contrast to previous versions due to parallel execution during boot
# this script will NOT be run after all other services.
#
# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
# that this script will be executed during boot.

touch /var/lock/subsys/local

iptables -D INPUT -i eno1 -p tcp --dport 22 -m state --state NEW,INVALID -j SSCN
iptables --flush SSCN
iptables --delete-chain SSCN
iptables --flush RESET
iptables --delete-chain RESET

rmmod xt_recent
modprobe xt_recent ip_list_tot=10000

iptables -N SSCN
iptables -N RESET

iptables -I INPUT -i eno1 -p tcp --dport 22 -m state --state NEW,INVALID -j SSCN

iptables -A SSCN -m recent --update --seconds 3600 --hitcount 5 --name SSCN --rsource -j RESET
iptables -A SSCN -p tcp -m tcp --dport 22 -m recent --set --name SSCN --rsource -j RETURN

iptables -A RESET -p tcp -m tcp --dport 22 -m limit --limit 30/min -j LOG --log-prefix "RangerIPS " --log-level 2
iptables -A RESET -p tcp -j REJECT --reject-with tcp-reset


/usr/src/ipt2