4mmsr - s´ecurit´e des r´eseaux
Transcription
4mmsr - s´ecurit´e des r´eseaux
2012-05-14 Grenoble INP Ensimag 4MMSR 4MMSR - SÉCURITÉ DES RÉSEAUX TELECOM 2A, 2011-2012 Fabien Duchene - Karim Hossen - Pascal Malterre Allowed time: 2 hours NOTE: Version française – 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). – Español: como este enunciado esta solamente en Frances, si hay alguna phrase que usted no entiende, pregunta al enseñante para una translación (sin garantia, pero se va a hacerlo mejor que puede). Vous pouvez rédiger en français ou en anglais. Documents: 1 seule page A/4 recto/verso autorisée. Répondre directement sur le sujet d’examen excepté pour la synthèse de l’exercice séminaire. Être concis et précis. Répondre uniquement à ce qui est demandé et par votre propre formulation. (eg: pas de copier-coller du cours) Cet énoncé comporte une annexe. Les exercices sont indépendants. 2H pour 20 points, donc consacrer environ 6 min par point. Aucun périphérique électronique (ex: calculatrice, ordinateur ou téléphone portable) n’est autorisé. Tout cas avéré de fraude sera sévèrement sanctionné. 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 matières 1 Sécurité Réseaux (2 pts) 2 2 Cryptographie (4 pts) 3 3 Vulnérabilités Web (5 pts) 5 4 Fuzzing (1 pt) 8 5 The Onion Router et Forensics Réseaux (3 pts) 9 6 Seminaires (5 pts) 13 A Annexes 14 1/13 – Annexes: 14-30 CONTINUED 2012-05-14 –2– 1 Grenoble INP Ensimag 4MMSR Sécurité Réseaux (2 pts) 1. Hypothèse : WEP est utilisé pour assurer une(des) propriété(s) sur les données échangées entre un client sans fil et un point d’accès. – Soit t le nombre des IV (Initialization Vector) possibles . – Soit Pr(Bn ) la probabilité que deux paquets parmi n possèdent le même IV. – Et Pr(B¯n ) = 1 − Pr(Bn ) (a) Quelle(s) est(sont) cette(ces) propriété(s) de sécurité ? (b) (i) Quelle est la valeur possible de t ? (ii) Exprimer Pr(B̄2 ) comme une fonction de t. (iii) Exprimer Pr(B̄3 ) comme une fonction de t et de Pr(B̄2 ). (iv) Exprimer Pr(B¯n ) comme une fonction de t de n. (Il est facile de démontrer ceci par récurrence, ne pas démontrer, uniquement fournir la formule). (c) Sachant que : – Paul Richard Halmos (mathématicien, 1916-2006) a démontré que 1 − x < e−(x) ... combien de paquets un attaquant a-t-il besoin de collecter afin d’avoir une probabilité de 73% que 2 paquets capturés possèdent le même IV ? (ne pas effectuer le calcul, juste mettre en équation et expliquer quelle valeur vous choisissez parmi les possibles). (d) Pendant la lecture, nous avons vu une autre attaque pour laquelle le paradoxe de l’anniversaire était utile. La nommer et décrire brièvement l’objectif de l’attaquant. 2/13 – Annexes: 14-30 CONTINUED 2012-05-14 –3– 2 Grenoble INP Ensimag 4MMSR Cryptographie (4 pts) K. Hossen 2. (a) Donnez la définition de cryptanalyse et décrypter (1 ligne chacun). (b) Quelles sont les principales différences entre un algorithme de substitution mono-alphabétique et polyalphabétique ? Et citez en un de chaque. (c) On vous propose d’améliorer César en chiffrant plusieurs fois de suite. Pour un caractère clair M, le caractère chiffré correspondant en utilisant n fois César est Cn tel que : Cn = (((M +K1 )+K2 )+...+Kn ). Qu’en pensez vous ? (d) Quelles sont les principales différences entre un algorithme de chiffrement symétrique et asymétrique ? Et citez en un de chaque. (e) Une fois ingénieur, vous apprenez que votre jeu de rôle préféré utilise AES en mode ECB avec des clés de 256 bits pour chiffrer ses communications. Que faites vous ? (Si vous ne jouez pas à un jeux de rôle, que pensez vous de la sécurité du jeu ?) 3/13 – Annexes: 14-30 CONTINUED 2012-05-14 –4– Grenoble INP Ensimag 4MMSR 3. (a) Vous êtes ensuite embauché dans une entreprise qui distribue des clés RSA de 1024 bits à chacun de ses employés pour sécuriser les transmissions de données importantes. Quel est votre réaction ? Et pourquoi ? (b) Un developpeur Web vous demande ensuite un conseil pour définir comment seront stockés les mots de passe des clients dans la base de données. Que répondez vous ? (plus la statégie est bonne → plus de points) (c) Un stagiaire vous dis qu’il a préféré utiliser un CRC256 (sur 256 bits, et très rapide) pour vérifier que les bons de commande ne sont pas modifiés aprés leur création. Le CRC256 calculé est ensuite stocké, puis est accessible en lecture seule. Une fois qu’un bon va être utilisé, le CRC du bon est comparé à celui sauvegardé pour être sûr qu’il n’a pas été changé. Que pouvez vous lui dire ? Justifiez. (d) Cette fois ci c’est un ingénieur réseau qui demande un moyen rapide et sécurisé de transférer de gros documents (plusieurs Go/min) entre deux site prédéfinis. 4/13 – Annexes: 14-30 CONTINUED 2012-05-14 –5– 3 3.1 Grenoble INP Ensimag 4MMSR Vulnérabilités Web (5 pts) XSS dans un formulaire de désinscription de mailing list (2pts) Le mail suivant a été envoyé sur la mailing full disclosure : 4. (a) Définir le terme XSS et donner un exemple. (b) Quelle est la différence entre un XSS type-1 (reflected) et un XSS type-2 (stored/persistent) ? (c) Quelle(s) capacité(s) procure un XSS à un attaquant sur le navigateur d’une victime (penser aux impacts selon STRIDE) ? Si l’on dispose de ce(s) capacité(s), quelle(s) propriété(s) de sécurité sur les objets de la page en cours est un attaquant en mesure de violer (préciser les hypothèses si nécessaire) ? 5/13 – Annexes: 14-30 CONTINUED 2012-05-14 –6– Grenoble INP Ensimag 4MMSR 5. voici un extrait du code de la page web (simplifié et légèrement modifié) : sText=’Cher lecteur,<br><br>Votre demande de désinscription de l\’adresse e-mail <b>##EMAIL##</b> a bien été 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\’éditeur 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’écran suivantes et de l’extrait de code précédent, pour quelle(s) variable(s) d’entrée avez vous l’intuition qu’il y a une potentielle injection ? (indiquer brièvement pourquoi) (b) Supposons que ∀arg1 , f iltreEmail(arg1 ) = f iltreAdm(arg1 ) = arg1 Pour chaque paramètre d’entrée pour lequel existe un potentiel XSS, donner un exemple (voire 2 si différents) de valeur permettant d’exécuter le code javascript suivant : window.location=’http://bit.ly/Iqs6OA’; 6/13 – Annexes: 14-30 CONTINUED 2012-05-14 –7– 3.2 Grenoble INP Ensimag 4MMSR Attaques NoSQL : l’exemple de MongoDB (3 pts) Une base de données 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 a problem.” -MongoDB Developer FAQ Ce code est extrait de l’article de Nicolas Viot sur les attaques NoSQL publié dans le magazine MISC 60 http://bit.ly/HCsIMu : 1 2 3 4 <?php // . . . $m = new Mongo ( ) ; $db = $m−>database name ; 5 6 7 8 9 10 $ r e s = $db−>u s e r −>findOne ( ’ $where ’ => ” this . login == ’ ” . $ POST [ ’ l o g i n a ’ ] . ” ’ && t h i s . password == ’ ” . $ POST [ ’ passworda ’ ] . ” ’ ”); 11 12 13 14 15 16 17 18 i f ( ! $res ) { print ( ” a u t h e n t i c a t i o n f a i l e d ” ) ; exit ( 1 ) ; } // a u t h e n t i c a t e d // . . . ?> A la ligne 5, on fait une recherche dans la table user, et on cherche un enregistrement pour lequel le champ login vaut la valeur du paramètre d’entrée login envoyée par méthode POST ($ POST[’logina’]) ET la valeur de password vaut $ POST[’passworda’]. Pour accéder au champ eye color d’une table head, on utilise : head.eye color (this est la table courante) Quelques opérateurs : – k signifie OR – && signifie AND 6. Hypothèses : – vous connaissez un couple valide de login + mot de passe (eg : megamo et rano.com) – on accède à l’application via http://vulnerab.le/ Ecrire en pseudo-code un programme qui récupère la valeur du champ cellphone de l’enregistrement pour lequel email=’[email protected]’ dans la table customers par une attaque Blind NoSQL Injection. 7/13 – Annexes: 14-30 CONTINUED 2012-05-14 –8– 4 Grenoble INP Ensimag 4MMSR Fuzzing (1 pt) Questionnaire à Choix Multiples avec degré de certitude : – Toute réponse correcte (resp. erronée) vous fait gagner (resp. perdre) des points. – Cocher les réponses que vous estimez correctes – Indiquer à côté de chaque réponse possible (que vous l’estimiez vrai ou fausse) votre degré de confiance (20, 40, 60, 80 ou 100%) Questions 1. Pour donner des résultats exploitables, une méthode de fuzzing doit être : Réponses .....% Reproductible .....% Monitoré .....% Automatisé .....% Exhaustif .....% Intelligent 2. Parmi les suivantes, quelles sont des métriques de couverture appropriées dans le cadre d’un test en blackbox d’un serveur protocolaire FTP ? .....% Nombre d’etats traversés .....% Nombre de primitives de fuzz appliquées par transition .....% Nombre de lignes du code source exécutées .....% Nombre d’instructions assembleur exécutées .....% Nombre de blocs d’instructions assembleur exécutés 8/13 – Annexes: 14-30 CONTINUED 2012-05-14 –9– 5 Grenoble INP Ensimag 4MMSR The Onion Router et Forensics Réseaux (3 pts) P. Malterre 5.1 TOR 7. (a) Rappeler brièvement le principe d’un échange Diffie-Hellman. (b) Quelle est la principale attaque contre ce protocole ? 8. Le schéma ci-dessous représente une session dans laquelle un client effectue, au travers du réseau Tor, une simple requête en HTTP vers la page d’accueil d’un site web. (a) en supposant qu’aucun circuit n’a été établi au préalable, combien d’échanges Diffie-Hellman sont nécessaires avant que le client puisse récupérer le résultat de sa requête ? (b) pour ces différents échanges, indiquer quels sont les moyens éventuels permettant de prendre en compte l’attaque mentionnée précédemment. 9/13 – Annexes: 14-30 CONTINUED 2012-05-14 – 10 – Grenoble INP Ensimag 4MMSR 9. L’écoute passive de trafic entre deux noeuds Tor permet de mettre en évidence l’utilisation du certificat ci-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 clé publique encodée dans ce certificat ? (b) la durée de validité est-elle correcte ? pourquoi ? 10/13 – Annexes: 14-30 CONTINUED 2012-05-14 – 11 – 5.2 Grenoble INP Ensimag 4MMSR Détection d’intrusions Prendre connaissance du schéma réseau ci-dessus. On peut distinguer différentes zones : – une zone WiFi de type hotspot, il n’y a aucun filtrage et l’accès à Internet est direct ; – une zone réservée aux partenaires, accessible uniquement au moyen d’une passerelle VPN/IPSEC et permettant d’accéder à 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 également dans cette zone une passerelle VPN/IPSEC pour les utilisateurs nomades ; – une DMZ contenant un proxy web (accès au net pour les utilisateurs), ainsi qu’un relais DNS ; – différents sous-réseaux (utilisateurs et serveurs). 10. (a) Donner un exemple plausible et cohérent d’un scénario d’intrusion au sein de ce système d’information. (b) Décrire les différents moyens de détection réseau qui pourraient être mis en oeuvre pour détecter l’intrusion imaginée précédemment, en précisant : – 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 – 6 Grenoble INP Ensimag 4MMSR Seminaires (5 pts) Choisissez une présentation parmi celles proposés et répondez aux questions ci-après. Il est interdit de choisir le sujet que vous avez présenté. – Wi-Fi Advanced Fuzzing - Laurent BUTTI – France Télécom / Orange Division R&D - Black-Hat EU 2007 – 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 présentation que vous avez fait à la classe : (b) Indiquer le titre du sujet choisi pour cet examen : 12. En vous aidant de la présentation Appendice A - Annexes dont le dbut est en page 14 et de vos connaissances, rédiger une synthèse (texte + schémas importants) du papier choisi à destination d’un élève qui a suivi le cours de sécurité des réseaux 4MMSR 2011-2012 sans avoir assisté aux séminaires (il est uniquement venu aux sessions de cours et il a fait tous les TP). Votre esprit critique vous permettra de noter que des erreurs peuvent susbister dans certaines versions finales présentées par les élèves. Sera en particulier valorisé le fait de : – relever des erreurs véritables dans la présentation (ne pas en inventer !) – pour chaque attaque préciser explicitement – quelle séquence d’entrées doit être envoyée au système – quelle(s) propriété(s) de sécurité est(sont) violée(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 méthode n’ayant pas cette limitation Afin de guider votre discours, voici une idée de plan : (a) problème adressé (b) méthode de résolution proposée (c) résultats d’expérimentations (d) contre-mesures (e) limitations (f) conclusion 13/13 – Annexes: 14-30 CONTINUED 2012-05-14 – 14 – A A.1 Grenoble INP Ensimag 4MMSR Annexes Wi-Fi Advanced Fuzzing - Laurent BUTTI – France Télécom / Orange Division R&D - Black-Hat EU 2007 sous-section A.3 - W32.Stuxnet Dossier, Nicolas Falliere, Liam O Murchu, and Eric Chien - 2011 dont le dbut 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 le dbut 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 le dbut est en page 24 – 14 – CONTINUED Summary ENSIMAG - 4MMSR - Network Security – Seminars Laurent Butti – BlackHat Europe - 2007 Corentin Delpech [email protected] Lucas Fontaine [email protected] March 12th, 2012 Corentin DELPECH - Lucas FONTAINE ENSIMAG 2A TELECOM - 2012 2013 1 /29 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 ? March 12th, 2012 Fuzzing What is fuzzing ? Implementation of a fuzzer Discovered vulnerabilities Fuzzers limitation, countermeasures Demonstration (!) Final words, summary Corentin DELPECH - Lucas FONTAINE ENSIMAG 2A TELECOM - 2012 2013 Historic, Wi-Fi standards Technical specificities, Networking Modes Introduction Introduction 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 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 3 /29 Figure 2 – A Network Figure 1 – Democratization of wireless hot spots March 12th, 2012 Corentin DELPECH - Lucas FONTAINE ENSIMAG 2A TELECOM - 2012 2013 5 /29 March 12th, 2012 Corentin DELPECH - Lucas FONTAINE ENSIMAG 2A TELECOM - 2012 2013 6 /29 Technical specificities, Wi-Fi Frames Technical specificities, Wi-Fi Frames Introduction Introduction 802.11 frames : Example of a frame : Data frames Control frames Authentification, Asssociation Request, Assocation Responce, Resassociation Responce, Dissociation, Beacon, Probe Request,Probe responce, Request To Send, Clear To Send, Acknolegement Management frames : MAC frame format : Figure 4 - Example of a frame with WireShark March 12th, 2012 Corentin DELPECH - Lucas FONTAINE ENSIMAG 2A TELECOM - 2012 2013 Figure 3 - Mac frame format 7 /29 March 12th, 2012 Corentin DELPECH - Lucas FONTAINE ENSIMAG 2A TELECOM - 2012 2013 Technical specificities, Wi-Fi Frames Which issues ? Introduction Security of Wi-Fi networks 3 class frames : class 1 : Infrastructure/network sided security weak Probe Request / Response , Beacon , Athentification Request / Responce, Deauhentication Client sided security weak class 2 : Remote attack (in the victim’s radio coverage) with kernel-mode code remote execution ! 8 /29 (Re)association Request / Response Deassociation class 3 : Figure 6 – Example of Wi-Fi remote attack Deauthentication Figure 5 - 802.11 States for 1 client and server March 12th, 2012 Corentin DELPECH - Lucas FONTAINE ENSIMAG 2A TELECOM - 2012 2013 9 /29 March 12th, 2012 Corentin DELPECH - Lucas FONTAINE ENSIMAG 2A TELECOM - 2012 2013 11 /29 How to perform vulnerability test ? What is fuzzing ? Security of Wi-Fi networks Fuzzing Closed source drivers Open source drivers Black box testing Black & white box testing Reverse engineering Source code auditing Lucas ! Corentin & “Black box” software testing technique “Automatically generate and inject malformed or semi-malformed data in order to find implementation bugs” [OWASP.ORG] Fuzz (random data) Figure 7 – Do you know what is inside the box ? Corentin DELPECH - Lucas FONTAINE ENSIMAG 2A TELECOM - 2012 2013 March 12th, 2012 12 /29 • Malformed data • Semimalformed data Input of a program Which behavior ? March 12th, 2012 Fuzzing Fuzzing Element ID (1) • • Length (1) Information (Length) 14 /29 Ethernet connectivity useful for bug detection (ping and keepalive TCP connection) Figure 9 – Information Element “SSID” of a 802.11 frame 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} March 12th, 2012 New vulnerability discovered ! Corentin DELPECH - Lucas FONTAINE ENSIMAG 2A TELECOM - 2012 2013 Implementation of a fuzzer Figure 8 – Structure of an “Information Element” Defects and implementations bugs to correct Fuzzing is OK to discover the most obvious bugs KO for the most complex ones (not smart enough !) Implementation of a fuzzer Information Element If program fails • Some IE have a fixed or maximum length • Possible overflow of the ‘static’ buffer receiving the Information if “Length” not checked Corentin DELPECH - Lucas FONTAINE ENSIMAG 2A TELECOM - 2012 2013 Figure 10 – Architecture overview 15 /29 March 12th, 2012 Corentin DELPECH - Lucas FONTAINE ENSIMAG 2A TELECOM - 2012 2013 16 /29 Implementation of a fuzzer Fuzzing Discovered vulnerabilities by Laurent BUTTI with his Wi-Fi fuzzing 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 ? - NetGear MA521 Wireless Driver Long Rates Overflow Utilisation d’une trame avec un IE “Rates” trop long (longueur maximale de 8 octets normalement) Solutions - D-Link DWL-G650+ (A1) Wireless Driver Long TIM Overflow Utilisation d’une trame avec un IE “TIM” trop long • 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 ! - 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 March 12th, 2012 Corentin DELPECH - Lucas FONTAINE ENSIMAG 2A TELECOM - 2012 2013 - NetGear WG311v1 Wireless Driver Long SSID Overflow Utilisation d’une trame avec un IE “SSID” trop long (longueur maximale de 32 octets normalement) 17 /29 March 12th, 2012 Corentin DELPECH - Lucas FONTAINE ENSIMAG 2A TELECOM - 2012 2013 19 /29 Discovered vulnerabilities by Laurent BUTTI with his Wi-Fi fuzzing Discovered vulnerabilities by Laurent BUTTI with his Wi-Fi fuzzing Figure 12, 13, 14 « net80211/ieee80211_scan.c » MadWiFi source code Function giwscan_cb Figure 11 - Linux Kernel « oops » March 12th, 2012 Corentin DELPECH - Lucas FONTAINE ENSIMAG 2A TELECOM - 2012 2013 20 /29 March 12th, 2012 Corentin DELPECH - Lucas FONTAINE ENSIMAG 2A TELECOM - 2012 2013 21 /29 Discovered vulnerabilities by Laurent BUTTI with his Wi-Fi fuzzing Fuzzer Limitations, counter-measure Limitations : the developer's comprehension of the protocol cannot help you to find Complex 'Bugs' Figure 15 needs to manage Wi-Fi states « net80211/ieee80211_scan.c » MadWiFi source code needs to have the same level of performance as the client Function encode_ie needs to understand bugs activated by fuzzer cannot be sure a frame was analysed Driver's patches may prevent them. Or add some ! Or only partially correct them Figure 16 – Logo of madwifi March 12th, 2012 Corentin DELPECH - Lucas FONTAINE ENSIMAG 2A TELECOM - 2012 2013 22 /29 Conclusion • 24 /29 Conclusion • Other things to do : Many vulnerabilities came with 802.11 • Fuzzing is the best way to make testing • Tests wireless cards with : o o March 12th, 2012 Corentin DELPECH - Lucas FONTAINE ENSIMAG 2A TELECOM - 2012 2013 o o o his states extensions are coming wireless devices : WUSB, Bluetooth 3.0, … fuzzing access point 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. March 12th, 2012 Corentin DELPECH - Lucas FONTAINE ENSIMAG 2A TELECOM - 2012 2013 27 /29 March 12th, 2012 Corentin DELPECH - Lucas FONTAINE ENSIMAG 2A TELECOM - 2012 2013 28 /29 Plan Ensimag-4MMSR-Network Security 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+ Student Seminar Rainbow Tables Probabilistes ++ *+ * Alain Schneider--Groupe LEXSI- 1 [email protected] - [email protected] 3/28/12 Introduction1/2: 2 [email protected] - [email protected] Introduction 2/2: 3 [email protected] - [email protected] 3/28/12 3/28/12 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. 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 4 [email protected] - [email protected] 3/28/12 Rainbows*table*1/4: Rainbows*table*2/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!). 6 [email protected] - [email protected] 3/28/12 Rainbows*table*3/4: Idea : different reduction function Collision in “xccd” => same chain end ! => Redundandcy => Memory Loss http://www.mieuxcoder.com/2008/01/02/rainbow-tables/ 7 [email protected] - [email protected] 3/28/12 Rainbows*table*4/4: suppression of collision - 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! 8 [email protected] - [email protected] 3/28/12 9 [email protected] - [email protected] 3/28/12 Problem Statement1/3: Probabilistic Rainbow Table: Passwords are not RANDOM The classic rainbow tables list all possible combinations of a certain alphabet until a certain length. There are Rainbow Tables based on dictionaries. Represented passwords by Hidden Markov Model. Constraint, time and Memory => Low Balance Using a reference set of passwords (Rockyou[1]) we can attribute an Improbability rate to evrey transition. There are Rainbow Tables hybrid I(x y) = x y improbability transition - Find new Rainbow tables to cope with limited time and memory 1) Rockyou. : social application site, « 32 millions available password » 10 [email protected] - [email protected] 3/28/12 Storing passwords in a Markov Tree Generate Password : -Sets a maximal capital of improbability. 14 Changing calculation strategy*1/2*: Table Generated when traversing the automate CPU Not adapted Limited Distributed calculation Appropriate for Rainbow Tables generation. Expensive not adapted with mobility context -Move down the tree each time subtracting the capital of each node. Choice of I(max) => genarate more accurent passwor 15 [email protected] - [email protected] 3/28/12 www.techcrunch.com/2009/12/14/rockyou-hacksecurity-myspace-facebook-passwords/ [email protected] - 3/28/12 [email protected] 16 GPU : one of solutions for a mobility context (next slide). [email protected] - [email protected] 3/28/12 Results 1/2 Results 2/2 educing access time to the Nth password. 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/ 18 [email protected] - 3/28/12 [email protected] Counter-measures : 19 [email protected] - 3/28/12 [email protected] Limitation : Salt Example : 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 - Use of national character/ exotic ( é,ç,… ) - Truly random numbers through a simple USB key And quantum mechanics [1]. Constraints related to implenting calculations on GPU Long chains = long cracking time 1) cf : http://www.idquantique.com/true-random-number-generator/products-overview.html 21 [email protected] - 3/28/12 [email protected] 22 [email protected] - 3/28/12 [email protected] W32.Stuxnet Dossier, Installation and Propagation Ensimag-4MMSR-Network Security - Student Seminar1 [email protected], [email protected], [email protected] Nicolas Falliere (Senior Software Engineer) Liam O Murchu (Development Manager) Eric Chien (Technical Director) part of Symantec Security Response (antivirus and computer security research group, over 400 full-time employees) 2012-04-18 1 Authors Symantec Founded 1982 Headquarters: Mountain View, California providing security, storage and systems management solutions e. g. Norton products https://ensiwiki.ensimag.fr/index.php/4MMSR-Network_Security-2011-2012 Nicolas Falliere, Liam O Murchu, Eric Chien () W32.Stuxnet Dossier 1/28 2012-04-18 Outline 1 / 28 Nicolas Falliere, Liam O Murchu, Eric Chien () W32.Stuxnet Dossier Introduction 2012-04-18 2 / 28 2012-04-18 5 / 28 Stuxnet 1 Introduction 2 Architecture 3 Injection first discovered in June 2010 4 Preparation 5 Propagation targets industrial control systems with PLC (Programmable Logic Controller) made by Siemens 6 Counter measures 7 Conclusion Nicolas Falliere, Liam O Murchu, Eric Chien () W32.Stuxnet Dossier 2/28 computer worm first infected systems June 2009 for Windows XP, ME, 2000, 2003, Vista, 7, Server 2008 3/28 2012-04-18 3 / 28 Nicolas Falliere, Liam O Murchu, Eric Chien () W32.Stuxnet Dossier 5/28 Introduction Introduction Distribution Attack Scenario measured Sept. 29, 2010 (by monitoring traffic to Command & Control server) Nicolas Falliere, Liam O Murchu, Eric Chien () W32.Stuxnet Dossier Architecture 6/28 2012-04-18 Architecture 6 / 28 Nicolas Falliere, Liam O Murchu, Eric Chien () W32.Stuxnet Dossier Injection 2012-04-18 7 / 28 Injection DLL file Nicolas Falliere, Liam O Murchu, Eric Chien () W32.Stuxnet Dossier 7/28 Trusted processes there is no stuxnet-process, stuxnet hides in trusted processes injection is performed on every call of an export injects into trusted process goal: hide from antimalware 9/28 2012-04-18 9 / 28 Nicolas Falliere, Liam O Murchu, Eric Chien () W32.Stuxnet Dossier Product Kaspersky KAV Mcafee AntiVir BitDefender Etrust F-Secure Symantec Symantec Common Client Eset NOD32 Trend Pc-Cillin Windows Windows Windows 11/28 process name avp.exe Mcshield.exe avguard.exe bdagent.exe UmxCfg.exe fsdfwd.exe rtvscan.exe ccSvcHst.exe ekrn.exe tmpproxy.exe Lsass.exe Winlogon.exe Svchost.exe 2012-04-18 11 / 28 Preparation 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 Preparation Export 15 Export 15 Zero-day exploit 12/28 2012-04-18 Zero-day exploit 12 / 28 Nicolas Falliere, Liam O Murchu, Eric Chien () W32.Stuxnet Dossier Preparation 13/28 MS10-092: 0-day Task Scheduler 2012-04-18 13 / 28 MS10-092: 0-day Task Scheduler target platform: Windows Vista and higher (introduction of new Task Scheduler) exploits computer application vulnerabilities that are unknown to others or the software developer before Vulnerability window: time period between first exploitation and development of counter measures goal: escalate privileges to SYSTEM task information as xml file read- and writable by user integrity protected by weak CRC32 checksum Attack vector: a concrete way to exploit vulnerability Nicolas Falliere, Liam O Murchu, Eric Chien () W32.Stuxnet Dossier 14/28 2012-04-18 14 / 28 Nicolas Falliere, Liam O Murchu, Eric Chien () W32.Stuxnet Dossier 15/28 2012-04-18 15 / 28 Preparation MS10-092: 0-day Task Scheduler Propagation MS10-092: 0-day Task Scheduler Outline Attack 1 create task with low privileges 2 read task configuration file from %SystemRoot%\system32\Tasks 3 modify task configuration file (change privileges) 4 calculate CRC32 of original file and adapt altered file to match it 5 run task Nicolas Falliere, Liam O Murchu, Eric Chien () W32.Stuxnet Dossier Propagation Peer-to-peer 16/28 2012-04-18 Peer-to-peer 1 Introduction 2 Architecture 3 Injection 4 Preparation 5 Propagation 6 Counter measures 7 Conclusion 16 / 28 Nicolas Falliere, Liam O Murchu, Eric Chien () W32.Stuxnet Dossier Propagation WinCC 17/28 2012-04-18 17 / 28 WinCC implements a Microsoft RPC server and client automatic updates in LAN Nicolas Falliere, Liam O Murchu, Eric Chien () W32.Stuxnet Dossier WinCC (Windows Control Center) for supervision and controlling of Siemens’ industrial systems Microsoft SQL Server for logging Vulnerability: hardcoded publicly known and documented password in SQL server 18/28 2012-04-18 18 / 28 Nicolas Falliere, Liam O Murchu, Eric Chien () W32.Stuxnet Dossier 19/28 2012-04-18 19 / 28 Propagation WinCC Propagation Infecting WinCC computers Network shares connect as Administrator using password ’2WSXcder’ Two methods used: search for accessible network shares create table with hex representation of main Stuxnet DLL: search for other computers with same user accounts as local user for all available credentials, try access $admin and $C drop stuxnet-dll on system schedule task to execute stuxnet-dll CREATE TABLE sysbinlog ( abin image ) INSERT INTO sysbinlog VALUES (0x...) write dll to disk via OLE Automation Stored Procedures Windows RPC Vulnerability: MS08-67 add as stored procedure and execute buffer overflow in Windows RPC already used by Conficker more sophisticated implementation (employes recent techniques like Return Oriented Programming) SET @ainf = @aind + ‘\\sql%05x.dbi’ EXEC sp_addextendedproc sp_dumpdbilog, @ainf EXEC sp_dumpdbilog Nicolas Falliere, Liam O Murchu, Eric Chien () W32.Stuxnet Dossier Propagation Network shares Printer spooler vulnerability 20/28 2012-04-18 20 / 28 Nicolas Falliere, Liam O Murchu, Eric Chien () W32.Stuxnet Dossier Propagation Printer spooler vulnerability 21/28 Propagation via removable drive 2012-04-18 21 / 28 23/28 2012-04-18 23 / 28 LNK Vulnerability: MS10-046 discovered April 2009, fixed Sept 14, 2010 precondition: printer shared on target goal: remote code execution Attack connect to print spooler as guest print two ”documents” to files in %SYSTEM%-directory the files are ”printed” with print spooler’s instead guest’s of privileges winsta.exe æ stuxnet.dll wbem\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 Nicolas Falliere, Liam O Murchu, Eric Chien () W32.Stuxnet Dossier Counter measures Conclusion Counter measures Conclusion For Stuxnet in particular: largest and costliest development effort in malware history (estimation: 10 million $) install recent security updates (for all used vulnerabilities exist fixes now) 4 zero-day exploits For similar future malware 2 compromised certificates none, only impede request software manufactures to fix known vulnerabilities quickly install recent security updates isolation (take network, usb-sticks, ... into account) Nicolas Falliere, Liam O Murchu, Eric Chien () W32.Stuxnet Dossier Conclusion For Further Reading 25/28 2012-04-18 only nation state capable to produce it æ cyberweapon 25 / 28 Nicolas Falliere, Liam O Murchu, Eric Chien () W32.Stuxnet Dossier Aleksandr Matrosov Eugene Rodionov, David Harley and Juraj Malcho. “Stuxnet Under the Microscope - ESET”. In: http://go.eset.com/us/resources/whitepapers/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 27/28 2012-04-18 27 / 28 2012-05-14 – 30 – Grenoble INP Ensimag 4MMSR