install_portsentry
install_portsentry(){
clear
f_banner
echo -e "\e[34m---------------------------------------------------------------------------------------------------------\e[00m"
echo -e "\e[93m[+]\e[00m Installing PortSentry"
echo -e "\e[34m---------------------------------------------------------------------------------------------------------\e[00m"
echo ""
apt-get install portsentry
mv /etc/portsentry/portsentry.conf /etc/portsentry/portsentry.conf-original
cp templates/portsentry /etc/portsentry/portsentry.conf
sed s/tcp/atcp/g /etc/default/portsentry > salida.tmp
mv salida.tmp /etc/default/portsentry
/etc/init.d/portsentry restart
say_done
}
La Función install_portsentry, instala PortSentry que es un sistema de detección que nos ayuda a proteger nuestro servidor de escaneos de puerto. Hace uso de la plantilla templates/portsentry para la configuración.
TCP_PORTS="1,11,15,79,111,119,143,540,635,1080,1524,2000,5742,6667,12345,12346,20034,27665,31337,32771,32772,32773,32774,40421,49724,54320"
UDP_PORTS="1,7,9,69,161,162,513,635,640,641,700,37444,34555,31335,32770,32771,32772,32773,32774,31337,54321"
ADVANCED_PORTS_TCP="1024"
ADVANCED_PORTS_UDP="1024"
ADVANCED_EXCLUDE_TCP="113,139"
ADVANCED_EXCLUDE_UDP="520,138,137,67"
IGNORE_FILE="/etc/portsentry/portsentry.ignore"
HISTORY_FILE="/var/lib/portsentry/portsentry.history"
BLOCKED_FILE="/var/lib/portsentry/portsentry.blocked"
RESOLVE_HOST = "0"
BLOCK_UDP="1"
BLOCK_TCP="1"
KILL_ROUTE="/sbin/route add -host $TARGET$ reject"
KILL_HOSTS_DENY="ALL: $TARGET$ : DENY"
KILL_RUN_CMD_FIRST = "0"
KILL_RUN_CMD="/sbin/blockip $TARGET$"
SCAN_TRIGGER="0"
# EOF