• Iptables e errori

    From Leonardo Boselli@21:1/5 to All on Sun Feb 4 18:20:01 2024
    This message is in MIME format. The first part should be readable text,
    while the remaining parts are likely unreadable without MIME-aware tools.

    Dope messo fail2ban vedo che da una certa sottortete arrivano la
    generalità degli attacchi quindi ho aggiunto una regola: ma iptables mi
    mostra:
    root@h7136:/etc/fail2ban# iptables -L -n
    Chain INPUT (policy ACCEPT)
    target prot opt source destination
    f2b-sshd 6 -- 0.0.0.0/0 0.0.0.0/0 multiport dports 22

    Chain FORWARD (policy ACCEPT)
    target prot opt source destination

    Chain OUTPUT (policy ACCEPT)
    target prot opt source destination

    Chain f2b-sshd (1 references)
    target prot opt source destination
    REJECT 0 -- 43.133.60.251 0.0.0.0/0 reject-with icmp-port-unreachable
    REJECT 0 -- 36.110.228.254 0.0.0.0/0 reject-with icmp-port-unreachable
    REJECT 0 -- 223.17.0.181 0.0.0.0/0 reject-with icmp-port-unreachable
    REJECT 0 -- 120.48.9.61 0.0.0.0/0 reject-with icmp-port-unreachable
    RETURN 0 -- 0.0.0.0/0 0.0.0.0/0
    REJECT 0 -- 180.101.88.0/21 0.0.0.0/0 reject-with icmp-port-unreachable

    e quello che arriva da 180.101.88.0/21 continuo a trovarmelo nel log,
    forse perché la regola è finita dopo il return.
    come faccio a spostarla in modo che da quella rete ci sia sempre un reject
    ?

    e nel log ho trovato anche:

    Feb 04 18:08:58 h7136 sshd[1562780]: fatal: Timeout before authentication
    for 180.101.88.224 port 33843

    peerché un timeout da una macchina [che averebbe pure dovutop essere
    bannata] appare come fatal ?


    --
    Leonardo Boselli
    Firenze, Toscana, Europa
    http://i.trail.it

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Giuseppe Sacco@21:1/5 to All on Mon Feb 5 09:30:02 2024
    Ciao Leonardo,

    Il giorno dom, 04/02/2024 alle 18.13 +0100, Leonardo Boselli ha scritto:
    [...]
    e quello che arriva da 180.101.88.0/21 continuo a trovarmelo nel log,
    forse perché la regola è finita dopo il return.
    come faccio a spostarla in modo che da quella rete ci sia sempre un reject
    ?
    [...]

    Penso che tu debba inserirle (-I) al posto di appenderle (-A)


    Ciao,
    Giuseppe

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Marco Gaiarin@21:1/5 to All on Mon Feb 5 13:50:01 2024
    Mandi! Leonardo Boselli
    In chel di` si favelave...

    Dope messo fail2ban vedo che da una certa sottortete arrivano la
    generalità degli attacchi quindi ho aggiunto una regola: ma iptables mi

    'aggiunto' in che senso? Hai aggiunto una rule di fail2ban, o hai fatto
    proprio 'iptables -A'?!


    Chain f2b-sshd (1 references)
    target prot opt source destination
    REJECT 0 -- 43.133.60.251 0.0.0.0/0 reject-with icmp-port-unreachable
    REJECT 0 -- 36.110.228.254 0.0.0.0/0 reject-with icmp-port-unreachable
    REJECT 0 -- 223.17.0.181 0.0.0.0/0 reject-with icmp-port-unreachable
    REJECT 0 -- 120.48.9.61 0.0.0.0/0 reject-with icmp-port-unreachable
    RETURN 0 -- 0.0.0.0/0 0.0.0.0/0
    REJECT 0 -- 180.101.88.0/21 0.0.0.0/0 reject-with icmp-port-unreachable

    Se hai fatti 'iptables -A' è normale perchè 'A' è 'APPEND'. Usa 'iptables
    -I', che inserisce in testa.

    --
    Le camere deliberano lo stato di guerra e conferiscono al Governo
    i poteri necessari. (art. 78 Costituzione)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Davide Prina@21:1/5 to All on Sun Feb 11 10:10:02 2024
    Leonardo Boselli ha scritto:

    Dope messo fail2ban
    [...]
    e nel log ho trovato anche:

    Feb 04 18:08:58 h7136 sshd[1562780]: fatal: Timeout before authentication for 180.101.88.224 port 33843

    peerché un timeout da una macchina [che averebbe pure dovutop essere bannata] appare come fatal ?

    fail2ban blocca, temporaneamente, un IP che ha cercato di connettersi,
    tramite brute force.
    Questo vuol dire che i primi X tentativi quell'IP li può fare, se sbaglia
    la password più di X volte, allora lo blocca... ed è per questo che vedi
    quel messaggio

    http://i.trail.it

    ma ho sempre pensato che eri un amministratore di sistema e facevi hosting
    di macchine/servizi informatici... invece fai hosting di persone!
    Tutti a casa di Leonardo! :-D

    Ciao
    Davide

    --
    La mia privacy non è affar tuo
    https://noyb.eu/it
    - You do not have my permission to use this email to train an AI -
    If you use this to train your AI than you accept to distribute under AGPL license >= 3.0 all the model trained, all the source you have used to
    training your model and all the source of the program that use that model

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)