Re: settare firewall
Inviato: giovedì 30 agosto 2007, 12:08
ragazzi, vedo che lo script è del novembre dell'anno scorso.
va bene lo stesso o va aggiornato?
va bene lo stesso o va aggiornato?
Il forum della comunità italiana di Ubuntu.
https://forum.ubuntu-it.org/
Carissimo topo.ap, ho provato il tuo script per due settimane e funziona che è una meraviglia! (good)topo.ap ha scritto: ciao ragazzi.... vorrei mettervi davanti un firewall che ho trovato negli how-to in giro per la rete....
premetto che ho sempre utilizzato mizar con qualche modifica di path e mi sono sempre trovato bene.... ma andando su shields up nn riuscivo mai a passare i test... praticamente risultavo tutto chiuso con la sola porta 53 aperta...
io ho una connessione ethernet con pppo (alice enterprise nero) ubuntu 7.04....
da quando ho trascritto questo iptables riesco a passare tutti i test risulto introvabile con le porte 1-1053 tutte stealth.... dateci un'occhiata anche voi o solo aggiunto le porte per il mulo ma nn sò se lavorano bene come tutto il resto..........
è appena una pagina indietro....federacchio ha scritto: non ho presente lo script, ma come norma generale ti segnalo che le regole vengono lette in maniera sequenziale ossia se il pacchetto "matcha" la regola le successive non vengono considerate.
federico
Codice: Seleziona tutto
sudo sh -c 'echo "1" >/proc/sys/net/ipv4/ip_forward'Codice: Seleziona tutto
Chain INPUT (policy DROP)
target prot opt source destination
ACCEPT 0 -- anywhere anywhere
icmp_in icmp -- anywhere anywhere
bad_tcp tcp -- anywhere anywhere
bad_udp udp -- anywhere anywhere
ok_tcp tcp -- anywhere anywhere
ok_udp udp -- anywhere anywhere
LOG 0 -- anywhere anywhere LOG level warning prefix `Default drop:'
DROP 0 -- anywhere anywhere
Chain FORWARD (policy DROP)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
ACCEPT 0 -- anywhere anywhere
Chain bad_tcp (1 references)
target prot opt source destination
REJECT tcp -- !10.1.1.0/24 anywhere multiport dports www,ftp,ssh,webmin state NEW reject-with icmp-net-unreachable
REJECT tcp -- !10.1.1.0/24 anywhere multiport dports microsoft-ds,mysql state NEW reject-with icmp-net-unreachable
LOG tcp -- anywhere anywhere tcp flags:!SYN,RST,ACK/SYN state NEW LOG level warning prefix `Nuova non syn:'
REJECT tcp -- anywhere anywhere tcp flags:!SYN,RST,ACK/SYN state NEW reject-with icmp-net-unreachable
LOG tcp -- anywhere anywhere state INVALID LOG level warning prefix `Invalida:'
REJECT tcp -- anywhere anywhere state INVALID reject-with icmp-net-unreachable
LOG tcp -- anywhere anywhere tcp flags:FIN,SYN,RST,PSH,ACK,URG/FIN,PSH,URG limit: avg 5/min burst 5 LOG level warning prefix `NMAP-XMAS:'
REJECT tcp -- anywhere anywhere tcp flags:FIN,SYN,RST,PSH,ACK,URG/FIN,PSH,URG reject-with icmp-net-unreachable
LOG tcp -- anywhere anywhere tcp flags:SYN,RST/SYN,RST limit: avg 5/min burst 5 LOG level warning prefix `SYN/RST:'
REJECT tcp -- anywhere anywhere tcp flags:SYN,RST/SYN,RST reject-with icmp-net-unreachable
LOG tcp -- anywhere anywhere tcp flags:FIN,SYN/FIN,SYN limit: avg 5/min burst 5 LOG level warning prefix `SYN/FIN:'
REJECT tcp -- anywhere anywhere tcp flags:FIN,SYN/FIN,SYN reject-with icmp-net-unreachable
LOG tcp -- anywhere anywhere tcp dpts:netbios-ns:netbios-ssn limit: avg 5/min burst 5 LOG level warning prefix `NO SMB:'
LOG tcp -- anywhere anywhere tcp spts:netbios-ns:netbios-ssn limit: avg 5/min burst 5 LOG level warning prefix `NO SMB:'
REJECT tcp -- anywhere anywhere tcp dpts:netbios-ns:netbios-ssn reject-with icmp-net-unreachable
REJECT tcp -- anywhere anywhere tcp spts:netbios-ns:netbios-ssn reject-with icmp-net-unreachable
LOG tcp -- anywhere anywhere tcp dpt:nfs limit: avg 5/min burst 5 LOG level warning prefix `NO NFS:'
LOG tcp -- anywhere anywhere tcp spt:nfs limit: avg 5/min burst 5 LOG level warning prefix `NO NFS:'
REJECT tcp -- anywhere anywhere tcp dpt:nfs reject-with icmp-net-unreachable
REJECT tcp -- anywhere anywhere tcp spt:nfs reject-with icmp-net-unreachable
LOG tcp -- anywhere anywhere tcp dpts:x11:6063 limit: avg 5/min burst 5 LOG level warning prefix `NO X:'
LOG tcp -- anywhere anywhere tcp spts:x11:6063 limit: avg 5/min burst 5 LOG level warning prefix `NO X:'
REJECT tcp -- anywhere anywhere tcp dpts:x11:6063 reject-with icmp-net-unreachable
REJECT tcp -- anywhere anywhere tcp spts:x11:6063 reject-with icmp-net-unreachable
LOG tcp -- anywhere anywhere tcp dpt:20034 limit: avg 5/min burst 5 LOG level warning prefix `NO NetBus2:'
LOG tcp -- anywhere anywhere tcp spt:20034 limit: avg 5/min burst 5 LOG level warning prefix `NO NetBus2:'
REJECT tcp -- anywhere anywhere tcp dpt:20034 reject-with icmp-net-unreachable
REJECT tcp -- anywhere anywhere tcp spt:20034 reject-with icmp-net-unreachable
LOG tcp -- anywhere anywhere tcp dpts:12345:12346 limit: avg 5/min burst 5 LOG level warning prefix `NO NetBus:'
LOG tcp -- anywhere anywhere tcp spts:12345:12346 limit: avg 5/min burst 5 LOG level warning prefix `NO NetBus:'
REJECT tcp -- anywhere anywhere tcp dpts:12345:12346 reject-with icmp-net-unreachable
REJECT tcp -- anywhere anywhere tcp spts:12345:12346 reject-with icmp-net-unreachable
LOG tcp -- anywhere anywhere tcp dpt:asp limit: avg 5/min burst 5 LOG level warning prefix `NO SubSeven:'
LOG tcp -- anywhere anywhere tcp spt:asp limit: avg 5/min burst 5 LOG level warning prefix `NO SubSeven:'
REJECT tcp -- anywhere anywhere tcp dpt:asp reject-with icmp-net-unreachable
REJECT tcp -- anywhere anywhere tcp spt:asp reject-with icmp-net-unreachable
Chain bad_udp (1 references)
target prot opt source destination
Chain icmp_in (1 references)
target prot opt source destination
REJECT icmp -- anywhere anywhere icmp echo-reply reject-with icmp-host-unreachable
REJECT icmp -- anywhere anywhere icmp echo-request reject-with icmp-host-unreachable
REJECT icmp -- anywhere anywhere icmp destination-unreachable reject-with icmp-host-unreachable
REJECT icmp -- anywhere anywhere icmp redirect reject-with icmp-host-unreachable
REJECT icmp -- anywhere anywhere icmp time-exceeded reject-with icmp-host-unreachable
LOG icmp -- anywhere anywhere LOG level warning prefix `ICMP drop:'
DROP icmp -- anywhere anywhere
Chain ok_tcp (1 references)
target prot opt source destination
ACCEPT tcp -- 10.1.1.0/24 anywhere multiport dports www,ftp,ssh,webmin state NEW
ACCEPT tcp -- anywhere anywhere tcp flags:SYN,RST,ACK/SYN
ACCEPT tcp -- anywhere anywhere state RELATED,ESTABLISHED
LOG tcp -- anywhere anywhere LOG level warning prefix `ok_tcp drop:'
REJECT tcp -- anywhere anywhere reject-with icmp-net-unreachable
Chain ok_udp (1 references)
target prot opt source destination
ACCEPT udp -- anywhere anywhere state RELATED,ESTABLISHED
LOG udp -- anywhere anywhere LOG level warning prefix `ok_udp drop:'
REJECT udp -- anywhere anywhere reject-with icmp-net-unreachable
Ciao e grazie.Mizar ha scritto: I test effettuati dall'esterno testano l'ip pubblico da cui ci si collega.
Non è importante essere o non essere dietro un router, quanto sapere se l'ip della propria macchina è pubblico o privato.
Normalmente il proprio ip è privato, del tipo 192.168.x.y, 10.x,y,z o pù raramente 172.16/31.x.y.
In questi casi l'ip testato è quello pubblico del router, quindi il risultato riguarda le impostazioni del firewall del router.
Ciao
Prova ad inserire i comandi per il forward nella parte dello script dove compare "Abilitazione traffico interno"emmedi ha scritto: Ho installato la configurazione di Mizard ma nonostante digitinon riesco a condividere la connessione con un altro pc.Codice: Seleziona tutto
sudo sh -c 'echo "1" >/proc/sys/net/ipv4/ip_forward'
Il mio pc funge da gateway è ha indirizzo 192.168.1.1 mentre il client 192.168.1.2.
Grazie.