Skip to content

Instantly share code, notes, and snippets.

View keybase.md

Keybase proof

I hereby claim:

  • I am parrazam on github.
  • I am parrazam (https://keybase.io/parrazam) on keybase.
  • I have a public key ASCMDIhPAbHA7LVMKvRlq1weNj1LAJo7lTfi3JhWGUrVpAo

To claim this, I am signing this object:

@parrazam
parrazam / customactions.conf
Created Jun 4, 2020
Fail2Ban custom actions
View customactions.conf
[Definition]
# Option: actionstart
# Notes : command executed once at the start of Fail2Ban
# Tags :
# Values: CMD
actionstart =
# Option: actionstop
# Notes : command executed once at the end of Fail2Ban
@parrazam
parrazam / jail.local
Created Jun 4, 2020
Fail2Ban jail local
View jail.local
[sshd]
# To use more aggressive ssh modes set filter parameter "mode":
# normal (default), ddos, extra or aggressive (combines all).
# See "tests/files/logs/sshd" or "filter.d/sshd.conf" for usage example and details.
#mode = normal
port = ssh
enabled = true
filter = sshd
ignoreip = 192.168.1.0/24
@parrazam
parrazam / ssh_alert_script_pam.sh
Created May 25, 2020
SSH session alert script
View ssh_alert_script_pam.sh
#!/bin/bash
# This script should be allocated in /etc/pam.scripts/ssh_alert.sh
# Then, in /etc/pam.d/sshd add this line:
# # SSH Alert script
# session required pam_exec.so /etc/pam.scripts/ssh_alert.sh
echo $PAM_TYPE
@parrazam
parrazam / publishMessageToTelegramBot.sh
Created May 25, 2020
Publish message to a Telegram bot
View publishMessageToTelegramBot.sh
#!/bin/bash
if [[ $# -ne 1 ]]
then
echo "\nSe requiere un mensaje para enviar. Ejemplo de uso: $0 \"Mensaje de prueba\""
exit 1
fi
source /home/$USER/.tg_keys
@parrazam
parrazam / baja_usuarios.pl
Created May 24, 2020
Script en Perl para dar de baja un usuario
View baja_usuarios.pl
#!/usr/bin/perl
# Script que permite dar de baja un usuario.
# Author: Víctor Parra [parra@usal.es]
# AVISO: Requiere permisos de root
# Es necesario instalar el File::Path y el Linux::usermod
# ># perl -MCPAN -e 'install File::Path'
# ># perl -MCPAN -e 'install Linux::usermod'
@parrazam
parrazam / alta_usuarios.pl
Created May 24, 2020
Script en Perl para dar de alta un usuario
View alta_usuarios.pl
#!/usr/bin/perl
# Script que permite dar de alta un usuario.
# Author: Víctor Parra [parra@usal.es]
# AVISO: Requiere permisos de root
# Es necesrio instalar el File::Copy y el Linux::usermod
# ># perl -MCPAN -e 'install File::Copy::Recursive'
# ># perl -MCPAN -e 'install Linux::usermod'