[Primipassi] iptables+firestarter+squid+log delle richieste

Manuel Toniato manuel17@libero.it
Mar 23 Mar 2004 13:28:36 CET


- IL PROBLEMA SEMBRA RIMANERE
Mi rifaccio vivo dopo una settimana dedicata solo all'esame di antenne. Nel frattempo ho potuto lavorare solo sul mio pc in locale senza poter andare nell'aula informatica. D'altro canto però ho detto per telefono agli altri di provare ad aprire la porta del dns ma sembra che il problema permanga. Domani proverò di persona.

- FIRESTARTER
In questi giorni ho provato il programma consigliato da Marco ("Firestarter"). Sinceramente mi sembra più chiaro l'utilizzo di iptables a manina che non una cosa del genere.

- SQUID
Nel frattempo ho spulciato anche il manuale di squid e l'ho configurato qui a casa senza tanti problemi. Non ho ancora letto tutto ma con il tempo...
Tra l'altro poi il firewall devo impostarlo con il filtro sulla porta 80 o sulla 3128?
Cioè...
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
oppure
iptables -A INPUT -p tcp --dport 3128 -j ACCEPT
E altra domanda da chi non ha ben capito il sistema del proxy: quando imposto il proxy nel browser, tutto il traffico sulle varie porte (quindi anche il dns per esempio) viene dirottato sulla 3128 oppure solo il traffico http?

- LOG DI IPTABLES
Ma veniamo alla domanda del subject. Se domani dovessero esserci ancora problemi, non è che c'è un modo per dire a iptables di registrare le richieste di connessione che rifiuta? Insomma capire su che caspita di porte avvengono le richieste di connessione? Nel mio firewall sotto windows (outpost) registra le varie richieste e così so che porte devo aprire.

Grazie di tutto!!!
Ciao!
Manuel

