Italiano English
Modifica History Actions

Differenze per "wndw/Capitolo6"

Differenze tra le versioni 21 e 22
Versione 21 del 2006-12-09 20:53:58
Dimensione: 68523
Autore: host-84-220-240-193
Commento:
Versione 22 del 2006-12-10 21:49:51
Dimensione: 69124
Autore: host-84-220-217-238
Commento:
Le cancellazioni sono segnalate in questo modo. Le aggiunte sono segnalate in questo modo.
Linea 161: Linea 161:
Most users are blissfully unaware that their private email, chat conversations, and even passwords are often sent "in the clear" over dozens of untrusted networks before arriving at their ultimate destination on the Internet. However mistaken they may be, users still typically have some expectation of privacy when using computer networks.

Privacy can be achieved, even on untrusted networks such as public access points and the Internet. The only proven effective method for protecting privacy is the use of strong '''''end-to-end encryption'''''.

Encryption techniques such as WEP and WPA attempt to address the privacy issue at layer two, the data-link layer. While this does protect eavesdroppers from listening in on the wireless connection, protection ends at the access point. If the wireless client uses insecure protocols (such as POP or simple SMTP for receiving and sending email), then users beyond the AP can still log the session and see the sensitive data. As mentioned earlier, WEP also suffers from the fact that it uses a shared private key. This means that legitimate wireless users can eavesdrop on each other, since they all know the private key.

By using encryption to the remote end of the connection, users can neatly sidestep the entire problem. These techniques work well even on untrusted public networks, where eavesdroppers are listening and possibly even manipulating data coming from the access point.

To ensure data privacy, good end-to-end encryption should provide the following features:

 * '''''Verified authentication of the remote end'''''. The user should be able to know without a doubt that the remote end is who it claims to be. Without authentication, a user could give sensitive data to anyone claiming to be the legitimate service.
 * '''''Strong encryption methods'''''. The encryption algorithm should stand up to public scrutiny, and it should not be easily decrypted by a third party. There is no security in obscurity, and strong encryption is even stronger when the algorithm is widely known and subject to peer review. A good algorithm with a suitably large and protected key can provide encryption that is unlikely to be broken by any effort in our lifetimes using current technology.
 * '''''Public key cryptography'''''. While not an absolute requirement for end-to-end encryption, the use of public key cryptography instead of a shared key can ensure that an individual user's data remains private, even if the key of another user of the service is compromised. It also solves certain problems with distributing keys to users over untrusted networks.
 * '''''Data encapsulation'''''. A good end-to-end encryption mechanism protects as much data as possible. This can range from encrypting a single email transaction to encapsulation of all IP traffic, including DNS lookups and other supporting protocols. Some encryption tools simply provide a secure channel that other applications can use. This allows users to run any program they like and still have the protection of strong encryption, even if the programs themselves don't support it.

Be aware that laws regarding the use of encryption vary widely from place to place. Some countries treat encryption as munitions, and may require a permit, escrow of private keys, or even prohibit its use altogether. Before implementing any solution that involves encryption, be sure to verify that use of this technology is permitted in your local area.

In the following sections, we'll take a look at some specific tools that can provide good protection for your users' data.
La maggior parte dei utenti sono beatamente ignari del fatto che le loro email, conversazioni di chat e perfino password riservate siano trasmessi spesso ''in chiaro'' in dozzine di reti non protette prima di arrivare alla loro ultima destinazione su Internet. Non ci può essere niente di più errato, tipicamente gli utenti ancora hanno una certa aspettativa di privacy quando usando le reti di computer.

La privacy può essere realizzata, anche su reti non protette come access points pubblici ed Internet. L'unico metodo efficace provato per la protezione della privacy è l'uso di una forte '''''crittografia end-to-end'''''.

Le tecniche di crittografia come WEP e WPA tentano di indirizzare il problema della privacy al secondo strato, lo strato data-link. Mentre questo protegge dagli intercettatori che ascoltano sul collegamento wireless, la protezione finisce all'access points. Se il client wireless usa protocolli insicuri (come POP o semplice SMTP per la ricezione e la trasmissione delle email), allora gli utenti dietro l'AP possono ancora scaricare i dati di sessione e vedere dati sensibili. Come accennato precedentemente, WEP inoltre soffre del fatto di usare una chiave privata condivisa. Questo significa che gli utenti wireless legittimi possono ascoltarsi di nascosto a vicenda, poiché tutti conoscono la chiave privata.

Usando la crittografia alla fine remota del collegamento, gli utenti possono evitare con cura l'intero problema. Queste tecniche funzionano bene anche su reti pubbliche non protette, in cui gli intercettatori stanno ascoltando e possibilmente persino stanno maneggiando i dati che vengono dall'access point.

Per accertare la privacy dei dati, una buona crittografia end-to-end dovrebbe fornire le seguenti caratteristiche:

 * '''''Autenticazione verificata alla fine remota'''''. L'utente dovrebbe sapere senza dubbio che alla fine del collegamento remoto c'è chi sostiene di essere. Senza autenticazione, un utente potrebbe dare dati sensibili a chiunque sostenga essere il servizio legittimo.
 * '''''Metodi di crittografia forte'''''. L'algoritmo di crittografia dovrebbe resistere all'esame accurato pubblico e non dovrebbe essere decifrato facilmente da terzi. Non c'è privacy nell'oscurità e la crittografia forte è ancora più forte quando l'algoritmo è ampiamente conosciuto e conforme alla revisione paritaria. Un buon algoritmo con una chiave adeguatamente grande e protetta può fornire una crittografia difficile da decifrare con qualunque sforzo nel corso della nostra vita usando la tecnologia corrente.
 * '''''Crittografia a chiave pubblica'''''. Sebbene non sia un requisito assoluto della crittografia end-to-end, l'uso della crittografia a chiave pubblica anziché di una chiave condivisa può assicurare che i dati dell'utente specifico rimangano privati, anche se la chiave di un altro utente del servizio viene compromessa. Inoltre risolve determinati problemi con la distribuzione delle chiavi agli utenti sulle reti non protette.
 * '''''Incapsulamento dei dati'''''. Un buon meccanismo end-to-end di crittografia protegge tanti dati quanti ne sia possibile. Ciò può variare dalla cifratura della singola email in una transazione all'incapsulamento di tutto il traffico IP, compreso i lookups DNS ed di altri protocolli supportati. Alcuni strumenti di crittografia forniscono semplicemente un canale sicuro che altre applicazioni possono utilizzare. Ciò permette ad ogni utente di far girare il programma desiderato ed ancora avere la protezione della crittografia forte, anche se i programmi stessi non la supportano.

Siate consci che le leggi che riguardano l'uso della crittografia variano ampiamente da un posto ad un altro. Alcuni paesi trattano la crittografia come un'arma e possono richiedere un permesso, il deposito delle chiavi private, o persino la proibizione del suo uso del tutto. Prima di implementare qualsiasi soluzione che coinvolga la crittografia, verificate che l'uso di questa tecnologia sia consentito nella vostra zona locale.

Nelle seguenti sezioni, daremo un'occhiata ad alcuni strumenti specifici che possono assicurare una buona protezione ai dati dei vostri utenti.


TableOfContents


Sicurezza

In una rete wired tradizionale, il controllo dell'accesso è molto semplice: Se una persona ha accesso fisico ad un calcolatore o hub della rete, allora può usare (o abusase) le risorse della rete. Mentre i meccanismi del software sono una componente importante di sicurezza della rete, limitare l'accesso fisico ai dispositivi della rete è l'ultimo meccanismo di controllo di accesso. Semplicemente, se tutti i terminali e i componenti della rete sono soltanto accessibili agli individui fidati, allora la rete può probabilmente considerarsi fidata.

Le cose cambiano significativamente con le reti wireless. Mentre l'apparente portata del vostro access point può sembrare influire giusto per alcune centinaia di metri, un utente con un' antenna di alto guadagno può potere usare la rete a partire da parecchi isolati di distanza. Se un utente non autorizzato è rilevato, è impossibile semplicemente tracciare il cavo indietro fino alla locazione dell'utente. Senza trasmettere un singolo pacchetto, un utente malintenzionato può persino scaricare il log di tutti i dati della rete sul disco. Questi dati possono più successivamente essere usati per lanciare un attacco più sofisticato contro la rete. Non assumere mai che le onde radio si arrestino semplicemente al limite della vostra proprietà.

