grenoble inp ensimag 4mmsr 4mmsr - securit e des r eseaux€¦ · 2012-05-14 { 2 {grenoble inp...
TRANSCRIPT
2012-05-14
Grenoble INP Ensimag
4MMSR
4MMSR - SECURITE DES RESEAUX
TELECOM 2A, 2011-2012
Fabien Duchene - Karim Hossen - Pascal MalterreAllowed time: 2 hours
NOTE: Version francaise– English: since this examination wording is in french only, in case a sentence would be unclear for you,
ask to teacher for translation (no guarantee, but he will do his best).– Espanol: como este enunciado esta solamente en Frances, si hay alguna phrase que usted no entiende,
pregunta al ensenante para una translacion (sin garantia, pero se va a hacerlo mejor que puede).Vous pouvez rediger en francais ou en anglais.Documents: 1 seule page A/4 recto/verso autorisee.Repondre directement sur le sujet d’examen excepte pour la synthese de l’exercice seminaire.Etre concis et precis. Repondre uniquement a ce qui est demande et par votre propreformulation. (eg: pas de copier-coller du cours)Cet enonce comporte une annexe.Les exercices sont independants.2H pour 20 points, donc consacrer environ 6 min par point.Aucun peripherique electronique (ex: calculatrice, ordinateur ou telephone portable) n’est autorise. Toutcas avere de fraude sera severement sanctionne.Lorsque les surveillant(e)s vous l’autorisent, vous pouvez tourner cette page, pas avant.
https://ensiwiki.ensimag.fr/index.php/4MMSR-Network_Security-2011-2012
Table des matieres
1 Securite Reseaux (2 pts) 2
2 Cryptographie (4 pts) 3
3 Vulnerabilites Web (5 pts) 5
4 Fuzzing (1 pt) 8
5 The Onion Router et Forensics Reseaux (3 pts) 9
6 Seminaires (5 pts) 13
A Annexes 14
1/13 – Annexes: 14-30 CONTINUED
2012-05-14
– 2 –
Grenoble INP Ensimag
4MMSR
1 Securite Reseaux (2 pts)
1. Hypothese : WEP est utilise pour assurer une(des) propriete(s) sur les donnees echangees entre un clientsans fil et un point d’acces.– Soit t le nombre des IV (Initialization Vector) possibles .– Soit Pr(Bn) la probabilite que deux paquets parmi n possedent le meme IV.– Et Pr(Bn) = 1− Pr(Bn)
(a) Quelle(s) est(sont) cette(ces) propriete(s) de securite ?
(b) (i) Quelle est la valeur possible de t ?
(ii) Exprimer Pr(B2) comme une fonction de t.
(iii) Exprimer Pr(B3) comme une fonction de t et de Pr(B2).
(iv) Exprimer Pr(Bn) comme une fonction de t de n. (Il est facile de demontrer ceci par recurrence,ne pas demontrer, uniquement fournir la formule).
(c) Sachant que :– Paul Richard Halmos (mathematicien, 1916-2006) a demontre que 1− x < e−(x)
... combien de paquets un attaquant a-t-il besoin de collecter afin d’avoir une probabilite de 73% que2 paquets captures possedent le meme IV ? (ne pas effectuer le calcul, juste mettre en equation etexpliquer quelle valeur vous choisissez parmi les possibles).
(d) Pendant la lecture, nous avons vu une autre attaque pour laquelle le paradoxe de l’anniversaire etaitutile. La nommer et decrire brievement l’objectif de l’attaquant.
2/13 – Annexes: 14-30 CONTINUED
2012-05-14
– 3 –
Grenoble INP Ensimag
4MMSR
2 Cryptographie (4 pts)
K. Hossen
2. (a) Donnez la definition de cryptanalyse et decrypter (1 ligne chacun).
(b) Quelles sont les principales differences entre un algorithme de substitution mono-alphabetique et poly-alphabetique ? Et citez en un de chaque.
(c) On vous propose d’ameliorer Cesar en chiffrant plusieurs fois de suite. Pour un caractere clair M, lecaractere chiffre correspondant en utilisant n fois Cesar est Cn tel que : Cn = (((M+K1)+K2)+...+Kn).Qu’en pensez vous ?
(d) Quelles sont les principales differences entre un algorithme de chiffrement symetrique et asymetrique ?Et citez en un de chaque.
(e) Une fois ingenieur, vous apprenez que votre jeu de role prefere utilise AES en mode ECB avec des clesde 256 bits pour chiffrer ses communications. Que faites vous ? (Si vous ne jouez pas a un jeux de role,que pensez vous de la securite du jeu ?)
3/13 – Annexes: 14-30 CONTINUED
2012-05-14
– 4 –
Grenoble INP Ensimag
4MMSR
3. (a) Vous etes ensuite embauche dans une entreprise qui distribue des cles RSA de 1024 bits a chacunde ses employes pour securiser les transmissions de donnees importantes. Quel est votre reaction ? Etpourquoi ?
(b) Un developpeur Web vous demande ensuite un conseil pour definir comment seront stockes les mots depasse des clients dans la base de donnees. Que repondez vous ? (plus la stategie est bonne → plus depoints)
(c) Un stagiaire vous dis qu’il a prefere utiliser un CRC256 (sur 256 bits, et tres rapide) pour verifier queles bons de commande ne sont pas modifies apres leur creation. Le CRC256 calcule est ensuite stocke,puis est accessible en lecture seule. Une fois qu’un bon va etre utilise, le CRC du bon est compare acelui sauvegarde pour etre sur qu’il n’a pas ete change. Que pouvez vous lui dire ? Justifiez.
(d) Cette fois ci c’est un ingenieur reseau qui demande un moyen rapide et securise de transferer de grosdocuments (plusieurs Go/min) entre deux site predefinis.
4/13 – Annexes: 14-30 CONTINUED
2012-05-14
– 5 –
Grenoble INP Ensimag
4MMSR
3 Vulnerabilites Web (5 pts)
3.1 XSS dans un formulaire de desinscription de mailing list (2pts)
Le mail suivant a ete envoye sur la mailing full disclosure :
4. (a) Definir le terme XSS et donner un exemple.
(b) Quelle est la difference entre un XSS type-1 (reflected) et un XSS type-2 (stored/persistent) ?
(c) Quelle(s) capacite(s) procure un XSS a un attaquant sur le navigateur d’une victime (penser auximpacts selon STRIDE) ? Si l’on dispose de ce(s) capacite(s), quelle(s) propriete(s) de securite sur lesobjets de la page en cours est un attaquant en mesure de violer (preciser les hypotheses si necessaire) ?
5/13 – Annexes: 14-30 CONTINUED
2012-05-14
– 6 –
Grenoble INP Ensimag
4MMSR
5. voici un extrait du code de la page web (simplifie et legerement modifie) :
sText=’Cher lecteur,<br><br>Votre demande de désinscription de l\’adresse e-mail
<b>##EMAIL##</b> a bien ete prise en compte.<br><br>Si vous avez des questions concernant
ce courrier ou votre adresse, vous pouvez contacter son administrateur à l\’adresse
e-mail <a href="mailto:##ADMIN##">##ADMIN##</a>.<br><br><font style="font-size:10px;">Si
vous souhaitez consulter la politique anti-spam de l\’editeur de notre solution e-mailing,
<a href="javascript:popup(\’http://www.sarbacane.com/politique_antispam.asp?lng=fr\’);"
title="Politique antispam">cliquez-ici</a>.</font>’;
....
sEmail = filtreEmail(mel);
sAdm = filtreAdm(adm);
....
sText = sText.replace(’##EMAIL##’, sEmail);
sText = sText.replace(’##ADMIN##’, sAdm);
(a) A l’aide des captures d’ecran suivantes et de l’extrait de code precedent, pour quelle(s) variable(s)d’entree avez vous l’intuition qu’il y a une potentielle injection ? (indiquer brievement pourquoi)
(b) Supposons que ∀arg1, filtreEmail(arg1) = filtreAdm(arg1) = arg1Pour chaque parametre d’entree pour lequel existe un potentiel XSS, donner un exemple(voire 2 si differents) de valeur permettant d’executer le code javascript suivant :window.location=’http://bit.ly/Iqs6OA’;
6/13 – Annexes: 14-30 CONTINUED
2012-05-14
– 7 –
Grenoble INP Ensimag
4MMSR
3.2 Attaques NoSQL : l’exemple de MongoDB (3 pts)
Une base de donnees Not Only SQL (NoSQL) n’utilise pas la syntaxe SQL. C’est le cas de MongoDB.
“...with MongoDB we are not building queries from strings, so traditional SQL injection attacks are not aproblem.” -MongoDB Developer FAQ
Ce code est extrait de l’article de Nicolas Viot sur les attaques NoSQL publie dans le magazine MISC 60http://bit.ly/HCsIMu :
1 <?php2 // . . .3 $m = new Mongo ( ) ;4 $db = $m−>database name ;5
6 $ r e s = $db−>user−>f indOne ( ’ $where ’ => ”7 t h i s . l o g i n == ’ ” . $ POST [ ’ l o g i n a ’ ] . ” ’8 &&9 t h i s . password == ’ ” . $ POST [ ’ passworda ’ ] . ” ’
10 ” ) ;11
12 i f ( ! $ r e s ) {13 print ( ” au then t i c a t i on f a i l e d ” ) ;14 exit ( 1 ) ;15 }16 // au t h en t i c a t e d17 // . . .18 ?>
A la ligne 5, on fait une recherche dans la table user, et on cherche un enregistrement pour lequel le champlogin vaut la valeur du parametre d’entree login envoyee par methode POST ($ POST[’logina’]) ET lavaleur de password vaut $ POST[’passworda’].
Pour acceder au champ eye color d’une table head, on utilise : head.eye color (this est la table courante)Quelques operateurs :– ‖ signifie OR– && signifie AND
6. Hypotheses :– vous connaissez un couple valide de login + mot de passe (eg : megamo et rano.com)– on accede a l’application via http://vulnerab.le/
Ecrire en pseudo-code un programme qui recupere la valeur du champ cellphone de l’enregistrement pourlequel email=’[email protected]’ dans la table customers par une attaque Blind NoSQLInjection.
7/13 – Annexes: 14-30 CONTINUED
2012-05-14
– 8 –
Grenoble INP Ensimag
4MMSR
4 Fuzzing (1 pt)
Questionnaire a Choix Multiples avec degre de certitude :– Toute reponse correcte (resp. erronee) vous fait gagner (resp. perdre) des points.– Cocher les reponses que vous estimez correctes– Indiquer a cote de chaque reponse possible (que vous l’estimiez vrai ou fausse) votre degre de confiance
(20, 40, 60, 80 ou 100%)
Questions Reponses
1. Pour donner des resultatsexploitables, une methode defuzzing doit etre :
� .....% Reproductible
� .....% Monitore
� .....% Automatise
� .....% Exhaustif
� .....% Intelligent
2. Parmi les suivantes, quelles sontdes metriques de couvertureappropriees dans le cadre d’un testen blackbox d’un serveurprotocolaire FTP ?
� .....% Nombre d’etats traverses
� .....% Nombre de primitives de fuzz appliquees par transition
� .....% Nombre de lignes du code source executees
� .....% Nombre d’instructions assembleur executees
� .....% Nombre de blocs d’instructions assembleur executes
8/13 – Annexes: 14-30 CONTINUED
2012-05-14
– 9 –
Grenoble INP Ensimag
4MMSR
5 The Onion Router et Forensics Reseaux (3 pts)
P. Malterre
5.1 TOR
7. (a) Rappeler brievement le principe d’un echange Diffie-Hellman.
(b) Quelle est la principale attaque contre ce protocole ?
8. Le schema ci-dessous represente une session dans laquelle un client effectue, au tra-vers du reseau Tor, une simple requete en HTTP vers la page d’accueil d’un site web.
(a) en supposant qu’aucun circuit n’a ete etabli au prealable, combien d’echanges Diffie-Hellman sontnecessaires avant que le client puisse recuperer le resultat de sa requete ?
(b) pour ces differents echanges, indiquer quels sont les moyens eventuels permettant de prendre en comptel’attaque mentionnee precedemment.
9/13 – Annexes: 14-30 CONTINUED
2012-05-14
– 10 –
Grenoble INP Ensimag
4MMSR
9. L’ecoute passive de trafic entre deux noeuds Tor permet de mettre en evidence l’utilisation du certificatci-dessous.
Certificate:
Data:
Version: 3 (0x2)
Serial Number: 1336031991 (0x4fa23af7)
Signature Algorithm: sha1WithRSAEncryption
Issuer: CN=www.ahsy2k5y.net
Validity
Not Before: May 3 07:59:51 2012 GMT
Not After : May 3 07:59:51 2013 GMT
Subject: CN=www.cpi5v2aj5.net
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
RSA Public Key: (1024 bit)
Modulus (1024 bit):
00:e1:b3:3b:63:27:92:86:11:73:e3:8f:e8:a0:d1:
c5:a9:e0:14:fb:5d:6d:ed:ae:eb:6f:7b:36:35:e2:
1a:b7:a4:96:26:6b:ec:c6:53:74:d1:3a:b7:ab:51:
5f:c9:6b:b1:66:51:13:c0:4d:3d:00:d4:ee:d1:7b:
ff:11:93:b3:21:ba:43:95:4c:ea:e9:c7:72:d2:9c:
02:18:76:f6:47:58:e6:48:76:77:d5:45:aa:e1:a5:
59:18:5b:91:1b:68:33:e6:c3:0d:81:7b:d3:c2:59:
2d:67:07:5e:a9:b7:82:51:29:24:7c:53:93:47:e0:
1a:65:3a:66:e0:96:98:cd:59
Exponent: 65537 (0x10001)
Signature Algorithm: sha1WithRSAEncryption
1c:bb:81:af:70:8d:8b:b8:b1:00:71:f5:cc:da:aa:4c:8f:72:
32:dc:a2:e4:c1:d2:4e:83:63:63:58:b5:37:a6:70:56:1d:ed:
f7:ea:3c:7d:5d:d7:5a:96:fb:a7:9f:f0:a4:77:ae:31:63:f6:
7b:39:98:ba:70:38:69:1b:86:93:3f:18:74:ee:91:5b:cb:f5:
42:d1:89:94:84:ec:9d:2f:68:cf:8f:e6:2c:09:b8:45:ae:c7:
eb:bd:ff:34:f2:a8:41:37:24:45:e3:a2:f6:d7:c4:74:14:cb:
e9:da:01:e5:eb:ab:d8:4f:69:0c:e5:f8:6d:98:6f:bc:d1:ec:
60:e6
(a) quel est l’usage de la cle publique encodee dans ce certificat ?
(b) la duree de validite est-elle correcte ? pourquoi ?
10/13 – Annexes: 14-30 CONTINUED
2012-05-14
– 11 –
Grenoble INP Ensimag
4MMSR
5.2 Detection d’intrusions
Prendre connaissance du schema reseau ci-dessus. On peut distinguer differentes zones :– une zone WiFi de type hotspot, il n’y a aucun filtrage et l’acces a Internet est direct ;– une zone reservee aux partenaires, accessible uniquement au moyen d’une passerelle VPN/IPSEC et per-
mettant d’acceder a un espace de travail collaboratif ;– une DMZ dans laquelle on trouve les services publics (i.e. accessibles depuis Internet) de l’entreprise : sites
web, serveur de messagerie, DNS) ; on trouve egalement dans cette zone une passerelle VPN/IPSEC pourles utilisateurs nomades ;
– une DMZ contenant un proxy web (acces au net pour les utilisateurs), ainsi qu’un relais DNS ;– differents sous-reseaux (utilisateurs et serveurs).
10. (a) Donner un exemple plausible et coherent d’un scenario d’intrusion au sein de ce systeme d’information.
(b) Decrire les differents moyens de detection reseau qui pourraient etre mis en oeuvre pour detecterl’intrusion imaginee precedemment, en precisant :– la localisation des points de capture ;– les techniques et les outils mis en oeuvre.
11/13 – Annexes: 14-30 CONTINUED
2012-05-14
– 12 –
Grenoble INP Ensimag
4MMSR
12/13 – Annexes: 14-30 CONTINUED
2012-05-14
– 13 –
Grenoble INP Ensimag
4MMSR
6 Seminaires (5 pts)
Choisissez une presentation parmi celles proposes et repondez aux questions ci-apres.Il est interdit de choisir le sujet que vous avez presente.
– Wi-Fi Advanced Fuzzing - Laurent BUTTI – France Telecom / Orange Division R&D - Black-Hat EU2007
– Rainbow Tables Probabilistes, Alain Schneider, SSTIC, 2011– W32.Stuxnet Dossier, Nicolas Falliere, Liam O Murchu, and Eric Chien - 2011
11. (a) Indiquer le titre de la presentation que vous avez fait a la classe :
(b) Indiquer le titre du sujet choisi pour cet examen :
12. En vous aidant de la presentation Appendice A - Annexes dont le dbut est en page 14 et de vosconnaissances, rediger une synthese (texte + schemas importants) du papier choisi a destinationd’un eleve qui a suivi le cours de securite des reseaux 4MMSR 2011-2012 sans avoir assisteaux seminaires (il est uniquement venu aux sessions de cours et il a fait tous les TP). Votreesprit critique vous permettra de noter que des erreurs peuvent susbister dans certaines versions finalespresentees par les eleves.
Sera en particulier valorise le fait de :– relever des erreurs veritables dans la presentation (ne pas en inventer !)– pour chaque attaque preciser explicitement
– quelle sequence d’entrees doit etre envoyee au systeme– quelle(s) propriete(s) de securite est(sont) violee(s) sur quel(s) objet(s)
– proposer des contre-mesures additionnelles– expliquer clairement les limitations de l’approche choisie par les auteurs, et pour chacune donner un
exemple de methode n’ayant pas cette limitation
Afin de guider votre discours, voici une idee de plan :
(a) probleme adresse
(b) methode de resolution proposee
(c) resultats d’experimentations
(d) contre-mesures
(e) limitations
(f) conclusion
13/13 – Annexes: 14-30 CONTINUED
2012-05-14
– 14 –
Grenoble INP Ensimag
4MMSR
A Annexes
A.1 Wi-Fi Advanced Fuzzing - Laurent BUTTI – France Telecom / OrangeDivision R&D - Black-Hat EU 2007
sous-section A.3 - W32.Stuxnet Dossier, Nicolas Falliere, Liam O Murchu, and Eric Chien - 2011 dont ledbut est en page 15
A.2 Rainbow Tables Probabilistes, Alain Schneider, SSTIC, 2011
sous-section A.3 - W32.Stuxnet Dossier, Nicolas Falliere, Liam O Murchu, and Eric Chien - 2011 dont ledbut est en page 20
A.3 W32.Stuxnet Dossier, Nicolas Falliere, Liam O Murchu, and Eric Chien -2011
sous-section A.3 - W32.Stuxnet Dossier, Nicolas Falliere, Liam O Murchu, and Eric Chien - 2011 dont ledbut est en page 24
– 14 – CONTINUED
Laurent Butti – BlackHat Europe - 2007
March 12th, 2012 Corentin DELPECH - Lucas FONTAINE ENSIMAG 2A TELECOM - 2012 2013 1
ENSIMAG - 4MMSR - Network Security – Seminars
Corentin Delpech [email protected] Lucas Fontaine [email protected]
/29
Summary Introduction, 802.11 overview
Historic, Wi-Fi standards, usages
Technical specificities ○ Networking modes ○ Wi-Fi frames
Security of Wi-Fi networks Which issues ? How to perform vulnerability
tests ?
Fuzzing What is fuzzing ? Implementation of a fuzzer
Discovered vulnerabilities
Fuzzers limitation, counter-measures
Demonstration (!)
Final words, summary
March 12th, 2012 Corentin DELPECH - Lucas FONTAINE ENSIMAG 2A TELECOM - 2012 2013 3 /29
Introduction Historic, Wi-Fi standards
March 12th, 2012 Corentin DELPECH - Lucas FONTAINE ENSIMAG 2A TELECOM - 2012 2013 5
Wi-Fi Wireless Fidelity Appeared in 1999 Now Ubiquitous Many platforms : laptops, cellular
phones, printers …
Why this presentation ? Many chipsets -> Many developers -> Heterogeneous regarding security
Figure 1 – Democratization of wireless hot spots
/29
Introduction Technical specificities, Networking Modes
March 12th, 2012 Corentin DELPECH - Lucas FONTAINE ENSIMAG 2A TELECOM - 2012 2013 6
802.11 wireless cards can operate in different modes : Monitor : Just listen to traffic Master : Act as an access point AdHoc : Act as an Adhoc Station Managed : Act as a station
Discovering an access point : Active scanning : send probe request and listen to responses and do
channel hopping Passive scanning : listen to beacons and do channel hopping
/29
Figure 2 – A Network
Introduction
Technical specificities, Wi-Fi Frames
March 12th, 2012 Corentin DELPECH - Lucas FONTAINE ENSIMAG 2A TELECOM - 2012 2013 7
802.11 frames : Data frames Control frames Management frames :
MAC frame format :
Authentification, Asssociation Request, Assocation Responce, Resassociation Responce, Dissociation, Beacon, Probe Request,Probe responce, Request To Send, Clear To Send, Acknolegement
Figure 3 - Mac frame format /29
Introduction
Technical specificities, Wi-Fi Frames
March 12th, 2012 Corentin DELPECH - Lucas FONTAINE ENSIMAG 2A TELECOM - 2012 2013 8
Example of a frame :
Figure 4 - Example of a frame with WireShark
/29
Introduction
Technical specificities, Wi-Fi Frames
March 12th, 2012 Corentin DELPECH - Lucas FONTAINE ENSIMAG 2A TELECOM - 2012 2013 9
Figure 5 - 802.11 States for 1 client and server
3 class frames : class 1 :
Probe Request / Response , Beacon , Athentification Request / Responce, Deauhentication
class 2 : (Re)association Request / Response Deassociation
class 3 : Deauthentication
/29
Security of Wi-Fi networks Which issues ?
March 12th, 2012 Corentin DELPECH - Lucas FONTAINE ENSIMAG 2A TELECOM - 2012 2013 11
Infrastructure/network sided security weak
Client sided security weak
Remote attack (in the victim’s radio coverage) with kernel-mode code remote execution !
Figure 6 – Example of Wi-Fi remote attack
/29
Security of Wi-Fi networks How to perform vulnerability test ?
March 12th, 2012 Corentin DELPECH - Lucas FONTAINE ENSIMAG 2A TELECOM - 2012 2013 12
Closed source drivers Black box testing Reverse engineering
Open source drivers Black & white box testing Source code auditing
Figure 7 – Do you know what is inside the box ?
Corentin & Lucas !
/29
Fuzzing What is fuzzing ?
March 12th, 2012 Corentin DELPECH - Lucas FONTAINE ENSIMAG 2A TELECOM - 2012 2013 14
• Malformed data • Semi-malformed data
Fuzz (random
data) Which behavior ?
Input of a
program
Defects and implementations bugs to correct
If program
fails
“Black box” software testing technique
“Automatically generate and inject malformed or semi-malformed data in order to find implementation bugs” [OWASP.ORG]
Fuzzing is OK to discover the most obvious bugs KO for the most complex ones (not smart enough !)
New vulnerability discovered !
/29
Fuzzing Implementation of a fuzzer
March 12th, 2012 Corentin DELPECH - Lucas FONTAINE ENSIMAG 2A TELECOM - 2012 2013 15
Information Element
Element ID (1) Length (1) Information (Length) Figure 9 – Information Element
“SSID” of a 802.11 frame
Figure 8 – Structure of an “Information Element”
• Some IE have a fixed or maximum length
• Possible overflow of the ‘static’ buffer receiving the Information if “Length” not checked
• List of “interesting” Information Element • IE 0 : SSID (min size of 0 byte, max. 32) • IE 3 : Channel (fixed size of 1 byte)
• Some fast boundary test examples : • IE 0 {0, 1, MIN-1, MIN, MIN+1, MAX-1,
MAX, MAX+1, 254, 255} lengths • IE 3 {0, 1, 254, 255}
/29
Fuzzing Implementation of a fuzzer
March 12th, 2012 Corentin DELPECH - Lucas FONTAINE ENSIMAG 2A TELECOM - 2012 2013 16
Figure 10 – Architecture overview
Ethernet connectivity useful for bug detection (ping and keepalive TCP connection)
/29
Fuzzing Implementation of a fuzzer
March 12th, 2012 Corentin DELPECH - Lucas FONTAINE ENSIMAG 2A TELECOM - 2012 2013 17
Difficulties • Proprietary Information Element (documentation ?!) • Channel hopping for active access point scan from the client NEED fast answer
• Difficult with a Python implementation of the fuzzer, even harder with existing injection framework like Scapy
• Cannot state if the victim device is listening or not to beacons • Detection of a “bug” under several OS ?
Solutions • More than just a fuzzer : a smart fuzzer • Flood the radio with probe responses and beacons • Automatic bug detection
• Windows : ping don’t answer any more or even BSOD ! • Linux : monitor {oops|unable to handle|assert|panic} kernel events • Detect when the 802.11 victim device stop sending “probe request” for
active scanning -> the device don’t work anymore !
/29
Discovered vulnerabilities by Laurent BUTTI with his Wi-Fi fuzzing
March 12th, 2012 Corentin DELPECH - Lucas FONTAINE ENSIMAG 2A TELECOM - 2012 2013 19
- NetGear MA521 Wireless Driver Long Rates Overflow Utilisation d’une trame avec un IE “Rates” trop long (longueur maximale de 8 octets normalement)
- NetGear WG311v1 Wireless Driver Long SSID Overflow
Utilisation d’une trame avec un IE “SSID” trop long (longueur maximale de 32 octets normalement)
- D-Link DWL-G650+ (A1) Wireless Driver Long TIM Overflow
Utilisation d’une trame avec un IE “TIM” trop long - Madwifi Driver Remote Buffer Overflow Vulnerability
Utilisation d’une trame avec IE WPA/RSN/VMM/ATH trop long Exploitable uniquement lors d’un appel à SIOCGIWSCAN du client Commande ‘iwlist’ par exemple
/29
Discovered vulnerabilities by Laurent BUTTI with his Wi-Fi fuzzing
March 12th, 2012 Corentin DELPECH - Lucas FONTAINE ENSIMAG 2A TELECOM - 2012 2013 20
Figure 11 - Linux Kernel « oops »
/29
Discovered vulnerabilities by Laurent BUTTI with his Wi-Fi fuzzing
March 12th, 2012 Corentin DELPECH - Lucas FONTAINE ENSIMAG 2A TELECOM - 2012 2013 21
Figure 12, 13, 14 « net80211/ieee80211_scan.c » MadWiFi source code Function giwscan_cb
/29
Discovered vulnerabilities by Laurent BUTTI with his Wi-Fi fuzzing
March 12th, 2012 Corentin DELPECH - Lucas FONTAINE ENSIMAG 2A TELECOM - 2012 2013 22
Figure 15 « net80211/ieee80211_scan.c » MadWiFi source code Function encode_ie
/29
Fuzzer Limitations, counter-measure
March 12th, 2012 Corentin DELPECH - Lucas FONTAINE ENSIMAG 2A TELECOM - 2012 2013 24
Figure 16 – Logo of madwifi
Limitations : the developer's comprehension of the protocol cannot help you to find Complex 'Bugs' needs to manage Wi-Fi states needs to have the same level of performance as the client cannot be sure a frame was analysed needs to understand bugs activated by fuzzer
Driver's patches may prevent them. Or add some ! Or only partially correct them
/29
Conclusion
March 12th, 2012 Corentin DELPECH - Lucas FONTAINE ENSIMAG 2A TELECOM - 2012 2013 27
• Many vulnerabilities came with 802.11 • Fuzzing is the best way to make testing • Tests wireless cards with :
o his states o Information elements
� • Helps to Discover obvious bug, and critical bugs. • Can discover more complex bug o developer needs to know 802.11 standards really well.
/29
Conclusion
March 12th, 2012 Corentin DELPECH - Lucas FONTAINE ENSIMAG 2A TELECOM - 2012 2013 28
• Other things to do : o extensions are coming o wireless devices : WUSB, Bluetooth 3.0, … o fuzzing access point
/29
Rainbow Tables Probabilistes
Alain Schneider--Groupe LEXSI-
Ensimag-4MMSR-Network Security
Student Seminar
3/28/12 [email protected] - [email protected]
1
Plan
3/28/12 [email protected] - [email protected] 2
I. Introduc*on+II. Background+Knwoledge+
a) Rainbows*table*Defini0on*b) Problem*Statement * *+
III. Probabilis*c+Rainbow+tables*a) Markovien*Automate+ + ++b) Storing*password*«*Markov*Tree*»*c) Changing*calcula0on*strategy.*d) Axes*of*improvement* * *+
IV. Counter+measures+&+Limita*ons+V. Conclusion+
*
Introduction1/2:
3/28/12 [email protected] - [email protected] 3
Introduction 2/2:
Key size in bits
Possible permutations
Brute force time of a device checking 2^56/s
8 2^8 0 millisecondes
40 2^40 0,015 millisecondes
56 2^56 1 seconds
64 2^64 4 min 16 s
128 2^128 149,745,258,842,898 years
256 2^256
Finding an inversion function of hash ( ex : Hash : 8 alphanumeric characters SHA-1 ( 160bits)
(26+26+10)^8=5*10^13 2^160 =10^4 ) Exploiting collision that may occurs when using a low hash function. Brute force attack : the hash of large number of password =>
theoretical limit.
3/28/12 [email protected] - [email protected] 4
Rainbows*table*1/4:
Rainbow Table : Stucture containing chains of associations of hashes and passwords.
Reduce password space storage for a brute attack force.
To build a Rainbow Table we need: Set of passwords A hash function A reduction function
Reduce functions = associate a password to a hash. Hash = associate a unique hash to every password (hash must be unique!).
3/28/12 [email protected] - [email protected] 6
Rainbows*table*2/4:
Collision in “xccd” => same chain end ! => Redundandcy => Memory Loss
http://www.mieuxcoder.com/2008/01/02/rainbow-tables/ 3/28/12 [email protected] - [email protected] 7
Rainbows*table*3/4: Idea : different reduction function suppression of collision
3/28/12 [email protected] - [email protected] 8
Rainbows*table*4/4:
- Easy one : « 19033d1d » ( known location; �end of chain�) - Harder : « 44d06651 »
Performance : - storing a chain of password/hash ~ storing a password/hash. - Finding a password in set (brute-force attack) ~ finding a chain in a list of chain.
The choice of the password set is crucial!
3/28/12 [email protected] - [email protected] 9
Problem Statement1/3:
The classic rainbow tables list all possible combinations of a certain alphabet until a certain length.
There are Rainbow Tables based on dictionaries.
There are Rainbow Tables hybrid
- Find new Rainbow tables to cope with limited time and memory
Constraint, time and Memory => Low Balance
3/28/12 [email protected] - [email protected] 10
Passwords are not RANDOM Represented passwords by Hidden Markov Model.
Probabilistic Rainbow Table:
I(x y) = x y improbability transition
Using a reference set of passwords (Rockyou[1]) we can attribute an Improbability rate to evrey transition.
1) Rockyou. : social application site, « 32 millions available password »
www.techcrunch.com/2009/12/14/rockyou-hack-security-myspace-facebook-passwords/
3/28/12 [email protected] - [email protected] 14
Storing passwords in a Markov Tree
Generate Password : -Sets a maximal capital of improbability. -Move down the tree each time subtracting the capital of each node.
Choice of I(max) => genarate more accurent passwor
3/28/12 [email protected] - [email protected]
15
Table Generated when traversing the automate
Changing calculation strategy*1/2*:
CPU Not adapted Limited
Distributed calculation Appropriate for Rainbow Tables generation. Expensive not adapted with mobility context
GPU : one of solutions for a mobility context (next slide).
3/28/12 [email protected] - [email protected] 16
Results 1/2
educing access time to the Nth password.
3/28/12 [email protected] - [email protected]
18
Results 2/2
Reducing storage space of Markov trees.
Reducing access time to the Nth password.
Cf : https://www.sstic.org/media/SSTIC2011/SSTIC-actes/rainbow_tables_probabilistes/
3/28/12 [email protected] - [email protected]
19
Counter-measures :
Salt Example : - Use of national character/ exotic ( é,ç,… ) - Truly random numbers through a simple USB key And quantum mechanics [1].
1) cf : http://www.idquantique.com/true-random-number-generator/products-overview.html 3/28/12 [email protected] -
Limitation :
To generate tables that achieve a success rate of 99.9% we need~~ 160 years
Storage space => 9,90 To for a 80% sucess rate on 8 alphanumeric characters Constraints related to implenting calculations on GPU Long chains = long cracking time
3/28/12 [email protected] - [email protected]
22
W32.Stuxnet Dossier, Installation and PropagationEnsimag-4MMSR-Network Security - Student Seminar1
[email protected],[email protected],[email protected]
2012-04-18
1https://ensiwiki.ensimag.fr/index.php/4MMSR-Network_Security-2011-2012Nicolas Falliere, Liam O Murchu, Eric Chien ()W32.Stuxnet Dossier 1/28 2012-04-18 1 / 28
Authors
Nicolas Falliere(Senior SoftwareEngineer)Liam O Murchu(Development Manager)Eric Chien(Technical Director)part of SymantecSecurity Response(antivirus and computersecurity research group,over 400 full-timeemployees)
SymantecFounded 1982Headquarters: MountainView, Californiaproviding security, storageand systems managementsolutionse. g. Norton products
Nicolas Falliere, Liam O Murchu, Eric Chien ()W32.Stuxnet Dossier 2/28 2012-04-18 2 / 28
Outline
1 Introduction
2 Architecture
3 Injection
4 Preparation
5 Propagation
6 Counter measures
7 Conclusion
Nicolas Falliere, Liam O Murchu, Eric Chien ()W32.Stuxnet Dossier 3/28 2012-04-18 3 / 28
Introduction
Stuxnet
computer wormfirst discovered in June 2010first infected systems June 2009targets industrial control systems with PLC(Programmable Logic Controller) made by Siemensfor Windows XP, ME, 2000, 2003, Vista, 7, Server 2008
Nicolas Falliere, Liam O Murchu, Eric Chien ()W32.Stuxnet Dossier 5/28 2012-04-18 5 / 28
Introduction
Distribution
measured Sept. 29, 2010 (by monitoring tra�c to Command &Control server)
Nicolas Falliere, Liam O Murchu, Eric Chien ()W32.Stuxnet Dossier 6/28 2012-04-18 6 / 28
Introduction
Attack Scenario
Nicolas Falliere, Liam O Murchu, Eric Chien ()W32.Stuxnet Dossier 7/28 2012-04-18 7 / 28Architecture
Architecture
DLL file
Nicolas Falliere, Liam O Murchu, Eric Chien ()W32.Stuxnet Dossier 9/28 2012-04-18 9 / 28
Injection
Injection
there is no stuxnet-process,stuxnet hides in trustedprocessesinjection is performed on everycall of an exportinjects into trusted processgoal: hide from antimalware
Trusted processesProduct process nameKaspersky KAV avp.exeMcafee Mcshield.exeAntiVir avguard.exeBitDefender bdagent.exeEtrust UmxCfg.exeF-Secure fsdfwd.exeSymantec rtvscan.exeSymantec Common Client ccSvcHst.exeEset NOD32 ekrn.exeTrend Pc-Cillin tmpproxy.exeWindows Lsass.exeWindows Winlogon.exeWindows Svchost.exe
Nicolas Falliere, Liam O Murchu, Eric Chien ()W32.Stuxnet Dossier 11/28 2012-04-18 11 / 28
Preparation
Outline
1 Introduction
2 Architecture
3 Injection
4 Preparation
5 Propagation
6 Counter measures
7 Conclusion
Nicolas Falliere, Liam O Murchu, Eric Chien ()W32.Stuxnet Dossier 12/28 2012-04-18 12 / 28
Preparation Export 15
Export 15
Nicolas Falliere, Liam O Murchu, Eric Chien ()W32.Stuxnet Dossier 13/28 2012-04-18 13 / 28Preparation Zero-day exploit
Zero-day exploit
exploits computer application vulnerabilities that are unknown toothers or the software developer beforeVulnerability window: time period between first exploitation anddevelopment of counter measuresAttack vector: a concrete way to exploit vulnerability
Nicolas Falliere, Liam O Murchu, Eric Chien ()W32.Stuxnet Dossier 14/28 2012-04-18 14 / 28
Preparation MS10-092: 0-day Task Scheduler
MS10-092: 0-day Task Scheduler
target platform: Windows Vista and higher (introduction of new TaskScheduler)goal: escalate privileges to SYSTEMtask information as xml file read- and writable by userintegrity protected by weak CRC32 checksum
Nicolas Falliere, Liam O Murchu, Eric Chien ()W32.Stuxnet Dossier 15/28 2012-04-18 15 / 28
Preparation MS10-092: 0-day Task Scheduler
MS10-092: 0-day Task Scheduler
Attack1 create task with low privileges2 read task configuration file from %SystemRoot%\system32\Tasks3 modify task configuration file (change privileges)4 calculate CRC32 of original file and adapt altered file to match it5 run task
Nicolas Falliere, Liam O Murchu, Eric Chien ()W32.Stuxnet Dossier 16/28 2012-04-18 16 / 28
Propagation
Outline
1 Introduction
2 Architecture
3 Injection
4 Preparation
5 Propagation
6 Counter measures
7 Conclusion
Nicolas Falliere, Liam O Murchu, Eric Chien ()W32.Stuxnet Dossier 17/28 2012-04-18 17 / 28Propagation Peer-to-peer
Peer-to-peer
implements a Microsoft RPC server and clientautomatic updates in LAN
Nicolas Falliere, Liam O Murchu, Eric Chien ()W32.Stuxnet Dossier 18/28 2012-04-18 18 / 28
Propagation WinCC
WinCC
WinCC (Windows Control Center)for supervision and controlling of Siemens’ industrial systemsMicrosoft SQL Server for loggingVulnerability: hardcoded publicly known and documented password inSQL server
Nicolas Falliere, Liam O Murchu, Eric Chien ()W32.Stuxnet Dossier 19/28 2012-04-18 19 / 28
Propagation WinCC
Infecting WinCC computers
connect as Administrator using password ’2WSXcder’create table with hex representation of main Stuxnet DLL:
CREATE TABLE sysbinlog ( abin image )INSERT INTO sysbinlog VALUES (0x...)
write dll to disk via OLE Automation Stored Proceduresadd as stored procedure and execute
SET @ainf = @aind + ‘\\sql%05x.dbi’EXEC sp_addextendedproc sp_dumpdbilog, @ainfEXEC sp_dumpdbilog
Nicolas Falliere, Liam O Murchu, Eric Chien ()W32.Stuxnet Dossier 20/28 2012-04-18 20 / 28
Propagation Network shares
Network shares
Two methods used:search for accessible network shares
search for other computers with same user accounts as local userfor all available credentials, try access $admin and $Cdrop stuxnet-dll on systemschedule task to execute stuxnet-dll
Windows RPC Vulnerability: MS08-67bu�er overflow in Windows RPCalready used by Confickermore sophisticated implementation (employes recent techniques likeReturn Oriented Programming)
Nicolas Falliere, Liam O Murchu, Eric Chien ()W32.Stuxnet Dossier 21/28 2012-04-18 21 / 28Propagation Printer spooler vulnerability
Printer spooler vulnerability
discovered April 2009, fixed Sept 14, 2010precondition: printer shared on targetgoal: remote code execution
Attackconnect to print spooler as guestprint two ”documents” to files in %SYSTEM%-directorythe files are ”printed” with print spooler’s instead guest’s of privileges
winsta.exe æ stuxnet.dllwbem\mof\sysnullevnt.mof æ registers event, to execute winsta.exe
Nicolas Falliere, Liam O Murchu, Eric Chien ()W32.Stuxnet Dossier 22/28 2012-04-18 22 / 28
Propagation Propagation via removable drive
LNK Vulnerability: MS10-046
Nicolas Falliere, Liam O Murchu, Eric Chien ()W32.Stuxnet Dossier 23/28 2012-04-18 23 / 28
Counter measures
Counter measures
For Stuxnet in particular:install recent security updates (for all used vulnerabilities exist fixesnow)
For similar future malwarenone, only impederequest software manufactures to fix known vulnerabilities quicklyinstall recent security updatesisolation (take network, usb-sticks, ... into account)
Nicolas Falliere, Liam O Murchu, Eric Chien ()W32.Stuxnet Dossier 25/28 2012-04-18 25 / 28
Conclusion
Conclusion
largest and costliest development e�ort in malware history(estimation: 10 million $)4 zero-day exploits2 compromised certificatesonly nation state capable to produce itæ cyberweapon
Nicolas Falliere, Liam O Murchu, Eric Chien ()W32.Stuxnet Dossier 27/28 2012-04-18 27 / 28Conclusion For Further Reading
Aleksandr Matrosov Eugene Rodionov, David Harley and Juraj Malcho.“Stuxnet Under the Microscope - ESET”. In:http://go.eset.com/us/resources/white-papers/Stuxnet_Under_the_Microscope.pdf.Nicolas Falliere, Liam O Murchu and Eric Chien. “W32.Stuxnet Dossier”.In: http://www.symantec.com/content/en/us/enterprise/media/security_response/whitepapers/w32_stuxnet_dossier.pdf.Wikipedia. “Stuxnet”. In: http://en.wikipedia.org/wiki/Stuxnet.— . “Zero-day Attack”. In:http://en.wikipedia.org/wiki/Zero-day_attack.
Nicolas Falliere, Liam O Murchu, Eric Chien ()W32.Stuxnet Dossier 28/28 2012-04-18 28 / 28
2012-05-14
– 30 –
Grenoble INP Ensimag
4MMSR
– 30 –