>Il 10/03/2004 alle 11.46 Aldo Podavini <a.podavini@mclink.it> ha scritto:
>
>"Re: [Primipassi] E se fosse un problema di DNS? (sempre iptables)"
>p.s.: ciò detto, ci sono alcune altre cose da approfondire; giusto per
>darti qualche spunto:
>1) è giusto che la netmask esterna sia a 8 bit ? Non è impossibile, ma è
>un po' insolito in quel tipo di struttura (ma d'altronde già il 100.x.x.x
>lo è...)
>2) della sicurezza della tua rete non ti preoccupi ? a che scopo filtrare
>il traffico esterno ==> clients quando poi hai tutta la linuxbox aperta
>(policy di INPUT e di OUTPUT su ACCEPT) ?
>3) ricordati che quando installerai squid (cosa che farai sicuramente se
>vuoi filtrare il tipo di files che i tuoi clients scaricano) non avrai più
>traffico FORWARD, ma solo traffico INPUT e OUTPUT, poichè l'unico client
>che accederà a Internet sarà squid stesso.
>Ciao
>Aldo
>
>
>
>manuel17@libero.it wrote:
>
>Eccomi ritornato in biblioteca.
>E si sono fatti un po' di passi in avanti.
>Vi riporto gli output dei vari comandi suggeritimi.
>Per tcpdump ho messo in traffico.txt l'output semplice ottenuto con > e in
>tcpdump.txt l'output ottenuto con 2> (dovrebbero essere i messaggi di
>errore o
>simili giusto?).
>
>Piccola nota su come  si è ottenuto questo output di tcpdump. Da uno dei
>client
>abbiamo provato ad andare su www.libero.it ed è andato senza problemi. Poi
>abbiamo provato ad andare su un altro sito (www.gazzettino.it) e non
>abbiamo
>ottenuto risposta. E qui abbiamo chiuso il tcpdump.
>
>Al che abbiamo provato con 213.26.79.24 (l'indirizzo ip di
>www.gazzettino.it) e
>con molta fatica ha caricato la pagina.
>
>Non è che si devono aprire delle porte per il DNS? Come DNS noi usiamo un
>server
>esterno (151.99.125.2). Non è che si debba configurare qualcosa quando si
>chiudono le porte?
>
>Ciao e grazie di tutto!
>Manuel
>
>
>
>
>
>
>
>  
>
>Chain INPUT (policy ACCEPT 3 packets, 540 bytes)
> pkts bytes target     prot opt in     out     source              
>destination         
>
>Chain FORWARD (policy DROP 0 packets, 0 bytes)
> pkts bytes target     prot opt in     out     source              
>destination         
>    0     0 ACCEPT     tcp  --  eth1   eth0    0.0.0.0/0           
>0.0.0.0/0          tcp dpt:80 
>    0     0 ACCEPT     tcp  --  eth1   eth0    0.0.0.0/0           
>0.0.0.0/0          tcp dpt:443 
>    0     0 ACCEPT     tcp  --  eth1   eth0    0.0.0.0/0           
>0.0.0.0/0          tcp dpt:21 
>    0     0 ACCEPT     tcp  --  eth0   eth1    0.0.0.0/0           
>0.0.0.0/0          state RELATED,ESTABLISHED 
>
>Chain OUTPUT (policy ACCEPT 2 packets, 92 bytes)
> pkts bytes target     prot opt in     out     source              
>destination         
>  
>
>192.168.0.0/24 dev eth1  scope link 
>169.254.0.0/16 dev eth1  scope link 
>100.0.0.0/8 dev eth0  scope link 
>127.0.0.0/8 dev lo  scope link 
>default via 100.1.1.1 dev eth0 
>  
>
>tcpdump: listening on eth1
>
>98 packets received by filter
>0 packets dropped by kernel
>  
>
>eth0      Link encap:Ethernet  HWaddr 00:0C:6E:92:09:D0  
>          inet addr:100.1.1.201  Bcast:100.255.255.255  Mask:255.0.0.0
>          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>          RX packets:4625 errors:0 dropped:0 overruns:0 frame:0
>          TX packets:3889 errors:0 dropped:0 overruns:0 carrier:0
>          collisions:0 txqueuelen:100 
>          RX bytes:2878366 (2.7 Mb)  TX bytes:684533 (668.4 Kb)
>          Interrupt:11 Base address:0xec00 
>
>eth1      Link encap:Ethernet  HWaddr 00:02:44:D0:21:F1  
>          inet addr:192.168.0.1  Bcast:192.168.0.255  Mask:255.255.255.0
>          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>          RX packets:2865 errors:0 dropped:0 overruns:0 frame:0
>          TX packets:2546 errors:0 dropped:0 overruns:0 carrier:0
>          collisions:0 txqueuelen:100 
>          RX bytes:438969 (428.6 Kb)  TX bytes:1618190 (1.5 Mb)
>          Interrupt:11 Base address:0xd000 
>
>lo        Link encap:Local Loopback  
>          inet addr:127.0.0.1  Mask:255.0.0.0
>          UP LOOPBACK RUNNING  MTU:16436  Metric:1
>          RX packets:23 errors:0 dropped:0 overruns:0 frame:0
>          TX packets:23 errors:0 dropped:0 overruns:0 carrier:0
>          collisions:0 txqueuelen:0 
>          RX bytes:1876 (1.8 Kb)  TX bytes:1876 (1.8 Kb)
>
>  
>
>11:37:06.636459 postazione2.1242 > vs-fe.iol.it.http: S
>1273219027:1273219027(0) win 64240 <mss 1460,nop,nop,sackOK> (DF)
>11:37:06.730169 vs-fe.iol.it.http > postazione2.1242: S
>3224576486:3224576486(0) ack 1273219028 win 8192 <mss 1380>
>11:37:06.730283 postazione2.1242 > vs-fe.iol.it.http: . ack 1 win 64860
>(DF)
>11:37:06.730516 postazione2.1242 > vs-fe.iol.it.http: P 1:490(489) ack 1
>win 64860 (DF)
>11:37:06.818116 vs-fe.iol.it.http > postazione2.1242: . ack 490 win 6432
>(DF)
>11:37:06.820998 vs-fe.iol.it.http > postazione2.1242: P 1:154(153) ack 490
>win 6432 (DF)
>11:37:06.821209 postazione2.1242 > vs-fe.iol.it.http: F 490:490(0) ack 154
>win 64707 (DF)
>11:37:06.822206 vs-fe.iol.it.http > postazione2.1242: F 154:154(0) ack 490
>win 6432 (DF)
>11:37:06.822291 postazione2.1242 > vs-fe.iol.it.http: . ack 155 win 64707
>(DF)
>11:37:06.847027 postazione2.1243 > adv-banner.iol.it.http: S
>1273324208:1273324208(0) win 64240 <mss 1460,nop,nop,sackOK> (DF)
>11:37:06.847505 postazione2.1244 > adv-banner.iol.it.http: S
>1273359540:1273359540(0) win 64240 <mss 1460,nop,nop,sackOK> (DF)
>11:37:06.856657 postazione2.1245 > vs-fe.iol.it.http: S
>1273440725:1273440725(0) win 64240 <mss 1460,nop,nop,sackOK> (DF)
>11:37:06.868146 postazione2.1246 > vs-fe.iol.it.http: S
>1273490426:1273490426(0) win 64240 <mss 1460,nop,nop,sackOK> (DF)
>11:37:06.944634 postazione2.1247 > adserver.libero.it.http: S
>1273547596:1273547596(0) win 64240 <mss 1460,nop,nop,sackOK> (DF)
>11:37:07.014028 adv-banner.iol.it.http > postazione2.1243: S
>3817406498:3817406498(0) ack 1273324209 win 5840 <mss 1380,nop,nop,sackOK>
>(DF)
>11:37:07.014149 postazione2.1243 > adv-banner.iol.it.http: . ack 1 win
>64860 (DF)
>11:37:07.014417 postazione2.1243 > adv-banner.iol.it.http: P 1:522(521)
>ack 1 win 64860 (DF)
>11:37:07.056588 adv-banner.iol.it.http > postazione2.1244: S
>3974773496:3974773496(0) ack 1273359541 win 5840 <mss 1380,nop,nop,sackOK>
>(DF)
>11:37:07.056683 postazione2.1244 > adv-banner.iol.it.http: . ack 1 win
>64860 (DF)
>11:37:07.056929 postazione2.1244 > adv-banner.iol.it.http: P 1:494(493)
>ack 1 win 64860 (DF)
>11:37:07.058136 vs-fe.iol.it.http > postazione2.1245: S
>3244541779:3244541779(0) ack 1273440726 win 8192 <mss 1380>
>11:37:07.058208 postazione2.1245 > vs-fe.iol.it.http: . ack 1 win 64860
>(DF)
>11:37:07.058368 postazione2.1245 > vs-fe.iol.it.http: P 1:496(495) ack 1
>win 64860 (DF)
>11:37:07.065357 vs-fe.iol.it.http > postazione2.1246: S
>4181414638:4181414638(0) ack 1273490427 win 8192 <mss 1380>
>11:37:07.065434 postazione2.1246 > vs-fe.iol.it.http: . ack 1 win 64860
>(DF)
>11:37:07.065586 postazione2.1246 > vs-fe.iol.it.http: P 1:493(492) ack 1
>win 64860 (DF)
>11:37:07.109466 adserver.libero.it.http > postazione2.1247: S
>3781269992:3781269992(0) ack 1273547597 win 5840 <mss 1380,nop,nop,sackOK>
>(DF)
>11:37:07.109544 postazione2.1247 > adserver.libero.it.http: . ack 1 win
>64860 (DF)
>11:37:07.109719 postazione2.1247 > adserver.libero.it.http: P 1:512(511)
>ack 1 win 64860 (DF)
>11:37:07.153913 adv-banner.iol.it.http > postazione2.1243: . ack 522 win
>6432 (DF)
>11:37:07.158846 adv-banner.iol.it.http > postazione2.1243: P 1:155(154)
>ack 522 win 6432 (DF)
>11:37:07.159009 postazione2.1243 > adv-banner.iol.it.http: F 522:522(0)
>ack 155 win 64706 (DF)
>11:37:07.159520 adv-banner.iol.it.http > postazione2.1243: F 155:155(0)
>ack 522 win 6432 (DF)
>11:37:07.159597 postazione2.1243 > adv-banner.iol.it.http: . ack 156 win
>64706 (DF)
>11:37:07.160646 postazione2.1248 > adv-banner.iol.it.http: S
>1273678568:1273678568(0) win 64240 <mss 1460,nop,nop,sackOK> (DF)
>11:37:07.202966 adv-banner.iol.it.http > postazione2.1244: . ack 494 win
>6432 (DF)
>11:37:07.204661 adv-banner.iol.it.http > postazione2.1244: P 1:155(154)
>ack 494 win 6432 (DF)
>11:37:07.204834 postazione2.1244 > adv-banner.iol.it.http: F 494:494(0)
>ack 155 win 64706 (DF)
>11:37:07.205874 adv-banner.iol.it.http > postazione2.1244: F 155:155(0)
>ack 494 win 6432 (DF)
>11:37:07.205969 postazione2.1244 > adv-banner.iol.it.http: . ack 156 win
>64706 (DF)
>11:37:07.244119 vs-fe.iol.it.http > postazione2.1245: . ack 496 win 6432
>(DF)
>11:37:07.251133 vs-fe.iol.it.http > postazione2.1245: P 1:331(330) ack 496
>win 6432 (DF)
>11:37:07.251455 postazione2.1245 > vs-fe.iol.it.http: F 496:496(0) ack 331
>win 64530 (DF)
>11:37:07.251534 vs-fe.iol.it.http > postazione2.1245: F 331:331(0) ack 496
>win 6432 (DF)
>11:37:07.251607 postazione2.1245 > vs-fe.iol.it.http: . ack 332 win 64530
>(DF)
>11:37:07.252510 postazione2.1249 > vs-fe.iol.it.http: S
>1273751823:1273751823(0) win 64240 <mss 1460,nop,nop,sackOK> (DF)
>11:37:07.294500 vs-fe.iol.it.http > postazione2.1246: . ack 493 win 6432
>(DF)
>11:37:07.295050 vs-fe.iol.it.http > postazione2.1246: P 1:333(332) ack 493
>win 6432 (DF)
>11:37:07.295327 postazione2.1246 > vs-fe.iol.it.http: F 493:493(0) ack 333
>win 64528 (DF)
>11:37:07.295524 vs-fe.iol.it.http > postazione2.1246: F 333:333(0) ack 493
>win 6432 (DF)
>11:37:07.295598 postazione2.1246 > vs-fe.iol.it.http: . ack 334 win 64528
>(DF)
>11:37:07.296207 postazione2.1250 > vs-fe.iol.it.http: S
>1273796712:1273796712(0) win 64240 <mss 1460,nop,nop,sackOK> (DF)
>11:37:07.338802 adserver.libero.it.http > postazione2.1247: . ack 512 win
>6432 (DF)
>11:37:07.339290 adserver.libero.it.http > postazione2.1247: P 382:387(5)
>ack 512 win 6432 (DF)
>11:37:07.339413 postazione2.1247 > adserver.libero.it.http: . ack 1 win
>64860 <nop,nop,sack sack 1 {382:387} > (DF)
>11:37:07.339824 adserver.libero.it.http > postazione2.1247: F 387:387(0)
>ack 512 win 6432 (DF)
>11:37:07.339891 postazione2.1247 > adserver.libero.it.http: . ack 1 win
>64860 <nop,nop,sack sack 1 {382:388} > (DF)
>11:37:07.340453 adserver.libero.it.http > postazione2.1247: P 1:382(381)
>ack 512 win 6432 (DF)
>11:37:07.340602 postazione2.1247 > adserver.libero.it.http: . ack 388 win
>64474 <nop,nop,sack sack 1 {382:388} > (DF)
>11:37:07.340835 postazione2.1247 > adserver.libero.it.http: F 512:512(0)
>ack 388 win 64474 (DF)
>11:37:07.341035 adv-banner.iol.it.http > postazione2.1243: . ack 523 win
>6432 (DF)
>11:37:07.344622 adv-banner.iol.it.http > postazione2.1248: S
>2617572469:2617572469(0) ack 1273678569 win 5840 <mss 1380,nop,nop,sackOK>
>(DF)
>11:37:07.344701 postazione2.1248 > adv-banner.iol.it.http: . ack 1 win
>64860 (DF)
>11:37:07.344920 postazione2.1248 > adv-banner.iol.it.http: P 1:496(495)
>ack 1 win 64860 (DF)
>11:37:07.360052 vs-fe.iol.it.http > postazione2.1245: . ack 497 win 6432
>(DF)
>11:37:07.372270 vs-fe.iol.it.http > postazione2.1249: S
>3207933624:3207933624(0) ack 1273751824 win 8192 <mss 1380>
>11:37:07.372388 postazione2.1249 > vs-fe.iol.it.http: . ack 1 win 64860
>(DF)
>11:37:07.372639 postazione2.1249 > vs-fe.iol.it.http: P 1:523(522) ack 1
>win 64860 (DF)
>11:37:07.378270 vs-fe.iol.it.http > postazione2.1246: . ack 494 win 6432
>(DF)
>11:37:07.389567 vs-fe.iol.it.http > postazione2.1250: S
>3168741760:3168741760(0) ack 1273796713 win 8192 <mss 1380>
>11:37:07.389694 postazione2.1250 > vs-fe.iol.it.http: . ack 1 win 64860
>(DF)
>11:37:07.389940 postazione2.1250 > vs-fe.iol.it.http: P 1:509(508) ack 1
>win 64860 (DF)
>11:37:07.412163 adserver.libero.it.http > postazione2.1247: . ack 513 win
>6432 (DF)
>11:37:07.452316 adv-banner.iol.it.http > postazione2.1248: . ack 496 win
>6432 (DF)
>11:37:07.473767 adv-banner.iol.it.http > postazione2.1248: . 1:1381(1380)
>ack 496 win 6432 (DF)
>11:37:07.474302 postazione2.1248 > adv-banner.iol.it.http: R
>1273679064:1273679064(0) win 0 (DF)
>11:37:07.498643 vs-fe.iol.it.http > postazione2.1249: . ack 523 win 6432
>(DF)
>11:37:07.499599 vs-fe.iol.it.http > postazione2.1249: F 155:155(0) ack 523
>win 6432 (DF)
>11:37:07.499684 postazione2.1249 > vs-fe.iol.it.http: . ack 1 win 64860
>(DF)
>11:37:07.503748 vs-fe.iol.it.http > postazione2.1249: P 1:155(154) ack 523
>win 6432 (DF)
>11:37:07.503857 postazione2.1249 > vs-fe.iol.it.http: . ack 156 win 64706
>(DF)
>11:37:07.503985 postazione2.1249 > vs-fe.iol.it.http: F 523:523(0) ack 156
>win 64706 (DF)
>11:37:07.538284 vs-fe.iol.it.http > postazione2.1250: . ack 509 win 6432
>(DF)
>11:37:07.560335 vs-fe.iol.it.http > postazione2.1250: . 1:1381(1380) ack
>509 win 6432 (DF)
>11:37:07.560522 vs-fe.iol.it.http > postazione2.1250: F 2055:2055(0) ack
>509 win 6432 (DF)
>11:37:07.560710 postazione2.1250 > vs-fe.iol.it.http: . ack 1381 win 64860
>(DF)
>11:37:07.560914 postazione2.1250 > vs-fe.iol.it.http: R
>1273797221:1273797221(0) win 0 (DF)
>11:37:07.568683 vs-fe.iol.it.http > postazione2.1249: . ack 524 win 6432
>(DF)
>11:37:09.261749 postazione2.1242 > vs-fe.iol.it.http: F 490:490(0) ack 155
>win 64707 (DF)
>11:37:09.664088 postazione2.1244 > adv-banner.iol.it.http: F 494:494(0)
>ack 156 win 64706 (DF)
>11:37:14.291002 postazione2.1242 > vs-fe.iol.it.http: F 490:490(0) ack 155
>win 64707 (DF)
>11:37:14.693344 postazione2.1244 > adv-banner.iol.it.http: F 494:494(0)
>ack 156 win 64706 (DF)
>11:37:24.248931 postazione2.1242 > vs-fe.iol.it.http: F 490:490(0) ack 155
>win 64707 (DF)
>11:37:24.651270 postazione2.1244 > adv-banner.iol.it.http: F 494:494(0)
>ack 156 win 64706 (DF)
>11:37:44.265374 postazione2.1242 > vs-fe.iol.it.http: F 490:490(0) ack 155
>win 64707 (DF)
>11:37:44.667717 postazione2.1244 > adv-banner.iol.it.http: F 494:494(0)
>ack 156 win 64706 (DF)
>11:38:25.900781 postazione2.1242 > vs-fe.iol.it.http: F 490:490(0) ack 155
>win 64707 (DF)
>11:38:26.303126 postazione2.1244 > adv-banner.iol.it.http: F 494:494(0)
>ack 156 win 64706 (DF)
>  
>
>_______________________________________________
>FLUG primipassi con Linux - primipassi@firenze.linux.it
>Policy: http://www.firenze.linux.it/primipassi/policy_html
>URL: http://lists.firenze.linux.it/mailman/listinfo/primipassi
>Archivio:  http://lists.firenze.linux.it/pipermail/primipassi/
>Ricerca nell'archivio: http://www.firenze.linux.it/search




Maggiori informazioni sulla lista primipassi