Naturalmente, anche nelle reti wired, non è mai sufficientemente possibile fidarsi completamente di tutti gli utenti della rete. Impiegati scontenti, utenti della rete maleducati e semplici errori da parte di utenti onesti possono causare danni significativi al funzionamento della rete. Come progettista di rete, il vostro obiettivo dovrebbe essere di facilitare la comunicazione privata fra gli utenti legittimi della rete. Mentre una determinata quantità di controllo e di autenticazione di accesso è necessaria in tutta la rete, siete venuti a mancare nel vostro compito se gli utenti legittimi trovano difficile usare la rete per comunicare.

Un vecchio detto dice che l'unico modo di proteggere completamente un calcolatore è di disconnetterlo, chiuderlo in una cassaforte, distruggere la chiave e seppellire il tutto con calcestruzzo. Mentre un tal sistema potrebbe essere completamente sicuro, è inutile per la comunicazione. Ricordarsi soprattutto di ciò più che di altro quando prendete decisioni per la sicurezza della vostra rete, la rete esiste proprio per dare la possibilità ai suoi utenti di comunicare fra di loro. Le considerazioni di sicurezza sono importanti, ma non dovrebbero essere intese contro gli utenti della rete.

Sicurezza fisica

Nell'installare una rete, state costruendo un'infrastruttura dalla quale la gente dipenderà. E così, la rete deve essere affidabile. Per molte installazioni, i guasti che si presentano spesso sono dovuti alle manipolazioni umane, accidentali o no. Le reti hanno componenti fisiche, fili e contenitori, cose che possono essere disturbate facilmente. In molte installazioni, la gente non conoscerà le apparecchiature che avete installato, o, la curiosità le condurrà a sperimentare. Non si renderanno conto dell'importanza di un cavo collegato ad una porta. La gente potrebbe spostare un cavo Ethernet in modo da poter collegare il proprio portatile per 5 minuti, o spostare un interruttore per usufruirne. Una spina potrebbe essere rimossa da una sorgente di alimentazione perché qualcuno ha bisogno di quella presa a parete. Assicurare la sicurezza fisica di un'installazione è preminente. Segni ed etichette saranno soltanto utili ai pochi, che possono leggere, o parlare la vostra lingua. Mettere le cose lontane e limitare l'accesso sono il modo migliore per assicurare che gli incidenti, o le riparazioni siano evitate.

In economie meno sviluppate le giuste viti, connessioni elettriche, o contenitori non sono facili da trovare. Dovreste poter trovare rifornimenti elettrici alternativi che funzionano nello stesso modo. Le recinzioni personalizzate sono inoltre facili da produrre e dovrebbero essere considerate essenziali in tutta l'installazione. È spesso economico pagare un muratore per fare i fori ed installare un condotto, dove questa sarebbe un'operazione costosa nel mondo sviluppato, questo tipo di attività a forte utilizzo di mano d'opera può essere acquistabile nei paesi del sud. Il PVC può essere incorporato in pareti di cemento per far passare il cavo da una stanza ad un'altra, evitando fori profondi ogni volta che un cavo deve essere passato. Per isolare, sacchetti di plastica possono essere inseriti nel condotto intorno ai cavi.

Le piccole apparecchiature dovrebbero essere montate sulla parete e le più grandi dovrebbero essere messe in un armadio o in un armadietto.

Interruttori

Gli interruttori, gli hubs o gli access points interni con una presa a parete possono essere avvitati direttamente su una parete. Mettere questa apparecchiatura più alta possibile ridurrà la probabilità che qualcuno tocchi il dispositivo o i suoi cavi.

Cavi

I cavi dovrebbero essere nascosti e fissati. Meglio seppellire i cavi, che lasciarli liberi per una distanza lunga yard, durante le quali potrebbero essere usati per appendere vestiti ad asciugare, o semplicemente annodati ad una scala ecc. Per evitare i parassiti e gli insetti utilizzare un condotto elettrico di plastica. La spesa marginale val bene la pena. Il condotto dovrebbe essere sepolto a circa 30cm di profondità (sotto il gelo nei climi freddi). È inoltre consigliato comprare il più grande condotto disponibile al momento, in modo da poter utilizzare la stessa tubazione anche per i cavi futuri. È anche possibile trovare il condotto di plastica del cavo tra quelli che sono utilizzati per le costruzioni. In caso contrario, si può semplicemente fissare il cavo, inchiodandolo alla parete ed assicurandosi che esso non penda dove può essere annodato, intrappolato o tagliato.

Alimentazione

Tenere le sorgenti di alimentazione chiuse in un armadietto. Se ciò non è possibile, montare la sorgente di alimentazione sotto uno scrittorio, o sulla parete e usare doct tape (gaffer tape, un nastro adesivo forte) per fissare la spina nella presa a parete. Sull'UPS e sulla sorgente di alimentazione, non lasciare le prese a parete vuote, sigillarle se necessario. La gente ha la tendenza ad usare la presa a parete più facilmente raggiungibile, così è necessario rendere queste prese difficili da usare. Se non lo fate, potreste trovare un ventilatore o una luce inserita nella vostra UPS; benchè sia piacevole avere luce, è più piacevole mantenere il funzionamento del vostro server!

Acqua

Proteggere la vostra apparecchiatura da acqua e da umidità. In tutti i casi assicuratevi che la vostra apparecchiatura, compreso la vostra UPS è almeno a 30cm da terra, per evitare un allagamento. Inoltre provare a coprire con un tetto la vostra apparecchiatura, di modo che l'acqua e l'umidità non cadranno su di essa. Nei climi umidi, è importante che l'apparecchiatura abbia una ventilazione adeguata in modo da assicurare che l'umidità si esaurisca. Gli armadietti devono essere ventilati, o l'umidità ed il calore degraderanno o distruggeranno il vostro equipaggiamento.

Tralicci

L'apparecchiatura installata su un traliccio è spesso al sicuro dai ladri. Ciò nonostante, per dissuadere i ladri e mantenere la vostra apparecchiatura al sicuro dal vento è buona regola per un tecnico prendere le massime precauzioni. L'apparecchiatura dovrebbe essere verniciata con un colore opaco, bianco o grigio per riflettere il sole e per renderlo piatto e non interessante allo sguardo. Dovrebbero essere preferite le antenne del pannello che sono molto più sottili e meno interessanti dei dischi. Tutta l'installazione sulle pareti, dovrebbe richiedere una scaletta per raggiungerla. Nella scelta dei posti dove mettere l'apparecchiatura, trovarne di ben illuminati ma non in vista. Inoltre evitare le antenne che assomigliano alle antenne della televisione, perché sono articoli che attrarranno l'interesse dai ladri, dove invece un'antenna di wifi sarà inutile al ladro medio.

Minacce contro la rete

Una differenza sostanziale fra Ethernet e wireless è che le reti wireless sono costruite su un mezzo condiviso. Assomigliano molto di più ai vecchi hubs della rete che ai commutatori moderni, in quanto ogni calcolatore connesso alla rete può vedere il traffico di ogni altro utente. Per controllare tutto il traffico della rete su un punto di accesso, ci si può sintonizzare semplicemente al canale che si sta usando, mettere la scheda della rete nella modalità per monitorare ed eseguire il log di ogni dato. Questi dati potrebbero essere direttamente utili ad un intercettatore (inclusi dati come email, dati voce, o logs di chat online). Possono anche contenere passwords ed altri dati sensibili, contribuendo a compromettere ancora ulteriormente la rete. Come vedremo più avanti in questo capitolo, questo problema può diminuire mediante l'uso della crittografia.

Un altro problema serio con le reti wireless è che i suoi utenti sono relativamente anonimi. Mentre è vero che ogni dispositivo wireless include un indirizzo MAC univoco che è dato dal fornitore, questi indirizzi possono essere cambiati spesso con un software. Anche con l'indirizzo MAC, può essere molto difficile stabilire dove un utente wireless sia localizzato fisicamente. l'influenza in più direzioni, le antenne di alto guadagno e le ampie variazioni delle caratteristiche della radiotrasmittente possono rendere impossibile determinare se un utente wireless malintenzionato sia seduto nella stanza accanto o è in un appartamento di un palazzo lontano un miglio.

