[WORKLOG] - Installazione di un server ftp su Debian 6.0

Pagina 2 di 2
prima
1 2
Visualizzazione dei risultati da 11 a 12 su 12
  1. #11
    Super Moderatore L'avatar di frakka
    Registrato
    May 2001
    Località
    Casalecchio di Reno (Bo)
    Età
    43
    Messaggi
    23,379
    configurazione

    Predefinito 8.4_ filter.d/vsftpd-log.conf

    Originariamente inviato da filter.d/vsftpd-log.conf
    codice HTML:
    # Fail2Ban configuration file
    #
    # Author: Cyril Jaquier
    #
    # $Revision: 728 $
    #
    
    [Definition]
    
    # Option: failregex
    # Notes.: regex to match the password failures messages in the logfile. The
    #          host must be matched by a group named "host". The tag "<HOST>" can
    #          be used for standard IP/hostname matching and is only an alias for
    #          (?:::f{4,6}:)?(?P<host>[\w\-.^_]+)
    # Values: TEXT
    #
    failregex = \[.+\] FAIL LOGIN: Client "<HOST>"\s*$                                                
                       \[.+\] CONNECT: Client "<HOST>"\s*$
    # Option:  ignoreregex
    # Notes.:  regex to ignore. If this regex matches, the line is ignored.
    # Values:  TEXT
    #
    ignoreregex =
    Ho adottato per questo file la regex prevista di default, con una modifica. Ho rimosso la regex "vsftpd(?:\(pam_unix\))?(?:\[\d+\])?:.* authentication failure; .* rhost=(?:\s+user=\S*)?\s*$" ed ho aggiunto "\[.+\] CONNECT: Client ""\s*$".

    Questa aggiunta è rischiosa: Tutti i client che si collegano ad un server ftp provocano un registrazione del tipo
    codice:
    CONNECT: Client "124.227.190.252"
    che viene matchata dalla regex.
    In pochi però provocano più registrazioni di questo tipo in pochissimo tempo: Nel file jail.local ho impostato valore di "maxretry" per la jail "[vsftpd-log]" di "10" e, dato che il findtime predefinito è di "300" secondi, da quello che ho potuto vedere finora tutti gli IP che hanno provocato più di 10 "CONNECT" in meno di 5 minuti sono riconducibili a scanner. Lo stesso bot di Google non fà mai più di uno o due "CONNECT" nel findtime configurato, mentre uno scanner/bot ne può fare anche diverse decine.

    Vediamo come va...

    Questa è la storia di 4 persone chiamate Ognuno, Qualcuno, Ciascuno e Nessuno. C'era un lavoro importante da fare e Ognuno era sicuro che Qualcuno lo avrebbe fatto. Ciascuno poteva farlo, ma Nessuno lo fece, Qualcuno si arrabbiò perché era il lavoro di Ognuno. Ognuno pensò che Ciascuno potesse farlo, ma Ognuno capì che Nessuno l'avrebbe fatto. Finì che Ognuno incolpò Qualcuno perché Nessuno fece ciò che Ciascuno avrebbe potuto fare.

  2. #12
    Super Moderatore L'avatar di frakka
    Registrato
    May 2001
    Località
    Casalecchio di Reno (Bo)
    Età
    43
    Messaggi
    23,379
    configurazione

    Predefinito 8.5_ filter.d/vsftpd-xferlog.conf

    In questo log vsftpd registra le operazioni di trasferimento dati, upload e download.

    Il filter che ho adottato per questo log è il seguente:
    Originariamente inviato da filter.d/vsftpd-xferlog.conf
    codice HTML:
    # Fail2Ban configuration file
    #
    # Author: Matteo Fracassetti
    #
    # $Revision: 001 $
    #
    
    [Definition]
    
    # Option: failregex
    # Notes.: regex to match the password failures messages in the logfile. The
    #          host must be matched by a group named "host". The tag "<HOST>" can
    #          be used for standard IP/hostname matching and is only an alias for
    #          (?:::f{4,6}:)?(?P<host>[\w\-.^_]+)
    # Values: TEXT
    #
    failregex = \d+ <HOST> \d+ [(?:\|\/)\.+]{3,}.*$
                \d+ <HOST> \d+ .*etc.*passwd .*$
                \d+ <HOST> \d+ .*boot.ini .*$
    # Option:  ignoreregex
    # Notes.:  regex to ignore. If this regex matches, the line is ignored.
    # Values:  TEXT
    #
    ignoreregex =
    Praticamente tutte le regex sono ispirate alle registrazioni che ho trovato sempre generate da uno scanner o, più probabilmente, un bot relative a tentativi vari di accesso al file /etc/passwd o ad un file "boot.ini"...
    La prima in particolare, dovrebbe matchare la presenza di due o più ripetizioni della sequenza di caratteri costituita da una o più "\" oppure una o più "/" seguite da uno o più "."

    codice:
    Sun Aug 19 22:53:56 2012 1 83.139.194.70 0 /etc/passwd a _ o a  ftp 0 * i
    Sun Aug 19 22:53:57 2012 1 83.139.194.70 0 /..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\etc/passwd a _ o a  ftp 0 * i
    Sun Aug 19 22:53:59 2012 1 83.139.194.70 0 /../\../\../\../\../\../\../\../\../\../\../\../\etc/passwd a _ o a  ftp 0 * i
    Sun Aug 19 22:54:00 2012 1 83.139.194.70 0 /..\/..\/..\/..\/..\/..\/..\/..\/..\/..\/..\/..\/etc/passwd a _ o a  ftp 0 * i
    Sun Aug 19 22:54:02 2012 1 83.139.194.70 0 /..///..///..///..///..///..///..///..///..///..///..///..///etc/passwd a _ o a  ftp 0 * i
    Sun Aug 19 22:54:03 2012 1 83.139.194.70 0 /etc/passwd a _ o a  ftp 0 * i
    Sun Aug 19 22:54:05 2012 1 83.139.194.70 0 /../\/../\/../\/../\/../\/../\/../\/../\/../\/../\/../\/../\/etc/passwd a _ o a  ftp 0 * i
    Sun Aug 19 22:54:06 2012 1 83.139.194.70 0 /./.././.././.././.././.././.././.././.././.././.././.././../etc/passwd a _ o a  ftp 0 * i
    Sun Aug 19 22:54:08 2012 1 83.139.194.70 0 /etc/passwd a _ o a  ftp 0 * i
    Sun Aug 19 22:54:09 2012 1 83.139.194.70 0 /.\..\.\..\.\..\.\..\.\..\.\..\.\..\.\..\.\..\.\..\.\..\.\..\etc/passwd a _ o a  ftp 0 * i
    Sun Aug 19 22:54:11 2012 1 83.139.194.70 0 /../../../../../../../../../../../../etc/passwd a _ o a  ftp 0 * i
    Sun Aug 19 22:54:13 2012 1 83.139.194.70 0 /etc/passwd a _ o a  ftp 0 * i
    Sun Aug 19 22:54:15 2012 1 83.139.194.70 0 /\..\..\..\..\..\..\..\..\..\..\..\..\etc/passwd a _ o a  ftp 0 * i
    Sun Aug 19 22:54:16 2012 1 83.139.194.70 0 /.../etc/passwd a _ o a  ftp 0 * i
    Sun Aug 19 22:54:18 2012 1 83.139.194.70 0 /.../etc/passwd a _ o a  ftp 0 * i
    Sun Aug 19 22:54:23 2012 1 83.139.194.70 0 /....../etc/passwd a _ o a  ftp 0 * i
    Sun Aug 19 22:54:24 2012 1 83.139.194.70 0 /\.../etc/passwd a _ o a  ftp 0 * i
    Sun Aug 19 22:54:26 2012 1 83.139.194.70 0 /...\etc/passwd a _ o a  ftp 0 * i
    Sun Aug 19 22:54:27 2012 1 83.139.194.70 0 /..../etc/passwd a _ o a  ftp 0 * i
    Sun Aug 19 22:54:29 2012 1 83.139.194.70 0 /C:\etc/passwd a _ o a  ftp 0 * i
    
    Sun Aug 19 22:53:56 2012 1 83.139.194.70 0 /boot.ini a _ o a  ftp 0 * i
    Sun Aug 19 22:53:57 2012 1 83.139.194.70 0 /..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\boot.ini a _ o a  ftp 0 * i
    Sun Aug 19 22:53:59 2012 1 83.139.194.70 0 /../\../\../\../\../\../\../\../\../\../\../\../\boot.ini a _ o a  ftp 0 * i
    Sun Aug 19 22:54:00 2012 1 83.139.194.70 0 /..\/..\/..\/..\/..\/..\/..\/..\/..\/..\/..\/..\/boot.ini a _ o a  ftp 0 * i
    Sun Aug 19 22:54:02 2012 1 83.139.194.70 0 /..///..///..///..///..///..///..///..///..///..///..///..///boot.ini a _ o a  ftp 0 * i
    Sun Aug 19 22:54:03 2012 1 83.139.194.70 0 /boot.ini a _ o a  ftp 0 * i
    Sun Aug 19 22:54:05 2012 1 83.139.194.70 0 /../\/../\/../\/../\/../\/../\/../\/../\/../\/../\/../\/../\/boot.ini a _ o a  ftp 0 * i
    Sun Aug 19 22:54:06 2012 1 83.139.194.70 0 /./.././.././.././.././.././.././.././.././.././.././.././../boot.ini a _ o a  ftp 0 * i
    Sun Aug 19 22:54:08 2012 1 83.139.194.70 0 /boot.ini a _ o a  ftp 0 * i
    Sun Aug 19 22:54:09 2012 1 83.139.194.70 0 /.\..\.\..\.\..\.\..\.\..\.\..\.\..\.\..\.\..\.\..\.\..\.\..\boot.ini a _ o a  ftp 0 * i
    Sun Aug 19 22:54:12 2012 1 83.139.194.70 0 /../../../../../../../../../../../../boot.ini a _ o a  ftp 0 * i
    Sun Aug 19 22:54:13 2012 1 83.139.194.70 0 /boot.ini a _ o a  ftp 0 * i
    Sun Aug 19 22:54:15 2012 1 83.139.194.70 0 /\..\..\..\..\..\..\..\..\..\..\..\..\boot.ini a _ o a  ftp 0 * i
    Sun Aug 19 22:54:16 2012 1 83.139.194.70 0 /.../boot.ini a _ o a  ftp 0 * i
    Non è decisamente perfetta, matcha delle occorrenze che non capisco... Ad esempio, impostando a "{2,}" il valore delle ripetizioni minime delle occorrenze rilevate venivano matchate anche queste righe:
    codice:
    Sun Aug 19 22:51:38 2012 1 83.139.194.70 0 /.forward a _ o a  ftp 0 * i
    Sun Aug 19 22:51:38 2012 1 83.139.194.70 0 /.rhosts a _ o a  ftp 0 * i
    Questi match scompaiono se si porta a il valore a 3 ma non ho ancora capito perchè...

    E poi devo trovare il modo di matchare anche questo:
    codice:
    Sun Aug 19 22:53:45 2012 1 83.139.194.70 0 /..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f/etc/passwd a _ o a  ftp 0 * i
    Sun Aug 19 22:53:45 2012 1 83.139.194.70 0 /..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f/boot.ini a _ o a  ftp 0 * i

    Questa è la storia di 4 persone chiamate Ognuno, Qualcuno, Ciascuno e Nessuno. C'era un lavoro importante da fare e Ognuno era sicuro che Qualcuno lo avrebbe fatto. Ciascuno poteva farlo, ma Nessuno lo fece, Qualcuno si arrabbiò perché era il lavoro di Ognuno. Ognuno pensò che Ciascuno potesse farlo, ma Ognuno capì che Nessuno l'avrebbe fatto. Finì che Ognuno incolpò Qualcuno perché Nessuno fece ciò che Ciascuno avrebbe potuto fare.

Pagina 2 di 2
prima
1 2

Informazioni Thread

Users Browsing this Thread

Ci sono attualmente 1 utenti che stanno visualizzando questa discussione. (0 utenti e 1 ospiti)

Tags

Regole d'invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
nexthardware.com - © 2002-2022