Mentre lo spettro non autorizzato fornisce un enorme riduzione dei costi dell'utente, esso ha lo sfavorevole effetto secondario degli attacchi denial of service (DoS) che sono banalmente semplici. Semplicemente girando su un access point ad alta potenza, un telefono cordless, un trasmettitore video, o altro dispositivo 2.4GHz, una persona malintenzionata potrebbe causare problemi significativi sulla rete. Molti dispositivi della rete sono vulnerabili ad altre forme di attacchi denial of service, di tipo per esempio disassociation flooding e overflows della tabella ARP.

Vi sono parecchie categorie di individui che possono causare i problemi su una rete wireless:

  • Utente involontario. Poichè la maggior parte delle reti wireless sono installate nelle zone densamente popolate, è comune per gli utenti di un portatile collegarsi casualmente alla rete errata. La maggior parte dei client wireless sceglieranno semplicemente ogni rete wireless disponibile quando la loro rete preferita non è disponibile. L'utente può allora usare questa rete come di consueto, completamente ignaro di trasmettere dati sensibili a qualcun'altro della rete. La gente malintenzionata può persino approfittare di questo installando gli access points in posizioni strategiche, per provare ad attrarre utenti inconsapevoli e per catturare i loro dati. Il primo punto per evitare questo problema sta nell'istruire i vostri utenti e sta nel sollecitare l'importanza di collegamento soltanto alle reti conosciute e fidate. Molti clients wireless possono essere configurati per collegarsi soltanto alle reti fidate, o per chiedere il permesso prima di collegarsi ad una nuova rete. Come vedremo più avanti in questo capitolo, gli utenti possono collegarsi in maniera sicura a reti aperte pubbliche usando la crittografia forte.

  • War drivers. Il fenomeno "war driving" deve il suo nome al popolare film hacker del 1983, "War Games". I war drivers sono interessati all'individuazione dell'ubicazione fisica delle reti wireless. Tipicamente girano in automobile con un portatile, un GPS e un'antenna omnidirezionale, annotando nome e posizione geografica di tutte le reti che trovano. Questi dati sono poi uniti ad altri dati di altri war drivers e sono trasformati in mappe grafiche che descrivono "l'impronta" wireless di una particolare città.

    La maggior parte dei war drivers probabilmente non propone minaccia diretta alle reti, ma i dati che raccolgono potrebbero essere di interesse a cracker della rete. Per esempio, potrebbe essere evidente che un access point non protetto rilevato da un war driver sia situato all'interno di un palazzo riservato, quali un governo o un ufficio corporativo. Una persona malintenzionata potrebbe usare queste informazioni per accedere illegalmente alla rete. Senza dubbio, in primo luogo un tale AP non dovrebbe essere mai installato, ma il war driving rende il problema ancora più grave. Come vedremo più avanti in questo capitolo, i war drivers che usano il popolare programma NetStumbler possono essere rilevati con i programmi quale Kismet. Per più informazioni sui war driving, vedere link come http://www.wifimaps.com/, http://www.nodedb.com/, o http://www.netstumbler.com/ .

  • Rogue access points. There are two general classes of rogue access points: those incorrectly installed by legitimate users, and those installed by malicious people who intend to collect data or do harm to the network. In the simplest case, a legitimate network user may want better wireless coverage in their office, or they might find security restrictions on the corporate wireless network too difficult to comply with. By installing an inexpensive consumer access point without permission, the user opens the entire network up to potential attacks from the inside. While it is possible to scan for unauthorized access points on your wired network, setting a clear policy that prohibits them is very important. The second class of rogue access point can be very difficult to deal with. By installing a high powered AP that uses the same ESSID as an existing network, a malicious person can trick people into using their equipment, and log or even manipulate all data that passes through it. Again, if your users are trained to use strong encryption, this problem is significantly reduced.

  • Intercettatore. Come accennato prima, l'intercettazione sulle reti wireless è un problema molto difficile da risolvere. Usando uno strumento di monitoraggio passivo (come Kismet), un intercettatore può scaricare tutti i dati della rete da una distanza grande, senza mai far rilevare la sua presenza. I dati con una debole cifratura possono essere scaricati e decifrati semplicemente più tardi, mentre i dati non cifrati possono essere letti facilmente in tempo reale.

    Se avete difficoltà a convincere gi altri di questo problema, potreste mostrare loro strumenti come Etherpeg (http://www.etherpeg.org/) o Driftnet (http://www.ex-parrot.com/~chris/driftnet/). Questi strumenti rappresentano una rete wireless con dati grafici, mediante file JPEG e GIF. Mentre gli altri utenti stanno navigando in Internet, questi stumenti visualizzano semplicemente tutti i grafici trovati in un unico collage grafico. L'utilizzo frequente di strumenti come questo sono la dimostrazione di quanto si dice sulla sicurezza wireless. Mentre potete dire ad un utente che la loro email è vulnerabile senza crittografia, niente raggiunge lo scopo meglio di mostrare loro le immagini di ciò che stanno guardando quando navigano con il loro web browser. Di nuovo, anche se non può completamente essere evitata, un'adeguata applicazione della crittografia forte scoraggerà l'intercettatore.

Questa introduzione vuole darti un'idea dei problemi a cui state andando incontro quando progettate una rete wireless. Più avanti in questo capitolo, parleremo degli strumenti e delle tecniche che vi aiuteranno a diminuire questi problemi.

Autenticazione

Prima dell'assegnazione dell'accesso alle risorse della rete, gli utenti dovrebbero in primo luogo essere autenticati. In un mondo ideale, ogni utente wireless avrebbe un identificativo che è unico, non cambiabile e non può usabile da altri utenti. Questo è un problema molto difficile da risolvere nel mondo reale.

La prima utilità che abbiamo come unico identificativo è l'indirizzo MAC. Questo è un numero a 48 bit assegnato dal fornitore ad ogni dispositivo wireless e Ethernet. Impiegando il filtro mac sui nostri access points, possiamo autenticare gli utenti in base al loro indirizzo MAC. Con questa caratteristica, l'access point mantiene una tabella interna di indirizzi MAC autorizzati. Quando un utente wireless prova ad associarsi ad un access point, l'indirizzo MAC del client deve essere sulla lista autorizzata, o l'associazione sarà negata. Alternativamente, l'AP può mantenere una tabella di indirizzi MAC dannosi conosciuti, e consentire tutti i dispositivi che non sono sulla lista.

Purtroppo, questo non è il meccanismo ideale di sicurezza. Mantenere tabelle MAC su ogni dispositivo può essere scomodo, richiedendo che tutti i dispositivi client abbiano i loro indirizzi MAC registrati ed aggiornati sugli APs. Ancora peggio, spessogli indirizzi MAC possono essere cambiati con un software. Osservando gli indirizzi MAC in uso su una rete wireless, un aggressore risoluto può eseguire uno spoofing di un indirizzo MAC approvato e connettersi con successo all'AP. Mentre il filtro MAC eviterà gli utenti involontari e perfino la maggior parte dei individui curiosi dall'accesso alla rete, il filtro MAC da solo non può impedire gli attacchi degli aggressori risoluti.

I filtri MAC sono utili per limitare temporaneamente l'accesso dei client maleducati. Per esempio, se un portatile ha un virus che trasmette grandi quantità di spam o altro traffico, il suo indirizzo MAC può essere aggiunto alla tabella del filtro per arrestare immediatamente il traffico. Questo vi darà tempo di rintracciare l'utente e di risolvere il problema.

Un'altra popolare utilità di autenticazione wireless è quella chiamata rete chiusa. In una rete tipica, gli APs trasmetteranno in browcast il loro ESSID molte volte al secondo, permettendo che i client wireless (così come gli strumenti come NetStumbler) trovino la rete e visualizzino la sua presenza all'utente. In una rete chiusa, l'AP non segnala l'ESSID e gli utenti devono conoscere il nome completo della rete prima che l'AP permetta l'associazione. Ciò impedisce agli utenti casuali di scoprire la rete e di selezionarla nel loro client wireless.

Ci sono un certo numero di svantaggi in questa utilità. Forzare gli utenti a digitare il completo ESSID prima del collegamento alla rete induce all'errore e spesso conduce a sostenere chiamate e reclami. Poiché la rete non è ovviamente rilevabile da strumenti di indagine come NetStumbler, questo può impedire che la vostra rete sia mostrata sulle mappe dei war drivers. Ma significa anche che altri installatori di rete non possano trovarla facilmente e specificamente non sapranno che voi già state utilizzando una dato canale. Un vicino coscienzioso può effettuare un'indagine del luogo, non vedere reti vicine ed installare la sua propria rete sullo stesso canale che state utilizzando. Ciò causerà problemi di interferenza ad entrambi voi ed il vostro vicino.

Per concludere, usare le reti chiuse alla fine aggiunge poco alla vostra sicurezza generale delle reti. Usando strumenti di monitoraggio passivi (quale Kismet), un utente esperto può rilevare i pacchetti trasmessi dai vostri client leciti all'AP. Questi pacchetti necessariamente contengono il nome della rete. Un utente malintenzionato può allora usare questo nome per associarsi all'access point, proprio come un utente normale.

La crittografia è probabilmente il miglior strumento che abbiamo per autenticare gli utenti wireless. Con la crittografia forte, possiamo identificare univocamente un utente in modo che è molto difficile ingannarlo e usare quell'identità per determinare un ulteriore accesso alla rete. La crittografia inoltre ha il beneficio di aggiungere uno strato di privacy impedendo agli intercettatori di accedere facilmente al traffico di rete.

Il metodo di crittografia più ampiamente impiegato sulle reti wireless è la crittografia WEP. WEP corrisponde a wired equivalent privacy ed è supportato virtualmente da tutta le apparecchiature 802.11a/b/g. WEP usa una chiave condivisa di 40 bit per cifrare i dati fra l'access point e il client. La chiave deve essere inserita sull'APs così come su ciascuno dei clients. Con WEP abiliato, i clients wireless non possono collegarsi con l'AP fino a che non useranno la chiave corretta. Un intercettatore che ascolta una rete abilitata WEP vedrà ancora il traffico e gli indirizzi del MAC, ma il contenuto dei dati di ogni pacchetto è cifrato. Ciò fornisce un meccanismo ragionevolmente buono di autenticazione aggiungendo inoltre un po' di privacy alla rete.

WEP non è definitivamente la migliore soluzione di crittografia forte disponibile. Per prima cosa, la chiave di WEP è condivisa fra tutti gli utenti. Se la chiave è scoperta (diciamo, se un utente dice ad un amico qual'è la password, o un impiegato se ne va) allora cambiare la password può essere proibitivamente difficile, poiché tutti i APs e i dispositivi del client devono essere cambiati. Ciò inoltre significa che gli utenti leciti della rete possono tranquillamente intercettare il traffico di tutti gli altri, poiché tutti conoscono la chiave condivisa.

La chiave stessa spesso è scelta male, rendendo fattibili i tentativi offline di crack. Ancora peggio, l'implementazione di WEP stessa non è funzionante in molte implementazioni, rendendo ancora più facile eseguire il crack su alcune reti. Mentre i fornitori hanno implementato un certo numero di estensioni a WEP (come quelle con le chiavi più lunghe e gli schemi veloci di rotazione), queste estensioni non fanno parte degli standard e non c'è interoperabilità fra apparecchiature di fornitori differenti. Aggiornando tutti i vostri dispositivi wireless con i firmware più recenti, potete impedire alcuni degli attacchi iniziali trovati in WEP.

WEP può ancora essere uno strumento utile di autenticazione. Assumendo che i vostri utenti siano fidati e non diano ad altri la password, voi potete essere ragionevolmente certi che i vostri clients wireless siano al sicuro. Anche se il craking del WEP è possibile, è al di là dell'abilità della maggior parte dei utenti. WEP è estremamente utile per la sicurezza dei collegamenti interurbani Punto-a-Punto, anche sulle reti generalmente aperte. Usando WEP su un tal collegamento, scoraggerete altri all'associazione al collegamento e probabilmente useranno preferibilmente altri APs disponibili. WEP è definitivamente un pratico segnale di stare alla larga dalla vostra rete. Chiunque rilevi la rete vedrà che è richiesta una chiave, indicando chiaramente che non sono benvenuti ad usarla.

La forza più grande degli WEPs è la loro interoperabilità. Per aderire agli standard, tutti i dispositivi wireless supportano WEP base. Mentre non è il metodo più sicuro disponibile, è certamente l'utilità più comunemente implementata. Analizzeremo più avanti altre tecniche più avanzate di crittografia in questo capitolo.

Per maggiori particolari circa lo stato della crittografia di WEP, vedere questi contenuti:

Un altro protocollo di autenticazione di strato di data link è il Wi-Fi Protected Access, o WPA. WPA è stato creato specificamente per occuparsi dei problemi WEP conosciuti accennati precedentemente. Fornisce uno schema significativamente più forte di crittografia e può usare una chiave privata condivisa, chiavi uniche assegnate ad ogni utente, o persino certificati SSL per autenticare sia il client che il suo access point. Le credenziali di autenticazione sono controllate usando il protocollo 802.1X, che può consultare una base dati di terze parti come RADIUS. Con l'uso del Temporal Key Integrity Protocol (TKIP), le chiavi possono essere ruotate rapidamente col tempo, riducendo ulteriormente la probabilità che una sessione particolare possa essere sottoposta a crack. In generale, WPA fornisce autenticazione e privacy significativamente migliori dello WEP standard.

La difficoltà con WPA è che, come in questo scritto, l'interoperabilità fra fornitori è ancora molto bassa. WPA richiede hardware dell'access point piuttosto recenti e firmware aggiornati su tutti i client wireless, così come un lavoro notevole di configurazione. Se state installando una rete in un'ambiente in cui controllate l'intera piattaforma hardware, WPA può essere ideale. Autenticare sia client che APs, risolve il problema dell'access point del rogue e fornisce molti vantaggi significativi rispetto al WEP. Ma nella maggior parte degli ambienti della rete in cui l'hardware è piuttosto vecchio e la conoscenza degli utenti wireless è limitata, l'installazione di un WPA può essere un incubo. È per questo motivo che se la crittografia non è usata affatto, la maggior parte dei siti continuano ad usare WEP.

Captive portals

Uno dei più comuni strumenti di autenticazione utilizzati sulle reti wireless è il captive portal. Un captive portal usa un web browser standard per dare ad un utente wireless l'occasione di presentare le credenziali al momento del login. Può anche essere usato per presentare le informazioni (come un Acceptable Use Policy) all'utente prima di concedere l'accesso remoto. Usando un web browser anziché un programma personalizzato per l'autenticazione, i captive portals funzionano virtualmente con tutti i portatili e sistemi operativi. I captive portals sono usati tipicamente sulle reti aperte senza altri metodi di autenticazione (quali i filtri WEP o MAC).

Per cominciare, un utente wireless apre il suo portatile e seleziona la rete. Il suo computer chiede un DHCP lease, che è assegnato. Dopo di che può usare il suo web browser per andare in tutti i siti su Internet.

http://wiki.wndw.net/images/figures/en/figure-6.1.png

Figura 6.1: L'utente richiede una pagina web ed è reindirizzato.

Invece di ricevere la pagina richiesta, all'utente è presentata una videata di login. Questa pagina può richiedere all'utente di digitare un nome e una password, di cliccare semplicemente su un bottone di login, di digitare i numeri di un ticket prepagato, o di immettere tutte le altre credenziali che gli amministratori della rete richiedono. L'utente allora immette le sue credenziali, che sono controllate dall'access point o da un altro server sulla rete. Ogni accesso alla rete è bloccato fino a quando non si verificano queste credenziali.

http://wiki.wndw.net/images/figures/en/figure-6.2.png

Figura 6.2: Le credenziali dell'utente sono verificate prima che accesso di rete remoto sia assegnato. Il server di autenticazione può essere l'accesss point stesso, un'altra macchina sulla rete locale, o un server dovunque su Internet.

Una volta autenticato, all'utente è permesso di accedere alle risorse della rete e tipicamente è reindirizzato al sito originalmente richiesto.

http://wiki.wndw.net/images/figures/en/figure-6.3.png

Figura 6.3: Dopo l'autenticazone, all'utente è consentito di accedere al resto della rete.

I captive portals non forniscono crittografia agli utenti wireless, ma invece si può contare sugli indirizzi MAC e IP del client come unico identificatore. Poiché questo non è necessariamente molto sicuro, molte implementazioni richiederanno all'utente di autenticarsi nuovamente periodicamente. Ciò può essere fatto spesso automaticamente minimizzando una finestra speciale di pop-up nel browser quando l'utente entra la prima volta.

Poiché non forniscono crittografia forte, i captive portals non sono una scelta molto buona per le reti che hanno bisogno di essere bloccate per permettere soltanto l'accesso agli utenti fidati. Sono molto più adatti ai caffè, agli hotel e ad altre posizioni pubbliche di accesso dove sono previsti solo utenti casuali nella rete.

Negli ambiente pubblici o semi-pubblici di rete , le tecniche di crittografia quale WEP e WPA sono del tutto inutili. Non c'è un modo semplice di distribuire le chiavi pubbliche o condivise a membri di un grande pubblico senza compromettere la sicurezza di quelle chiavi. In questi ambienti, un'applicazione semplice come un captive portal fornisce un livello intermedio di servizio fra il completamente aperto e il completamente chiuso.

Due popolari implementazioni di captive portal open source sono NoCatSplash e Chillispot.

NoCatSplash

Se dovete fornire semplicemente agli utenti una rete aperta con informazioni e un accettabile uso della policy, date un'occhiata a NoCatSplash. È accessibile online al link http://nocat.net/download/NoCatSplash/ .

NoCatSplash fornisce ai vostri utenti una schermata personalizzabile di caricamento, richiedendo loro di cliccare un bottone login prima di usare la rete. Ciò è utile per identificare gli operatori della rete e visualizzare le regole per l'accesso di rete.

NoCatSplash è scritto in C e funzionerà su quasi ogni sistema operativo Unix compreso Linux, BSD e perfino piattaforme embedded come OpenWRT. Ha un semplice file di configurazione e può fornire ogni file HTML personalizzato come schermata di caricamento. Tipicamente funziona direttamente sull'access point, ma può anche lavorare su un router o su un proxy server. Per più informazioni, vedere http://nocat.net/ .

Altri popolari progetti hotspot

NoCatSplash is just one simple captive portal implementation. Many other free implementations exist that support a diverse range of functionality. Some of these include:

  • Chillispot (http://www.chillispot.org/). Chillispot is a captive portal designed to authenticate against an existing user credentials database, such as RADUIS. Combined with the application phpMyPrePaid, pre-paid ticket based authentication can be implemented very easily You can download phpMyPrePaid from http://sourceforge.net/projects/phpmyprepaid/.

  • WiFi Dog (http://www.wifidog.org/). WiFi Dog provides a very complete captive portal authentication package in very little space (typically under 30kb). From a user's perspective, it requires no pop-up or javascript support, allowing it to work on a wider variety of wireless devices.

  • m0n0wall (http://m0n0.ch/wall/). As mentioned in chapter five, m0n0wall is a complete embedded operating system based on FreeBSD. It includes a captive portal with RADIUS support, as well as a PHP web server.

Privacy

La maggior parte dei utenti sono beatamente ignari del fatto che le loro email, conversazioni di chat e perfino password riservate siano trasmessi spesso in chiaro in dozzine di reti non protette prima di arrivare alla loro ultima destinazione su Internet. Non ci può essere niente di più errato, tipicamente gli utenti ancora hanno una certa aspettativa di privacy quando usando le reti di computer.

La privacy può essere realizzata, anche su reti non protette come access points pubblici ed Internet. L'unico metodo efficace provato per la protezione della privacy è l'uso di una forte crittografia end-to-end.

Le tecniche di crittografia come WEP e WPA tentano di indirizzare il problema della privacy al secondo strato, lo strato data-link. Mentre questo protegge dagli intercettatori che ascoltano sul collegamento wireless, la protezione finisce all'access points. Se il client wireless usa protocolli insicuri (come POP o semplice SMTP per la ricezione e la trasmissione delle email), allora gli utenti dietro l'AP possono ancora scaricare i dati di sessione e vedere dati sensibili. Come accennato precedentemente, WEP inoltre soffre del fatto di usare una chiave privata condivisa. Questo significa che gli utenti wireless legittimi possono ascoltarsi di nascosto a vicenda, poiché tutti conoscono la chiave privata.

Usando la crittografia alla fine remota del collegamento, gli utenti possono evitare con cura l'intero problema. Queste tecniche funzionano bene anche su reti pubbliche non protette, in cui gli intercettatori stanno ascoltando e possibilmente persino stanno maneggiando i dati che vengono dall'access point.

Per accertare la privacy dei dati, una buona crittografia end-to-end dovrebbe fornire le seguenti caratteristiche:

  • Autenticazione verificata alla fine remota. L'utente dovrebbe sapere senza dubbio che alla fine del collegamento remoto c'è chi sostiene di essere. Senza autenticazione, un utente potrebbe dare dati sensibili a chiunque sostenga essere il servizio legittimo.

  • Metodi di crittografia forte. L'algoritmo di crittografia dovrebbe resistere all'esame accurato pubblico e non dovrebbe essere decifrato facilmente da terzi. Non c'è privacy nell'oscurità e la crittografia forte è ancora più forte quando l'algoritmo è ampiamente conosciuto e conforme alla revisione paritaria. Un buon algoritmo con una chiave adeguatamente grande e protetta può fornire una crittografia difficile da decifrare con qualunque sforzo nel corso della nostra vita usando la tecnologia corrente.

  • Crittografia a chiave pubblica. Sebbene non sia un requisito assoluto della crittografia end-to-end, l'uso della crittografia a chiave pubblica anziché di una chiave condivisa può assicurare che i dati dell'utente specifico rimangano privati, anche se la chiave di un altro utente del servizio viene compromessa. Inoltre risolve determinati problemi con la distribuzione delle chiavi agli utenti sulle reti non protette.

  • Incapsulamento dei dati. Un buon meccanismo end-to-end di crittografia protegge tanti dati quanti ne sia possibile. Ciò può variare dalla cifratura della singola email in una transazione all'incapsulamento di tutto il traffico IP, compreso i lookups DNS ed di altri protocolli supportati. Alcuni strumenti di crittografia forniscono semplicemente un canale sicuro che altre applicazioni possono utilizzare. Ciò permette ad ogni utente di far girare il programma desiderato ed ancora avere la protezione della crittografia forte, anche se i programmi stessi non la supportano.

Siate consci che le leggi che riguardano l'uso della crittografia variano ampiamente da un posto ad un altro. Alcuni paesi trattano la crittografia come un'arma e possono richiedere un permesso, il deposito delle chiavi private, o persino la proibizione del suo uso del tutto. Prima di implementare qualsiasi soluzione che coinvolga la crittografia, verificate che l'uso di questa tecnologia sia consentito nella vostra zona locale.

Nelle seguenti sezioni, daremo un'occhiata ad alcuni strumenti specifici che possono assicurare una buona protezione ai dati dei vostri utenti.

SSL

The most widely available end-to-end encryption technology is Secure Sockets Layer, known simply as SSL. Built into virtually all web browsers, SSL uses public key cryptography and a trusted public key infrastructure (PKI) to secure data communications on the web. Whenever you visit a web URL that starts with https, you are using SSL.

The SSL implementation built into web browsers includes a collection of certificates from trusted sources, called certificate authorities (CA). These certificates are cryptographic keys that are used to verify the authenticity of websites. When you browse to a website that uses SSL, the browser and the server first exchange certificates. The browser then verifies that the certificate provided by the server matches its DNS host name, that it has not expired, and that it is signed by a trusted certificate authority. The server optionally verifies the identity of the browser's certificate. If the certificates are approved, the browser and server then negotiate a master session key using the previously exchanged certificates to protect it. That key is then used to encrypt all communications until the browser disconnects. This kind of data encapsulation is known as a tunnel.

http://wiki.wndw.net/images/figures/en/figure-6.4.png

Figure 6.4: Eavesdroppers must break strong encryption to monitor traffic over an encrypted tunnel. The conversation inside the tunnel is identical to any other unencrypted conversation.

The use of certificates with a PKI not only protects the communication from eavesdroppers, but prevents so-called man-in-the-middle (MITM) attacks. In a man-in-the-middle attack, a malicious user intercepts all communication between the browser and the server. By presenting bogus certificates to both the browser and the server, the malicious user could carry on two simultaneous encrypted sessions. Since the malicious user knows the secret on both connections, it is trivial to observe and manipulate data passing between the server and the browser.

http://wiki.wndw.net/images/figures/en/figure-6.5.png

Figure 6.5: The man-in-the-middle effectively controls everything the user sees, and can record and manipulate all traffic. Without a public key infrastructure to verify the authenticity of keys, strong encryption alone cannot protect against this kind of attack.

Use of a good PKI prevents this kind of attack. In order to be successful, the malicious user would have to present a certificate to the client that is signed by a trusted certificate authority. Unless a CA has been compromised (very unlikely) or the user can be tricked into accepting the bogus certificate, then such an attack is not possible. This is why it is vitally important that users understand that ignoring warnings about expired or bogus certificates is very dangerous, especially when using wireless networks. By clicking the "ignore" button when prompted by their browser, users open themselves up to many potential attacks.

SSL is not only used for web browsing. Insecure email protocols such as IMAP, POP, and SMTP can be secured by wrapping them in an SSL tunnel. Most modern email clients support IMAPS and POPS (secure IMAP and POP) as well as SSL/TLS protected SMTP. If your email server does not provide SSL support, you can still secure it with SSL using a package like Stunnel (http://www.stunnel.org/). SSL can be used to effectively secure just about any service that runs over TCP.

SSH

Most people think of SSH as a secure replacement for telnet, just as scp and sftp are the secure counterparts of rcp and ftp. But SSH is much more than encrypted remote shell. Like SSL, it uses strong public key cryptography to verify the remote server and encrypt data. Instead of a PKI, it uses a key fingerprint cache that is checked before a connection is permitted. It can use passwords, public keys, or other methods for user authentication.

Many people do not know that SSH can also act as a general purpose encrypting tunnel, or even an encrypting web proxy. By first establishing an SSH connection to a trusted location near (or even on) a remote server, insecure protocols can be protected from eavesdropping and attack.

While this technique may be a bit advanced for many users, network architects can use SSH to encrypt traffic across untrusted links, such as wireless point-to-point links. Since the tools are freely available and run over standard TCP, any educated user can implement SSH connections for themselves, providing their own end-to-end encryption without administrator intervention.

OpenSSH (http://openssh.org/) is probably the most popular implementation on Unix-like platforms. Free implementations such as Putty (http://www.putty.nl/) and WinSCP (http://winscp.net/) are available for Windows. OpenSSH will also run on Windows under the Cygwin package (http://www.cygwin.com/). These examples will assume that you are using a recent version of OpenSSH.

To establish an encrypted tunnel from a port on the local machine to a port on the remote side, use the -L switch. For example, suppose you want to forward web proxy traffic over an encrypted link to the squid server at squid.example.net. Forward port 3128 (the default proxy port) using this command:

ssh -fN -g -L3128:squid.example.net:3128 squid.example.net

The -fN switches instruct ssh to fork into the background after connecting. The -g switch allows other users on your local segment to connect to the local machine and use it for encryption over the untrusted link. OpenSSH will use a public key for authentication if you have set one up, or it will prompt you for your password on the remote side. You can then configure your web browser to connect to localhost port 3128 as its web proxy service. All web traffic will then be encrypted before transmission to the remote side.

http://wiki.wndw.net/images/figures/en/figure-6.6.png

Figure 6.6: The SSH tunnel protects web traffic up to the SSH server itself.

SSH can also act as a dynamic SOCKS4 or SOCKS5 proxy. This allows you to create an encrypting web proxy, without the need to set up squid. Note that this is not a caching proxy; it simply encrypts all traffic.

ssh -fN -D 8080 remote.example.net

Configure your web browser to use SOCKS4 or SOCKS5 on local port 8080, and away you go.

SSH can encrypt data on any TCP port, including ports used for email. It can even compress the data along the way, which can decrease latency on low capacity links.

ssh -fNCg -L110:localhost:110 -L25:localhost:25 mailhost.example.net

The -C switch turns on compression. You can add as many port forwarding rules as you like by specifying the -L switch multiple times. Note that in order to bind to a local port less than 1024, you must have root privileges on the local machine.

These are just a few examples of the flexibility of SSH. By implementing public keys and using the ssh forwarding agent, you can automate the creation of encrypted tunnels throughout your wireless network, and protect your communications with strong encryption and authentication.

OpenVPN

OpenVPN is a free, open source VPN implementation built on SSL encryption. There are OpenVPN client implementations for a wide range of operating systems, including Linux, Windows 2000/XP and higher, OpenBSD, FreeBSD, NetBSD, Mac OS X, and Solaris. Being a VPN, it encapsulates all traffic (including DNS and all other protocols) in an encrypted tunnel, not just a single TCP port. Most people find it considerably easier to understand and configure than IPSEC.

OpenVPN also has some disadvantages, such as fairly high latency. Some amount of latency is unavoidable since all encryption/decryption is done in user space, but using relatively new computers on either end of the tunnel can minimize this. While it can use traditional shared keys, OpenVPN really shines when used with SSL certificates and a certificate authority. OpenVPN has many advantages that make it a good option for providing end-to-end security.

  • It is based on a proven, robust encryption protocol (SSL and RSA)
  • It is relatively easy to configure
  • It functions across many different platforms
  • It is well documented
  • It's free and open source.

Like SSH and SSL, OpenVPN needs to connect to a single TCP port on the remote side. Once established, it can encapsulate all data down to the Networking layer, or even down to the Data-Link layer, if your solution requires it. You can use it to create robust VPN connections between individual machines, or simply use it to connect network routers over untrusted wireless networks.

VPN technology is a complex field, and is a bit beyond the scope of this section. It is important to understand how VPNs fit into the structure of your network in order to provide the best possible protection without opening up your organization to unintentional problems. There are many good on-line resources that deal with installing OpenVPN on a server and client, I recommend this article from Linux Journal: http://www.linuxjournal.com/article/7949 as well as the official HOWTO: http://openvpn.net/howto.html

Tor & Anonymizers

The Internet is basically an open network based on trust. When you connect to a web server across the Internet, your traffic passes through many different routers, owned by a great variety of institutions, corporations and individuals. In principle, any one of these routers has the ability to look closely at your data, seeing as a minimum the source and destination addresses, and quite often also the actual content of the data. Even if your data is encrypted using a secure protocol, it is possible for your Internet provider to monitor the amount of data and the source and destination of that data. Often this is enough to piece together a fairly complete picture of your activities on-line.

Privacy and anonymity are important, and closely linked to each other. There are many valid reasons to consider protecting your privacy by anonymizing your network traffic. Suppose you want to offer Internet connectivity to your local community by setting up a number of access points for people to connect to. Whether you charge them for their access or not, there is always the risk that people use the network for something that is not legal in your country or region. You could plead with the legal system that this particular illegal action was not performed by yourself, but could have been performed by anyone connecting to your network. The problem is neatly sidestepped if it were technically infeasible to determine where your traffic was actually headed. And what about on-line censorship? Publishing web pages anonymously may also be necessary to avoid government censorship.

There are tools that allow you to anonymize your traffic in relatively easy ways. The combination of Tor (http://tor.eff.org/) and Privoxy (http://www.privoxy.org/) is a powerful way to run a local proxy server that will pass your Internet traffic through a number of servers all across the net, making it very difficult to follow the trail of information. Tor can be run on a local PC, under Microsoft Windows, Mac OSX, Linux and a variety of BSD's, where it anonymizes traffic from the browser on that particular machine. Tor and Privoxy can also be installed on a gateway server, or even a small embedded access point (such as a Linksys WRT54G) where they provides anonymity to all network users automatically.

Tor works by repeatedly bouncing your TCP connections across a number of servers spread throughout the Internet, and by wrapping routing information in a number of encrypted layers (hence the term onion routing), that get peeled off as the packet moves across the network. This means that, at any given point in the network, the source and destination addresses cannot be linked together. This makes traffic analysis extremely difficult.

The need for the Privoxy privacy proxy in connection with Tor is due to the fact that name server queries (DNS queries) in most cases are not passed through the proxy server, and someone analyzing your traffic would easily be able to see that you were trying to reach a specific site (say google.com) by the fact that you sent a DNS query to translate google.com to the appropriate IP address. Privoxy connects to Tor as a SOCKS4a proxy, which uses hostnames (not IP addresses) to get your packets to the intended destination.

In other words, using Privoxy with Tor is a simple and effective way to prevent traffic analysis from linking your IP address with the services you use online. Combined with secure, encrypted protocols (such as those we have seen in this chapter), Tor and Privoxy provide a high level of anonymity on the Internet.

Monitoring

Computer networks (and wireless networks in particular) are incredibly entertaining and useful inventions. Except, of course, when they don't work. Your users may complain that the network is "slow" or "broken", but what does that really mean? Without insight into what is actually happening, administering a network can be very frustrating.

In order to be an effective network administrator, you need access to tools that show you exactly what is happening on your network. There are several different classes of monitoring tools. Each shows you a different aspect of what is "going on", from the physical radio interaction all the way to how user applications interact with each other. By watching how the network performs over time, you can get an idea of what is "normal" for your network, and even be notified automatically when things seem to be out of the ordinary. The tools listed in this section are all quite powerful, and are freely available for download from the sources listed.

Network detection

The simplest wireless monitoring tools simply provide a list of available networks, along with basic information (such as signal strength and channel). They let you quickly detect nearby networks and determine if they are in range or are causing interference.

  • The built-in client. All modern operating systems provide built-in support for wireless networking. This typically includes the ability to scan for available networks, allowing the user to choose a network from a list. While virtually all wireless devices are guaranteed to have a simple scanning utility, functionality can vary widely between implementations. These tools are typically only useful for configuring a computer in a home or office setting. They tend to provide little information apart from network names and the available signal to the access point currently in use.

  • Netstumbler (http://www.netstumbler.com/). This is the most popular tool for detecting wireless networks using Microsoft Windows. It supports a variety of wireless cards, and is very easy to use. It will detect open and encrypted networks, but cannot detect "closed" wireless networks. It also features a signal/noise meter that plots radio receiver data as a graph over time. It also integrates with a variety of GPS devices, for logging precise location and signal strength information. This makes Netstumbler a handy tool to have for an informal site survey.

  • Ministumbler (http://www.netstumbler.com/). From the makers of Netstumbler, Ministumbler provides much of the same functionality as the Windows version, but works on the Pocket PC platform. Ministumbler is handy to run on a handheld PDA with a wireless card for detecting access points in the field.

  • Macstumbler (http://www.macstumbler.com/). While not directly related to the Netstumbler, Macstumbler provides much of the same functionality but for the Mac OS X platform. It works with all Apple Airport cards.

  • Wellenreiter (http://www.wellenreiter.net/). Wellenreiter is a nice graphical wireless network detector for Linux. It requires Perl and GTK, and supports Prism2, Lucent, and Cisco wireless cards.

Protocol analyzers

Network protocol analyzers provide a great deal of detail about information flowing through a network, by allowing you to inspect individual packets. For wired networks, you can inspect packets at the data-link layer or above. For wireless networks, you can inspect information all the way down to individual 802.11 frames. Here are several popular (and free) network protocol analyzers:

  • Ethereal (http://www.ethereal.com/). Ethereal is probably the most popular protocol analyzer available. It works with Linux, Windows, Mac OS X, and the various BSD systems. Ethereal will capture packets directly "from the wire" and display them in an intuitive graphical interface. It can decode over 750 different protocols, everything from 802.11 frames to HTTP packets. It will reassemble fragmented packets and follow entire TCP sessions easily, even if other data has broken up the sample. Ethereal is very valuable for troubleshooting tricky network problems, and figuring out exactly what is happening when two computers converse "on the wire".

  • Kismet (http://www.kismetwireless.net/). Kismet is a powerful wireless protocol analyzer for Linux, Mac OS X, and even the embedded OpenWRT Linux distribution. It works with any wireless card that supports passive monitor mode. In addition to basic network detection, Kismet will passively log all 802.11 frames to disk or to the network in standard PCAP format, for later analysis with tools like Ethereal. Kismet also features associated client information, AP hardware fingerprinting, Netstumbler detection, and GPS integration. Since it is a passive network monitor, it can even detect “closed” wireless networks by analyzing traffic sent by wireless clients. You can run Kismet on several machines at once, and have them all report over the network back to a central user interface. This allows for wireless monitoring over a large area, such as a university or corporate campus. Since it uses the passive monitor mode, it does all of this without transmitting any data.

  • KisMAC (http://kismac.binaervarianz.de/). Exclusively for the Mac OS X platform, KisMAC does much of what Kismet can do, but with a slick Mac OS X graphical interface. It is a passive scanner that will log data to disk in PCAP format compatible with Ethereal. It does not support passive scanning with AirportExtreme cards (due to limitations in the wireless driver), but it supports passive mode with a variety of USB wireless cards.

  • Driftnet and Etherpeg. These tools decode graphical data (such as GIF and JPEG files) and display them as a collage. As mentioned earlier, tools such as these are of limited use in troubleshooting problems, but are very valuable for demonstrating the insecurity of unencrypted protocols. Etherpeg is available from http://www.etherpeg.org/, and Driftnet can be downloaded at http://www.ex-parrot.com/~chris/driftnet/.

Bandwidth monitoring

The network is slow. Who is hogging all of the bandwidth? By using a good bandwidth monitoring tool, you can easily determine the source of spam and virus flooding problems. Such tools can also help you to plan for future capacity as the network users outgrow the available pipe. These tools will give you a visual representation of how traffic is flowing throughout your network, including traffic coming from a particular machine or service.

  • MRTG (http://people.ee.ethz.ch/~oetiker/webtools/mrtg/). Most network administrators have encountered MRTG at some point in their travels. Originally written in 1995, MRTG is possibly the most widely used bandwidth monitoring application. Using Perl and C, it builds a web page full of graphs detailing the inbound and outbound traffic used on a particular network device. MRTG makes it simple to query network switches, access points, servers, and other devices and display the results as graphs that change over time.

  • RRDtool (http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/). Developed by the same people who wrote mrtg, rrdtool is a more powerful generic monitoring application. RRD is short for "round-robin database". It is a generic data format that allows you to easily track any particular data point as a set averaged over time. While rrdtool does not directly monitor interfaces or devices, many monitoring packages rely on it to store and display the data they collect. With a few simple shell scripts, you can easily monitor your network switches and access points, and plot the bandwidth used as a graph on a web page.

  • ntop (http://www.ntop.org/). For historical traffic analysis and usage, you will want to investigate ntop. This program builds a detailed real-time report on observed network traffic, displayed in your web browser. It integrates with rrdtool, and makes graphs and charts visually depicting how the network is being used. On very busy networks, ntop can use a lot of CPU and disk space, but it gives you extensive insight into how your network is being used. It runs on Linux, BSD, Mac OS X, and Windows.

  • iptraf (http://iptraf.seul.org/). If you need to instantly take a snapshot of network activity on a Linux system, give iptraf a try. It is a command-line utility that gives you an up-to-the-second look at connections and network flows, including ports and protocols. It can be very handy for determining who is using a particular wireless link, and how heavily it is loaded. For example, by showing the detailed statistical breakdown for an interface, you can instantly find peer-to-peer client users, and determine exactly how much bandwidth they are currently using.

Troubleshooting

What do you do when the network breaks? If you can't access a web page or email server, and clicking the reload button doesn't fix the problem, then you'll need to be able to isolate the exact location of the problem. These tools will help you to determine just where a connection problem exists.

  • ping. Just about every operating system (including Windows, Mac OS X, and of course Linux and BSD) includes a version of the ping utility. It uses ICMP packets to attempt to contact a specified host, and tells you how long it takes to get a response.

    Knowing what to ping is just as important as knowing how to ping. If you find that you cannot connect to a particular service in your web browser (say, http://yahoo.com/), you could try to ping it:

$ ping yahoo.com
PING yahoo.com (66.94.234.13): 56 data bytes
64 bytes from 66.94.234.13: icmp_seq=0 ttl=57 time=29.375 ms
64 bytes from 66.94.234.13: icmp_seq=1 ttl=56 time=35.467 ms
64 bytes from 66.94.234.13: icmp_seq=2 ttl=56 time=34.158 ms
^C
--- yahoo.com ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max/stddev = 29.375/33.000/35.467/2.618 ms
  • Hit control-C when you are finished collecting data. If packets take a long time to come back, there may be network congestion. If return ping packets have an unusally low ttl, you may have routing problems between your machine and the remote end. But what if the ping doesn’t return any data at all? If you are pinging a name instead of an IP address, you may be running into DNS problems. Try pinging an IP address on the Internet. If you can’t reach it, it’s a good idea to see if you can ping your default router:

$ ping 216.231.38.1
PING 216.231.38.1 (216.231.38.1): 56 data bytes
64 bytes from 216.231.38.1: icmp_seq=0 ttl=126 time=12.991 ms
64 bytes from 216.231.38.1: icmp_seq=1 ttl=126 time=14.869 ms
64 bytes from 216.231.38.1: icmp_seq=2 ttl=126 time=13.897 ms
^C
--- 216.231.38.1 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max/stddev = 12.991/13.919/14.869/0.767 ms
  • If you can’t ping your default router, then chances are you won’t be able to get to the Internet either. If you can’t even ping other IP addresses on your local LAN, then it’s time to check your connection. If you’re using Ethernet, is it plugged in? If you’re using wireless, are you connected to the proper wireless network, and is it in range? Network debugging with ping is a bit of an art, but it is useful to learn. Since you will likely find ping on just about any machine you will work on, it’s a good idea to learn how to use it well.
  • traceroute and mtr (http://www.bitwizard.nl/mtr/). As with ping, traceroute is found on most operating systems (it's called tracert in some versions of Microsoft Windows). By running traceroute, you can find the location of problems between your computer and any point on the Internet:

$ traceroute -n google.com
traceroute to google.com (72.14.207.99), 64 hops max, 40 byte packets
 1  10.15.6.1  4.322 ms  1.763 ms  1.731 ms
 2  216.231.38.1  36.187 ms  14.648 ms  13.561 ms
 3  69.17.83.233  14.197 ms  13.256 ms  13.267 ms
 4  69.17.83.150  32.478 ms  29.545 ms  27.494 ms
 5  198.32.176.31  40.788 ms  28.160 ms  28.115 ms
 6  66.249.94.14  28.601 ms  29.913 ms  28.811 ms
 7  172.16.236.8  2328.809 ms  2528.944 ms  2428.719 ms
 8  * * *
  • The -n switch tells traceroute not to bother resolving names in DNS, and makes the trace run more quickly. You can see that at hop seven, the round trip time shoots up to more than two seconds, while packets seem to be discarded at hop eight. This might indicate a problem at that point in the network. If this part of the network is in your control, it might be worth starting your troubleshooting effort there.

    My TraceRoute (mtr) is a handy program that combines ping and traceroute into a single tool. By running mtr, you can get an ongoing average of latency and packet loss to a single host, instead of the momentary snapshot that ping and traceroute provide.

                             My traceroute  [v0.69]
tesla.rob.swn (0.0.0.0)        (tos=0x0 psize=64 bitpatSun Jan  8 20:01:26 2006
Keys:  Help   Display mode   Restart statistics   Order of fields   quit
                                       Packets               Pings
 Host                                Loss%   Snt   Last   Avg  Best  Wrst StDev
 1. gremlin.rob.swn                   0.0%     4    1.9   2.0   1.7   2.6   0.4
 2. er1.sea1.speakeasy.net            0.0%     4   15.5  14.0  12.7  15.5   1.3
 3. 220.ge-0-1-0.cr2.sea1.speakeasy.  0.0%     4   11.0  11.7  10.7  14.0   1.6
 4. fe-0-3-0.cr2.sfo1.speakeasy.net   0.0%     4   36.0  34.7  28.7  38.1   4.1
 5. bas1-m.pao.yahoo.com              0.0%     4   27.9  29.6  27.9  33.0   2.4
 6. so-1-1-0.pat1.dce.yahoo.com       0.0%     4   89.7  91.0  89.7  93.0   1.4
 7. ae1.p400.msr1.dcn.yahoo.com       0.0%     4   91.2  93.1  90.8  99.2   4.1
 8. ge5-2.bas1-m.dcn.yahoo.com        0.0%     4   89.3  91.0  89.3  93.4   1.9
 9. w2.rc.vip.dcn.yahoo.com           0.0%     3   91.2  93.1  90.8  99.2   4.1
  • The data will be continuously updated and averaged over time. As with ping, you should hit control-C when you are finished looking at the data. Note that you must have root privileges to run mtr. While these tools will not revel precisely what is wrong with the network, they can give you enough information to know where to continue troubleshooting.

Throughput testing

How fast can the network go? What is the actual usable capacity of a particular network link? You can get a very good estimate of your throughput capacity by flooding the link with traffic and measuring how long it takes to transfer the data. While there are web pages available that will perform a "speed test" in your browser (such as http://www.dslreports.com/stest), these tests are increasingly inaccurate as you get further from the testing source. Even worse, they do not allow you to test the speed of a particular link, but only the speed of your link to the Internet. Here are two tools that will allow you to perform throughput testing on your own networks.

  • ttcp (http://ftp.arl.mil/ftp/pub/ttcp/). Now a standard part of most Unix-like systems, ttcp is a simple network performance testing tool. One instance is run on either side of the link you want to test. The first node runs in receive mode, and the other transmits:

node_a$ ttcp -r -s

node_b$ ttcp -t -s node_a
ttcp-t: buflen=8192, nbuf=2048, align=16384/0, port=5001  tcp -> node_a
ttcp-t: socket
ttcp-t: connect
ttcp-t: 16777216 bytes in 249.14 real seconds = 65.76 KB/sec +++
ttcp-t: 2048 I/O calls, msec/call = 124.57, calls/sec = 8.22
ttcp-t: 0.0user 0.2sys 4:09real 0% 0i+0d 0maxrss 0+0pf 7533+0csw
  • After collecting data in one direction, you should reverse the transmit and receive partners to test the link in the other direction. It can test UDP as well as TCP streams, and can alter various TCP parameters and buffer lengths to give the network a good workout. It can even use a user-supplied data stream instead of sending random data. Remember that the speed readout is in kilobytes, not kilobits. Multiply the result by 8 to find the speed in kilobits per second. The only real disadvantage to ttcp is that it hasn’t been developed in years. Fortunately, the code has been released in the public domain and is freely available. Like ping and traceroute, ttcp is found as a standard tool on many systems.
  • iperf (http://dast.nlanr.net/Projects/Iperf/). Much like ttcp, iperf is a commandline tool for estimating the throughput of a network connection. It supports many of the same features as ttcp, but uses a "client" and "server" model instead of a "receive" and "transmit" pair. To run iperf, launch a server on one side and a client on the other:

node_a$ iperf -s

node_b$ iperf -c node_a
------------------------------------------------------------
Client connecting to node_a, TCP port 5001
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[  5] local 10.15.6.1 port 1212 connected with 10.15.6.23 port 5001
[ ID] Interval       Transfer     Bandwidth
[  5]  0.0-11.3 sec   768 KBytes   558 Kbits/sec
  • The server side will continue to listen and accept client connections on port 5001 until you hit control-C to kill it. This can make it handy when running multiple test runs from a variety of locations. The biggest difference between ttcp and iperf is that iperf is under active development, and has many new features (including IPv6 support). This makes it a good choice as a performance tool when building new networks.

Network health

By tracking information over time, you can get an overall idea of the general health of the network and its services. These tools will show you network trends and even notify a human when problems present themselves. More often than not, the systems will notice trouble before a person has a chance to call tech support.

  • cacti (http://www.cacti.net/). As mentioned earlier, many tools use RRDtool as a back-end to build graphs for data that they collect. Cacti is such a tool. It is a PHP-based network management tool that simplifies data gathering and graph generation. It stores its configuration in a MySQL database, and is integrated with SNMP. This makes it very straightforward to map out all of the devices on your network, and monitor everything from network flows to CPU load. Cacti has an extensible data collection scheme that lets you collect just about any kind of data you can think of (such as radio signal, noise, or associated users) and plot it on a graph over time. Thumbnail views of your graphs can be combined into a single web page. This lets you observe the overall state of your network at a glance.

  • SmokePing (http://people.ee.ethz.ch/~oetiker/webtools/smokeping/). Yet another tool by Tobias Oetiker, SmokePing is a tool written in Perl that shows packet loss and latency on a single graph. It is very useful to run SmokePing on a host with good connectivity to your entire network. Over time, trends are revealed that can point to all sorts of network problems. Combined with MRTG or Cacti, you can observe the effect that network congestion has on packet loss and latency. SmokePing can optionally send alerts when certain conditions are met, such as when excessive packet loss is seen on a link for an extended period of time.

  • Nagios (http://www.nagios.org/). Nagios is a service monitoring tool. In addition to tracking the performance of simple pings (as with SmokePing), Nagios can watch the performance of actual services on any number of machines. For example, it can periodically query your web server, and be sure that it returns a valid web page. If a check should fail, Nagios can notify a person or group via email, SMS, or IM. While Nagios will certainly help a single admin to monitor a large network, Nagios is best used when you have a troubleshooting team with responsibilities divided between various members. Trouble events can be configured to ignore transient problems, then escalate notifications only to people who are responsible for fixing them. If the problem goes on for a predefined period of time without being acknowledged, other people can additionally be notified. This allows temporary problems to be simply logged without bothering people, and for real problems to be brought to the attention of the team.