![Page 1: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/1.jpg)
ADF 2009 Outils de recherche de vulnérabilités
Magali Contensin [email protected]
Thierry Dostes [email protected]
Maurice Libes [email protected]
Kai Poutrain [email protected]
![Page 2: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/2.jpg)
Plan
1. Google Hacking
2. Prise d’empreinte
3. Forger des requêtes
4. Audit de configuration PHP
5. Audit de code
6. Scanner de vulnérabilités
![Page 3: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/3.jpg)
1. Google Hacking� Opérateurs de recherche avancée
Opérateur Recherche
intitle:mot mot dans titre (élément HTML title).
allintitle: liste_de_mots mots dans titre (l’ordre ne compte pas)
inurl:mot mot dans l’URL de la page
allinurl: liste_de_mots mots dans l’URL de la page (ignore la ponctuation .. /)
intext:mot mot dans le corps du texte de la page (élément HTML body)
inanchor:site ou mot mot ou domaine dans les liens de la page (élément HTML A)
filetype:type un type de document (xls, pdf, doc, …)
site:domaine mot mot pour le nom de domaine du site indiqué.
site:cnrs.univ-mrs.fr
![Page 4: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/4.jpg)
1. Google Hacking� Opérateurs de recherche avancée
Caractère Signification
+expr Prendre en compte un mot exclus automatiquement (et, de, …)
-expr -intitle:php = supprimer les pages qui ont php dans le titre
~expr mot et synonymes
* un mot : ex "un * DVD" => un lecteur DVD
"x y" Recherche la phrase exacte
Recherche par défaut = AND entre tous les termes Opérateurs AND, OR
�Consulter sans laisser de trace sur le serveur
![Page 5: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/5.jpg)
1. Google Hacking�Serveurs HTTP
intitle:"index of" intext:"Apache/2*" intext:"server at"
intitle:"index of" intext:"Microsoft.IIS/" intext:"server at"
![Page 6: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/6.jpg)
1. Google Hacking� Informations sur le système
"output produced by syswatch""output produced by syswatch"
![Page 7: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/7.jpg)
1. Google Hacking�Présence d’applications
inurl:awstats -intitle:awstats
![Page 8: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/8.jpg)
1. Google Hacking� Listing de répertoires
intitle:Index -inurl:index intranet
![Page 9: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/9.jpg)
1. Google Hacking� Erreurs MySQL
mysql error -intitle:error -intitle:php -forum -forums -intitle:mysql
![Page 10: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/10.jpg)
1. Google Hacking� Erreurs MySQL
mysql error -intitle:error -intitle:php -forum -forums -intitle:mysql
![Page 11: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/11.jpg)
1. Google Hacking� Informations confidentielles
"not for distribution" confidential
filetype:ctt msn liste de contacts msn
inurl:ws_ftp.ini intext:uid mots de passe wsftp
[pbi.u.vipex.net]
HOST=pbi. u.vipex.net
UID=root
PWD=V62C340CBEBBC57D5876CBCA9C5372E40A6A87BAFB06D796B76
PASVMODE=0
TIMEOFFSET=0
DIR="/usr/"
http://www.thedmgroup.com/
root:ad7HPlneWG74M:0:0:System Administrator:/:noshell
steve:PkLENJODCap46:2805:100:Steve Dreska:/usr/home/steve:mail,10
chris:c.LEWz7/HV9mQ:2805:100:Chris Bregman:/usr/home/chris:mail,10
(inurl:passwd.bak OR inurl:passwd.old) intext:root
![Page 12: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/12.jpg)
Plan
1. Google Hacking
2. Prise d’empreinte
3. Forger des requêtes
4. Audit de configuration PHP
5. Audit de code
6. Scanner de vulnérabilités
![Page 13: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/13.jpg)
2. Prise d’empreinte� Recherche du langage de script
� extensions des fichiers (.jsp, .asp, .php)� cookies (JSESSIONID, ASPSESSIONID, PHPSESSID)
�messages d’erreur pour le site (google hacking)� présence d’applications (awstats, phpmyadmin, …)� présence d’applications (awstats, phpmyadmin, …)
� easter eggs PHP?=PHPE9568F34-D428-11d2-A769-00AA001ACF42?=PHPE9568F35-D428-11d2-A769-00AA001ACF42?=PHPE9568F36-D428-11d2-A769-00AA001ACF42
![Page 14: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/14.jpg)
2. Prise d’empreinte� Recherche du système (Windows/Unix)
� sensibilité à la casse dans l’URL� structure des répertoires et noms
� applications (langage utilisé)
� informations données par le serveur web ou les scripts� informations données par le serveur web ou les scripts
![Page 15: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/15.jpg)
2. Prise d’empreinte� Recherche du serveur web
� informations données par des scripts (google hacking)
� informations données par le serveur
� informations données par netcrafthttp://toolbar.netcraft.com/site_report?url=http://...
![Page 16: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/16.jpg)
2. Prise d’empreintehttp://toolbar.netcraft.com/site_report?url=http://...
![Page 17: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/17.jpg)
2. Prise d’empreinte�Recherche du serveur web
� différences : ●lexicales (ponctuation, phrases)●syntaxiques (ordre des champs, valeurs listées)●sémantiques (interprétation différente)●sémantiques (interprétation différente)
Requête telnet port 80 type de test Apache/2.0.x IIS/5
GET / HTTP/5.0 erreur protocole 400 Bad Request 200 OK
GET / xxx/1.0 erreur protocole 200 OK 400 Bad Request
GOT / HTTP/1.0 erreur méthode Allow:GET,HEAD,...
501 Method Not Implemented
501 Not Implemented
DELETE / HTTP/1.0 méthode interdite 405 Method Not Allowed 403 Forbidden
GET /xxx HTTP/1.0 fichier inexistant 404 Not Found 404 Object Not Found
HEAD / HTTP/1.0 ordre des champs Date:
Server:
Server:
Date:
OPTIONS * HTTP/1.1 méthodes supportées Allow:GET,HEAD,POST,... Public: OPTIONS, TRACE,…
GET / HTTP/1.0 fichier par défaut Test Page for Apache Installation Welcome to IIS 5.0
![Page 18: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/18.jpg)
2. Prise d’empreintehttprint Présentation (1)
Catégorie Outil de fingerprinting
Public ASR
Editeur http://www.net-square.com/httprint
Licence Gratuit pour une utilisation non commerciale
FonctionnalitésPrise d’empreinte d’un serveur web
OS Linux, Windows, MacOSX
![Page 19: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/19.jpg)
2. Prise d’empreintehttprint Installation (2)
Durée 5 mn
Procédure � Télécharger httprint 301: (released on 22/12/05)
http://www.net-square.com/httprint/#downloads
� Décompresser l’archive� Décompresser l’archive
httprint Tests (3)
Exécuter Windows GUI Linux/MacOSX commande
httprint -h <host> -s signatures.txt
httprint Résultats (4)
Sortie HTML, CSV, XML
![Page 20: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/20.jpg)
2. Prise d’empreinte
![Page 21: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/21.jpg)
2. Prise d’empreintehttprint Conclusion (5)
+
� Rapide à installer et tester� Résultats clairs� Base de signatures facile à mettre à jour (copier le résultat obtenu pour un serveur connu, coller dans le fichier texte)fichier texte)
-� Traces dans les logs
� Base de signatures plus maintenue
![Page 22: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/22.jpg)
2. Prise d’empreintehttprecon Présentation (1)
Catégorie Outil de fingerprinting
Public ASR
Editeurhttprecon projecthttp://www.computec.ch/projekte/httprecon
Licence GPL
FonctionnalitésPrise d’empreinte d’un serveur web (analyse de banière, status code, ordre en-tête)
OS Windows
![Page 23: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/23.jpg)
2. Prise d’empreintehttprecon Installation (2)
Durée 5 mn
Procédure � Télécharger httprecon 5.3 : (released on 17/01/09)
http://www.computec.ch/projekte/httprecon/?s=downloadhttp://www.computec.ch/projekte/httprecon/?s=download
� Décompresser l’archive
![Page 24: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/24.jpg)
2. Prise d’empreintehttprecon Tests (3)
Exécuter Windows GUI : entrer port&serveur cliquer sur Analyze
Procédure � 9 tests :� GET existing GET / HTTP/1.1� GET long request GET /uuu…uuu HTTP/1.1� GET non existing GET /kI6jM4.html HTTP/1.1� GET non existing GET /kI6jM4.html HTTP/1.1� GET wrong protocol GET / HTTP/9.8�HEAD existing HEAD / HTTP/1.1� Options common OPTIONS / HTTP/1.1� Delete existing DELETE / HTTP/1.1� Test method TEST / HTTP/1.1� Attach Request
GET /etc/passwd?format=%%%&xss=\"><script>alert('xss');</script>&traversal=../../&sql='%20OR%201; HTTP/1.1
Configurable menu Configuration > Edit settings
![Page 25: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/25.jpg)
2. Prise d’empreintehttprecon Résultats (4)
Sortie HTML, texte, interface windows
![Page 26: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/26.jpg)
Plan
1. Google Hacking
2. Prise d’empreinte
3. Forger des requêtes
4. Audit de configuration PHP
5. Audit de code
6. Scanner de vulnérabilités
![Page 27: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/27.jpg)
3. Altération des données� Modification de la query string
� Ajout de données� Suppression de données� Valeurs inattendues
article.php?id=25&action=voirarticle.php?id=25&action=voir
� Modification d’un formulaire (GET/POST)
� Enregistrement du formulaire sur le disque� Changer attribut action�Modification (ajout/suppression de champs, valeurs)� Envoi du formulaire
![Page 28: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/28.jpg)
3. Altération des données� Forger la requête : telnet port 80
� En-tête : cookies, referer, user-agent, ...� Corps : données
$ telnet www.resa_vacances.fr 80
Trying 199.199.99.99...Trying 199.199.99.99...
Connected to www.resa-vacances (199.199.99.99).
Escape character is '^]'.
POST /reservation.php HTTP/1.1
Host: www.vacances.fr
Cookie: lang=fr;id=214535E1FA
User-Agent: Firefox
Content-Type: application/x-www-form-urlencoded
Content-Length: 11
lieu=venise
![Page 29: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/29.jpg)
3. Altération des données� Tamper Data
�Modification avant envoi :●En-tête : cookie, referer, user-agent, ...●Corps : données
�Rejouer des requêtes�Rejouer des requêtes
![Page 30: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/30.jpg)
3. Altération des données� Tamper Data
![Page 31: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/31.jpg)
3. Altération des données� Tamper Data
http://gecko.test.fr/traitement/ident.php
![Page 32: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/32.jpg)
� Tamper Data
3. Altération des donnéesdonnées
En-tête HTTP
![Page 33: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/33.jpg)
3. Altération des données� Tamper Data
![Page 34: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/34.jpg)
3. Altération des données� Tamper Data
![Page 35: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/35.jpg)
3. Altération des données� Tamper Data
![Page 36: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/36.jpg)
Plan
1. Google Hacking
2. Prise d’empreinte
3. Forger des requêtes
4. Audit de configuration PHP
5. Audit de code
6. Scanner de vulnérabilités
![Page 37: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/37.jpg)
4. Audit de configuration PHP
PHPSecInfo Présentation (1)
Catégorie Outil d’audit de configuration
Public ASR
Editeur http://phpsec.org
Licence NewBSD
Fonctionnalités - Test des valeurs de directives PHP- conseils de paramétrage pour la sécurité
Langage Ecrit en PHP, audit PHP 5.2.x et antérieur
![Page 38: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/38.jpg)
4. Audit de configuration PHP
PHPSecInfo Installation (2)
Durée 5 mn
Procédure � Télécharger phpsecinfo version 0.2.1 (2007)
http://phpsec.org/projects/phpsecinfohttp://phpsec.org/projects/phpsecinfo
� Décompresser l’archive
�Mesures de sécurité :
o renommer le répertoire (par ex : audit_tool)
omettre des restrictions d’accès (.htaccess)
� Placer le répertoire dans le site web
![Page 39: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/39.jpg)
4. Audit de configuration PHP
PHPSecInfo Tests (3)
Exécuter Entrer l’URL du script principal :http://…/audit_tool/index.php
Tests réalisés � CoreTests réalisés � Coreo Directives : allow_url_fopen, allow_url_include, display_errors, expose_php, file_uploads, magic_quotes_gpc, memory_limit, open_basedir, post_max_size, register_globals, upload_max_filesize, upload_tmp_diro Autres tests : user_id, group_id
�Curl : file_support�Directive CGI : force_redirect�Directives de session : save_path, use_trans_sid
![Page 40: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/40.jpg)
4. Audit de configuration PHP
PHPSecInfo Résultats (4)
Sortie HTML
Format Tableaux contenant Format Tableaux contenant plusieurs sections :� tests exécutés
o Coreo Sessiono Curlo CGI
� tests non exécutés� résumé
![Page 41: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/41.jpg)
4. Audit de configuration PHP
PHPSecInfo Résultats (5)
Section Tests exécutés
Infos Code (rouge/warning, orange/notice, vert/pass), message, lien
![Page 42: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/42.jpg)
4. Audit de configuration PHP
PHPSecInfo Résultats (6)
Section Tests non exécutés
Infos Message indiquant pourquoi test non éxecuté, lien hypertexte
![Page 43: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/43.jpg)
4. Audit de configuration PHP
PHPSecInfo Résultats (7)
Section Résumé
Infos Nombre de warning, notice et pass
![Page 44: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/44.jpg)
4. Audit de configuration PHP
PHPSecInfo Conclusion (8)
+
� Rapide à installer et tester� Résultats clairs (codes couleur, messages, liens hypertextes)� Conseils
� Identifie des problèmes potentiels, certains réglages
-
� Identifie des problèmes potentiels, certains réglages déconseillés peuvent être nécessaires à l’environnement de production (file_uploads, upload_max_filesize)
� Réglages de sécurité ignorés (use_only_cookies, disable_functions)
!� Régler correctement le php.ini ne remplace pas les bonnes pratiques de programmation
![Page 45: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/45.jpg)
Plan
1. Google Hacking
2. Prise d’empreinte
3. Forger des requêtes
4. Audit de configuration PHP
5. Audit de code
6. Scanner de vulnérabilités
![Page 46: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/46.jpg)
RATS Présentation (1)
Catégorie Outil d’audit de code
Nom Rough Auditing Tool for Security
Public Développeurs
5. Audit de code
Public Développeurs
EditeurSecure Software Inc. racheté par
http://www.fortify.com/security-resources/rats.jsp
Licence GNU GPL
Fonctionnalités Recherche les fonctions dangereuses dans le code
Langage Ecrit en C, audit : C, C++, Perl, Python, PHP
![Page 47: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/47.jpg)
RATS Installation (2)
Durée 5-10 mn
Procédure � Télécharger rats-2.1
http://www.fortify.com/servlet/downloads/public/rats-2.1.tar.gz
5. Audit de code
� Décompresser l’archive
� Compiler les sources C (.exe pour windows sur le site)
o ./configure; make; make install
o nécessite le parser XML expat
http://expat.sourceforge.net
![Page 48: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/48.jpg)
RATS Tests (3)
Exécuter rats -l php -w 3 repertoire >output.txt
Options -l language-d base_vulnerabilite.xml-x-R
Définit le langage du code à analyserCharger la base indiquéeNe pas charger les bases par défautAnalyse non récursive
5. Audit de code
-R-a nom_fonction-w 1|2|3--html--xml-h
Analyse non récursiveAjouter la fonction dans la rechercheNiveau d’alerte (1=high, 2=medium, 3=low)
Sortie HTMLSortie XMLListe des options
Tests réalisés
Recherche les noms de fonctions potentiellementdangereuses définies dans la base de données des vulnerabilities : mail, eval, highlight_file, show_source, system, passthru, fopen, opendir, exec, readfile,...Recherche les opérateurs backtick
![Page 49: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/49.jpg)
5. Audit de codeRATS Résultats (4)
Sortie Texte (défaut), HTML, XML
Format Pour chaque vulnérabilité affiche :� liste des fichiers concernés (chemin + numéro de ligne),� niveau de la vulnérabilité : high, medium, low,�message décrivant la vulnérabilité.�message décrivant la vulnérabilité.
/var/www/scripts/injection_cmd.php:11: High:
system
Argument 1 to this function call should be
checked to ensure that it does
not come from an untrusted source without
first verifying that it contains
nothing dangerous.
1. <?php
…
11. echo system($_GET['cmd']);
...
18. echo `$cmd`;
19. ?>
/var/www/scripts/injection_cmd.php:18: Medium: backtick
The backtick will act just like an call to exec(), so care
should be exercised
that the string being backtick evaluated does not come from an
untrusted source.
![Page 50: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/50.jpg)
RATS Conclusion (5)
+
� Permet d’identifier rapidement les scripts dans lesquels desfonctions potentiellement dangereuses ou l’opérateur backticksont utilisés.� Un message indique en quoi la fonction est dangereuse.� Extension de la base des vulnérabilités facile (rats-php.xml).
5. Audit de code
� Extension de la base des vulnérabilités facile (rats-php.xml).
-
� Beaucoup de faux positifs, c’est l’équivalent d’un grep sur un nom de fonction
exec('ls –la') génère une alerte
� Ne détecte pas : XSS, injections de code, commande (il faudrait ajouter require et include mais augmenterait les faux positifs)
![Page 51: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/51.jpg)
Présentation (1)
Catégorie Outil d’audit de code
Nom Spike PHP Security Audit Tool
5. Audit de code
Public Développeurs
Editeur Spike Source Inc.
Licence Open Source License version 2.1 http://www.spikesource.com/license.html
Fonctionnalités Recherche les fonctions dangereuses dans le code
Langage Ecrit en PHP 4 (basé sur RATS), audit PHP
![Page 52: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/52.jpg)
Installation (2)
Durée 5 mn
Procédure � Télécharger la version 0.27 (août 2007)
http://developer.spikesource.com/frs/download.php/136/spike_phpS
ecAudit_0.27.zip
5. Audit de code
ecAudit_0.27.zip
� Décompresser l’archive
� fichier principal : run.php
(à exécuter en ligne de commande)
� base des vulnérabilités : vuln_db.xml
![Page 53: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/53.jpg)
Tests (3)
Exécuterphp -d allow_call_time_pass_reference=on chemin_script_run.php --src chemin_code_php --format text--outdir chemin_rep_rapport
Options -d directive=valeur--src chemin
Supprime un warning PHPChemin du fichier/répertoire à analyser
5. Audit de code
--src chemin--format text|html--outdir chemin--exclude chemin
Chemin du fichier/répertoire à analyserFormat du rapport généréChemin du répertoire du rapportNe pas analyser le fichier/répertoire
Tests réalisés
Recherche les noms de fonctions potentiellementdangereuses définies dans la base de données des vulnerabilities : mail, eval, highlight_file, show_source, system, passthru, fopen, opendir, exec, readfile,..
![Page 54: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/54.jpg)
5. Audit de codeRésultats (4)
SortieFichier texte output.txt dans le répertoire Spike (défaut)HTML
Format Pour chaque fichier scanné affiche :� nom du fichier,� résultat (aucun problème ou liste des vulnérabilités).
Analyzing file: /var/www/scripts/session.php . . . . . .
There are no errors that I can find in file:
/var/www/scripts_vulnerables/sessions/session.php
Analyzing file: /var/www/scripts/extract.php . . . . . .
These are function calls that need extra cautions:
C. 1
/var/www/scripts/extract.php: 2, MEDIUM: extract
Context: extract($_REQUEST);
Do not use extract() on untrusted data, like user-input ($_GET, $_POST,
$_REQUEST). If you do, for example, if you want to run old code that relies on
register_globals temporarily, make sure you use one of the non-overwriting
extract_type values such as EXTR_SKIP and be aware that you should extract in
the same order that's defined in variables_order within the php.ini
� résultat (aucun problème ou liste des vulnérabilités).
![Page 55: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/55.jpg)
Conclusion (5)
+
� Permet d’identifier rapidement les scripts danslesquels des fonctions potentiellement dangereuses sontutilisées.� Un message indique en quoi la fonction est dangereuse.� Extension de la base des vulnérabilités facile (fichier
5. Audit de code
� Extension de la base des vulnérabilités facile (fichier xml)� Simple à installer et utiliser� Fonctionne avec PHP5
-
� Beaucoup de faux positifs = grep sur un nom de fonction
system('ls –la') génère une alerte� Ne détecte pas : opérateur backtick, XSS, injections de code, commande (il faudrait ajouter require et includemais augmenterait les faux positifs)
![Page 56: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/56.jpg)
PHP Sec Scan Présentation (1)
Catégorie Outil d’audit de code
Nom PHP Security Scanner
Public Développeurs
5. Audit de code
Public Développeurs
Editeur PHP Security Scanner Development Team
Licence GPL
FonctionnalitésRecherche des motifs dangereux dans le code :- Fonctions avec variables- Failles d’inclusion (code et commandes)
Langage Ecrit en PHP, audit PHP
![Page 57: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/57.jpg)
Installation (2)
Durée 20 mn (si MySQL, Apache et PHP installés)
Procédure � Télécharger securityscanner version 1.0.2 (juin 2007)http://sourceforge.net/project/showfiles.php?group_id=141049
� Décompresser l’archive :bin = outils d’analyse du codeinterface = consultation des résultats de l’analyse
5. Audit de code
interface = consultation des résultats de l’analyse3dPartyLib = bibliothèques pour l’interface
� Créer un répertoire security_scanner (serveur web)� Placer dans ce répertoire : interface, 3dPartyLib� Créer la base mysql et la peupler (db_generate.sql)�Mettre les informations de connexion à la base pour l’analyseur et l’interface (bin/config.php, interface/lib/config.php)� Tester dans le navigateur la page d’accueil (interface/),elle devrait afficher :"No results in the database. You should use the executable first."
![Page 58: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/58.jpg)
Tests (3)
Exécuter php security_scan.php repertoire_scripts etiquette
Tests réalisés Recherche des motifs contenant des fonctionspotentiellement dangereuses qui utilisent des variables.
5. Audit de code
potentiellement dangereuses qui utilisent des variables.
Les fonctions sont définies dans la table problem de la base mysql : exec, passthru, system, include, include_once, require, require_once, fopen, readfile, file, phpinfo, eval, …
![Page 59: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/59.jpg)
5. Audit de codeRésultats (4)
SortieDonnées stockées dans la base -> interface PHP de consultation
Format Pour chaque fichier contenant une vulnérabilité :� lien vers le fichier, � numéro de ligne,� code vulnérable + message.� code vulnérable + message.
![Page 60: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/60.jpg)
Conclusion (5)
+
� Ecrit en PHP
� Permet d’identifier rapidement les scripts danslesquels des fonctions potentiellement dangereusescontiennent des variables et affiche une explication avecdes conseils.
5. Audit de code
des conseils.
� Détecte les failles d’inclusion
-
� Faux positifs : <?php $cmd = 'ls –la' ; system($cmd) ?>
� Ne détecte pas : XSS, opérateur backtick, injections SQL
� Utilise une base de données pour stocker les réponses et les vulnérabilités.
![Page 61: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/61.jpg)
Présentation (1)
Catégorie Outil d’audit de code
Nom Pixy
5. Audit de code
Public Développeurs
Editeur Secure Systems Lab (Vienna University of Technology)
Licence GPL
FonctionnalitésXSSInjections SQL
Langage Ecrit en Java, audit code PHP non objet
![Page 62: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/62.jpg)
Installation (2)
Durée 5 mn (si Java JRE installé)
Procédure � Télécharger Pixy version 3.0.3 (juillet 2007)http://pixybox.seclab.tuwien.ac.at/pixy/download.php
� Décompresser l’archive
5. Audit de code
� Décompresser l’archive
Exécuter
À la console :- linux : run-all.pl nom_fichier.php > resultat_scan.txt- windows : run-all.bat nom_fichier.php > resultat_scan.txt
Ou depuis l’IDE Eclipse (cf. doc/eclipse-usage.txt)
![Page 63: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/63.jpg)
Tests (3)
Tests XSS Analyse les données envoyées vers le navigateur avec echo, printet printf. Détecte une vulnérabilité si la donnée contient :
� un tableau prédéfini parmi $_GET, $_POST, $_REQUEST, $_COOKIE :echo $_GET['nom'];
� certaines cases du tableau prédéfini $_SERVER
5. Audit de code
� certaines cases du tableau prédéfini $_SERVER (le fichier config/harmless_server_vars.txt donne la liste des données non dangereuses)echo $_SERVER['HTTP_USER_AGENT'];
� une variable qui a reçu une entrée utilisateur dans un script/fichier inclus :$nom = "ADF2008";
echo $nom; // aucune vulnerabilite detectee
$nom = $_GET['nom'];
$chaine = "Formation $nom" ;
echo $chaine; // vulnerabilite detectee
� une variable qui n’a pas été définie dans le script (dangereux si register_globals a la valeur on : <?php echo $nom; ?>
![Page 64: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/64.jpg)
5. Audit de codeRésultats (4)
Sortie Texte, graphe de dépendances
*****************XSS Analysis BEGIN*****************
Fichier def.php1. <?php
2. $nom = $_GET['nom']; *****************Number of sinks: 1
XSS Analysis Output--------------------Vulnerability detected!- unconditional
- /var/www/scripts/test_xss.php:4- Graph: xss1
Total Vuln Count: 1*****************XSS Analysis END*****************
2. $nom = $_GET['nom'];
3. ?>
Fichier test_xss.php
1. <?php
2. require 'def.php';
3. $chaine = "Bonjour $nom";
4. echo $chaine;
5. ?>
![Page 65: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/65.jpg)
5. Audit de codeRésultats (5)
Sortie Texte, graphe de dépendances
*****************XSS Analysis BEGIN*****************
Fichier test_globals.php
1. <?php *****************Number of sinks: 1
XSS Analysis Output--------------------Vulnerability detected!- conditional on register_globals=on
- /var/www/scripts/test_globals.php:2- Graph: xss1
Total Vuln Count: 1*****************XSS Analysis END****************
1. <?php
2. echo $nom;
3. ?>
![Page 66: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/66.jpg)
5. Audit de codeRésultats (6) (6)
Sortie Texte, graphe de dépendances
Fichier test_fonctions.php1. <?php
2. function test($ch){
*****************XSS Analysis BEGIN*****************2. function test($ch){
3. return strtolower($ch);
4. }
5. $ch1 = test("essai");
6. $ch2 = test($_GET['nom']);
7. echo $ch1;
8. echo $ch2;
9. echo htmlentities($ch2);
10.?>
*****************Number of sinks: 2
XSS Analysis Output--------------------Vulnerability detected!- unconditional- /var/www/scripts/test_fonctions.php:8- Graph: xss2
Total Vuln Count: 1
*****************XSS Analysis END*****************
![Page 67: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/67.jpg)
Tests (7)
Tests SQL 3 niveaux pour les données :
� untainted : aucun danger, données non malicieuses
5. Audit de code
� weakly tainted : danger faible – les valeurs sont protégées mais elles peuvent être dangereuses si elles ne sont pas utilisées dans des quotes :
$id = addslashes($_GET['id']); // injection si "1 OR 1=2"
$pwd = addslashes($_GET['pwd']);
mysql_query("SELECT * FROM mytable WHERE id=$id AND pwd='$pwd'");
� strongly tainted :danger, même si les données sont placées entre quote.
![Page 68: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/68.jpg)
5. Audit de codeRésultats (8) (8)
Sortie Texte, graphe de dépendances
*****************SQL Analysis BEGIN*****************
Fichier def.php1. <?php
2. require 'cnx.inc.php';*****************Number of sinks: 1
SQL Analysis Output--------------------directly tainted!- /var/www/scripts/test_sql.php:6- Graphs: sql1- unconditional
Total Vuln Count: 1*****************SQL Analysis END*****************
2. require 'cnx.inc.php';
3. $login = $_GET['login'];
4. $password = $_GET['password'];
5. $requete = "SELECT * FROM user
WHERE login='$login' AND
password='$password'";
6. $res = mysql_query($requete);
7. ?>
![Page 69: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/69.jpg)
Conclusion (9)
+
� Identifie des vulnérabilités en tenant compte des variables,fichiers inclus et appels de fonctions (diminue le nombre de fauxpositifs),� Si la donnée est protégée par un htmlentities ou cast, n’indiquepas de vulnérabilité (même si protection réalisée dans unefonction),
5. Audit de code
fonction),� Tient compte de l’ordre des instructions<?php $nom = 'ADF'; echo $nom; $nom = $_GET['nom']; echo $nom; ?>
� Permet d’ajouter facilement des modèles de fonctions.
-
� Impossible de vérifier des scripts objet� Scanne un fichier et ses fichiers inclus (pas tout le projet),� Pas de vulnérabilité trouvée pour $_SESSION,� Ne prend pas en compte le fait qu’une donnée a été validée :if (is_numeric($_GET['nb1'])){ echo $_GET['nb1']; } // faux positif
echo (int)$_GET['nb2']; // pas de detection
$nb = (is_numeric($_GET['nb3'])) ? $_GET['nb3'] : 0;
echo $nb; // faux positif
![Page 70: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/70.jpg)
Plan
1. Google Hacking
2. Prise d’empreinte
3. Forger des requêtes
4. Audit de configuration PHP
5. Audit de code
6. Scanner de vulnérabilités
![Page 71: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/71.jpg)
6. Scanner de vulnérabilités : WebScarab
![Page 72: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/72.jpg)
WebScarab Présentation (1)
Catégorie Scanner de vulnérabilités web
Nom WebScarab
Public Développeurs, Administrateurs
6. Scanner de vulnérabilités
Public Développeurs, Administrateurs
Editeur http://www.owasp.org/index.php/Category:OWASP_WebScarab_Project
Licence GNU GPL
FonctionnalitésProxy, Spider, Fuzzer, Détection XSS, Injections SQLOutil Interactif
![Page 73: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/73.jpg)
WebScarab Installation (2)
Durée 5-10 mn
Procédure � Télécharger l’archive (Linux)
� Télécharger et lancer l’installeur (MacOS/Windows)
6. Scanner de vulnérabilités
� Télécharger et lancer l’installeur (MacOS/Windows)
http://www.owasp.org/index.php/Category:OWASP_WebScarab_Pro
ject#Download
![Page 74: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/74.jpg)
WebScarab Tests (3)
Usage (Linux) java -jar ./webscarab-selfcontained-[numbers].jar
6. Scanner de vulnérabilités
![Page 75: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/75.jpg)
6. Scanner de vulnérabilitésWebScarab Fonctionnalités (4)
Proxy Observation du trafic HTTP et HTTPS
Manual intercept
modification des requêtes/réponses à la volée
BeanShell exécution de commandes complexes (java)
Reveal hidden rend visible les champs cachés des formulaires dans le Reveal hidden fields
rend visible les champs cachés des formulaires dans le navigateur
Bandwidth simulator
analyse du fonctionnement du site avec une bande passante donnée
Manual requestPermet d'éditer et de rejouer des anciennes requêtes, ou d'en créer de nouvelles
SessionID analysis
collecte et analyse des identifiants de session pour en déduire leur qualité (-> BurpSuite)
![Page 76: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/76.jpg)
6. Scanner de vulnérabilitésWebScarab Fonctionnalités (4)
Parameter fuzzer
substitution automatisée de valeurs pour tester les failles de type XSS et injections SQL, la recherche de fichiers « cachés »
Search recherches dans les requêtes/réponses (BeanShell)
Compare calcule une valeur de "distance" entre deux réponsesCompare calcule une valeur de "distance" entre deux réponses
XSS/CRLFanalyse pour la recherche de vulnérabilitées XSS/CRLF
Spider permet de naviguer dans l'arborescence du site
->Demo
![Page 77: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/77.jpg)
6. Scanner de vulnérabilitésWebScarab Analyse du Session ID (4)
![Page 78: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/78.jpg)
6. Scanner de vulnérabilitésWebScarab Analyse du Session ID (4)
![Page 79: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/79.jpg)
6. Scanner de vulnérabilitésWebScarab Analyse du Session ID : BurpSuite (4)
![Page 80: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/80.jpg)
WebScarab Conclusion (5)
+� Fonctionnalités nombreuses� Analyse de la qualité du SessionID
6. Scanner de vulnérabilités
-
� Peu intuitif� Documentation quasi-inexistante� Nécessite un minimum d’expertise dans le domaine� Fonctionnalités avancées en beanshell
![Page 81: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/81.jpg)
WebScarab Liens (6)
�http://www.owasp.org/index.php/Category:OWASP_WebScarab_Project
Vidéos de démos :�http://yehg.net/lab/pr0js/training/webscarab.php
6. Scanner de vulnérabilités
Tutoriels :�http://travisaltman.com/webscarab-tutorial-part-1-learning-the-basics/�http://travisaltman.com/webscarab-tutorial-part-2-sessiond-id-analysis/�http://travisaltman.com/webscarab-tutorial-part-3-fuzzing/
BurpSuite (pour l’analyse plus poussée du sessionID notamment)�http://portswigger.net/suite/
![Page 82: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/82.jpg)
6. Scanner de vulnérabilités : NIKTO
![Page 83: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/83.jpg)
NIKTO Présentation (1)
Catégorie Scanner de vulnérabilités web
Nom Nikto
Public Administrateurs
6. Scanner de vulnérabilités
Public Administrateurs
Editeur http://www.cirt.net/nikto2
Licence GNU GPL
FonctionnalitésRecherche de vulnérabilités (failles connues sur les CMS par exemple)
![Page 84: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/84.jpg)
NIKTO Installation (2)
Durée 5 mn
Procédure � Télécharger Nikto et décompresser l’archive :
6. Scanner de vulnérabilités
# wget http://www.cirt.net/nikto/nikto-current.tar.gz
# tar -zxvf nikto-current.tar.gz
# cd nikto
![Page 85: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/85.jpg)
NIKTO Installation : Debian (2)
Durée 5 mn
Procédure Sur Debian, le paquet nikto fait partie de la section non-free. Ilfaut donc l’ajouter dans le fichier de déclaration des sources(/etc/apt/sources.list) :
6. Scanner de vulnérabilités
deb http://ftp.fr.debian.org/debian/ lenny main non-free
deb-src http://ftp.fr.debian.org/debian/ lenny main non-free
deb http://security.debian.org/ lenny/updates main non-free
deb-src http://security.debian.org/ lenny/updates main non-free
Installation du paquet :
# apt-get install nikto
![Page 86: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/86.jpg)
NIKTO Tests (3)
Tests de base : perl nikto.pl -h 192.168.0.1
Tests sur port différent : perl nikto.pl -h 192.168.0.1 -p 443
Tests sur URL : perl nikto.pl -h https://192.168.0.1:443/
Tests SSL : perl nikto.pl -h 192.168.0.1 -p 443 -ssl
Tests x ports : perl nikto.pl -h 192.168.0.1 -p 80,88,443
6. Scanner de vulnérabilités
Exécuter
Tests x ports : perl nikto.pl -h 192.168.0.1 -p 80,88,443
Scans de cibles multiples : perl nikto.pl -h fichier.txt
----- Contenu de fichier.txt :----
192.168.0.1:80
192.168.0.2,80
192.168.0.3
192.168.0.1,80,443
192.168.0.1:80:443
localhost:8888
Attention impossible de placer des URLs dans ce fichier !
![Page 87: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/87.jpg)
NIKTO Tests (3)
Options-V-U
Affiche la version des bases/pluginsMet à jour la base des signatures/plugins
-Tuning permet de préciser quels tests faire ou ne pas faire (option “x”) :0 - File Upload1 - Interesting File / Seen in logs (nombreux faux positifs)2 - Misconfiguration / Default File
6. Scanner de vulnérabilités
2 - Misconfiguration / Default File3 - Information Disclosure4 - Injection (XSS/Script/HTML)5 - Remote File Retrieval - Inside Web Root6 - Denial of Service7 - Remote File Retrieval - Server Wide8 - Command Execution / Remote Shell9 - SQL Injectiona - Authentication Bypassb - Software Identificationg - Generic (Don't rely on banner)
Ex : perl nikto.pl -h monsite.com -T1x
![Page 88: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/88.jpg)
NIKTO Tests (3)
Options-Mutate spécifie une technique de mutation. Permet d’ajouter des tests
supplémentaires1 - Test all files with all root directories2 - Guess for password file names3 - Enumerate user names via Apache (/~user type requests)4 - Enumerate user names via cgiwrap
6. Scanner de vulnérabilités
4 - Enumerate user names via cgiwrap
(/cgi-bin/cgiwrap/~user type requests)
Tests
réalisés
Recherche de failles sur la base des vulnérabilités déclarées dans l’OSVDB (The Open Source Vulnerability Database)
![Page 89: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/89.jpg)
NIKTO Tests (3)
Etape préliminaire : récupérer l’arborescence du site (crawler/spider, directory brutforcer).
Méthone manuelle : list-url.py ou list-url2.py (disponibles sur
6. Scanner de vulnérabilités
Exécuter
Méthone manuelle : list-url.py ou list-url2.py (disponibles sur
le CD BackTrack3)
$ list-urls2.py -l www.monsite.fr
http://site.externe.fr
http://autre.site.externe.fr
mespages/web
mondossier/index.html
$ perl nikto.pl -h http://www.monsite.fr/ mespages/web/
![Page 90: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/90.jpg)
NIKTO Tests (3)
Semi-automatique : HarvestMan
$ wget http://harvestman-crawler.googlecode.com/files/HarvestMan-
2.0.3alpha12102008.tar.gz
$ tar -zxvf HarvestMan-2.0.3alpha12102008.tar.gz
$ cd HarvestMan-2.0.3alpha12102008
$ (sudo) python setup.py install
6. Scanner de vulnérabilités
Exécuter
$ (sudo) python setup.py install
$ harvestman --simulate http://192.168.1.14 2&1>DVL_URLS.txt
$ egrep -e ".*Downloading file for url.*\/$" DVL_URLS.txt | awk
'{print "perl nikto.pl -T 1x -h",$6," >> niktoscanDVL.txt"}' >
scanDVL.sh
Extrait du fichier scanDVL.sh (à exécuter ensuite) :
perl nikto.pl -T 1x -h http://192.168.1.14/ >> niktoscanDVL.txt
perl nikto.pl -T 1x -h http://192.168.1.14/phpmyadmin/ >> niktoscanDVL.txt
perl nikto.pl -T 1x -h http://192.168.1.14/manual/ >> niktoscanDVL.txt
perl nikto.pl -T 1x -h http://192.168.1.14/webexploitation_package_02/ >>
niktoscanDVL.txt
perl nikto.pl -T 1x -h http://192.168.1.14/webexploitation_package_01/ >>
niktoscanDVL.txt
![Page 91: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/91.jpg)
6. Scanner de vulnérabilitésNIKTO Résultats (4)
Sortie Texte (console)
##### TEST 1 : DVL
- Nikto v2.03/2.04
---------------------------------------------------------------------------
+ Target IP: 192.168.1.241
+ Target Hostname: 192.168.1.241
+ Target Port: 80
+ Start Time: 2009-01-22 22:33:53
---------------------------------------------------------------------------
+ Server: Apache/1.3.37 (Unix) PHP/4.4.4
- Allowed HTTP Methods: GET, HEAD, OPTIONS, TRACE
+ OSVDB-877: HTTP method ('Allow' Header): 'TRACE' is typically only used for debugging
and should be disabled. This message does not mean it is vulnerable to XST.
+ Apache/1.3.37 appears to be outdated (current is at least Apache/2.2.10). Apache
1.3.41 and 2.0.63 are also current.
+ PHP/4.4.4 appears to be outdated (current is at least 5.2.6)
![Page 92: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/92.jpg)
6. Scanner de vulnérabilitésNIKTO Résultats (4)
Sortie Texte (console)
+ OSVDB-0: GET /./ : Appending '/./' to a directory allows indexing
+ OSVDB-0: GET /%2e/ : Weblogic allows source code or directory listing, upgrade to v6.0 SP1 or higher.
http://www.securityfocus.com/bid/2513.
+ OSVDB-877: TRACK / : TRACK option ('TRACE' alias) appears to allow XSS or credential theft. See
http://www.cgisecurity.com/whitehat-mirror/WhitePaper_screen.pdf for details
+ OSVDB-877: TRACE / : TRACE option appears to allow XSS or credential theft. See
http://www.cgisecurity.com/whitehat-mirror/WhitePaper_screen.pdf for details
+ OSVDB-119: GET /?PageServices : The remote server may allow directory listings through Web Publisher by
forcing the server to show all files via 'open directory browsing'. Web Publisher should be disabled.
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-1999-0269.
+ OSVDB-119: GET /?wp-cs-dump : The remote server may allow directory listings through Web Publisher by
forcing the server to show all files via 'open directory browsing'. Web Publisher should be disabled.
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-1999-0269.
+ OSVDB-3092: GET /info/ : This might be interesting...
+ OSVDB-3092: GET /phpmyadmin/ : phpMyAdmin is for managing MySQL databases, and should be protected or
limited to authorized hosts.
+ OSVDB-3092: GET /manual/ : Web server manual found.
+ OSVDB-3268: GET /icons/ : Directory indexing is enabled: /icons
+ OSVDB-3268: GET /manual/images/ : Directory indexing is enabled: /manual/images
+ OSVDB-3233: GET /icons/README : Apache default file found.
+ 3577 items checked: 16 item(s) reported on remote host
+ End Time: 2009-01-22 22:34:29 (36 seconds)
---------------------------------------------------------------------------
+ 1 host(s) tested
Test Options: -Cgidirs all -host 192.168.1.241 -output nikto-DVL
---------------------------------------------------------------------------
![Page 93: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/93.jpg)
NIKTO Conclusion (5)
+
� Détecte bien les phpinfo.php et cie� Détecte bien les répertoires navigables� Détecte (parfois) les CMS installés� Peut mettre à jour des défauts de réglages du serveur web
6. Scanner de vulnérabilités
-� Pas de spider/crawler (à voir la version windows ?)� Nombreux faux positifs� Détecte seulement les failles connues
![Page 94: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/94.jpg)
NIKTO Liens (6)
� http://www.cirt.net/nikto2
6. Scanner de vulnérabilités
Liste des mots de passe par défaut :
�http://www.cirt.net/passwords
![Page 95: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/95.jpg)
6. Scanner de vulnérabilités : DirBuster
![Page 96: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/96.jpg)
DirBuster Présentation (1)
Catégorie Scanner de vulnérabilités web
Nom DirBuster
Public Administrateurs
6. Scanner de vulnérabilités
Public Administrateurs
Editeurhttp://www.owasp.org/index.php/Category:OWASP_DirBuster_Project
LicenceLGPL (application) + Creative Commons (listings de répertoires)
FonctionnalitésSpider+Fuzzer, recherche de répertoires/fichiers « cachés » par une méthode de force brute.
![Page 97: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/97.jpg)
DirBuster Installation (2)
Durée 5 mn
Procédure Ecrit en java, existe en versions :
Linux (tar.bz2), MacOS (.dmg) et Windows (installeur)
6. Scanner de vulnérabilités
Linux (tar.bz2), MacOS (.dmg) et Windows (installeur)
� Télécharger et décompacter l’archive / lancer
l’installeur.
![Page 98: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/98.jpg)
DriBuster Tests (3)
Exécuter java -jar DirBuster-0.12.jar -H -u http://monsite.com
Options-H-l <Word list to use>-g-e <File Extention list>-t <Number of Threads>
Headless mode (no gui).List based brute force word list.Only use GET requests.File Extention list eg asp,aspx. (php)Number of connection threads to use (10)
6. Scanner de vulnérabilités
-t <Number of Threads>-s <Start point>-R-r <location>
Number of connection threads to use (10)Start point of the scan (/)Don't be recursive.File to save report to.
Tests réalisés
Recherche de répertoires cachés à partir de diverses listes (9 différentes) :
![Page 99: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/99.jpg)
6. Scanner de vulnérabilitésDirBuster Résultats (4)
Sortie TexteTest sur la distrib DVL :
DirBuster 0.12 - Report
http://www.owasp.org/index.php/Category:OWASP_DirBuster_Project
Report produced on Thu Jan 22 17:53:33 CET 2009
--------------------------------
http://192.168.1.241:80
--------------------------------
Directories found during testing:
Dirs found with a 200 response:
/
/icons/
/info/
/beef/
/manual/
/manual/
/unicornscan/
/webexploitation_package_01/
/phpmyadmin/
/webexploitation_package_02/
…
![Page 100: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/100.jpg)
6. Scanner de vulnérabilitésDirBuster Résultats (4)
/olate/
/manual/misc/
/manual/mod/
/manual/programs/
/manual/howto/
/manual/vhosts/
/manual/images/
/phpmyadmin//phpmyadmin/
/beef/
/olate/
/icons/small/
/info/index/
/info/full/
/info/warez/
/info/12/
/info/2006/
/info/news/
/info/crack/
[...]
et 39326 similaires avant interruption manuelle du scan. Cet exemple montre une limitation de ce type d’outil : il suffit que le serveur réponde avec un 200 sur toutes les URL du type http://monserveur.com/repertoire/* pour que tous les essais de l’outil soient (faux) positifs.
![Page 101: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/101.jpg)
DirBuster Conclusion (5)
+
� Peut servir de spider à Nikto/WebShag� Listes construites à partir d’une collecte sur internet de noms de répertoires et de fichiers utilisés par les développeurs.
6. Scanner de vulnérabilités
développeurs.
-� Attention à la config du serveur : Nombreux faux positifs
![Page 102: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/102.jpg)
DirBuster Liens (6)
� http://www.owasp.org/index.php/Category:OWASP_DirBuster_Project
6. Scanner de vulnérabilités
![Page 103: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/103.jpg)
6. Scanner de vulnérabilités : Wapiti
![Page 104: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/104.jpg)
WAPITI Présentation (1)
Catégorie Scanner de vulnérabilités web
Nom Wapiti
Public Administrateurs, (développeurs)
6. Scanner de vulnérabilités
Public Administrateurs, (développeurs)
Editeur http://wapiti.sourceforge.net
Licence GNU GPL
FonctionnalitésScans de type “boîte noire”, fuzzer. File includes, Injections SQL, LDAP, XSS, etc;
![Page 105: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/105.jpg)
WAPITI Installation (2)
Durée 5-10 mn
Procédure � Installation de wapiti :
télécharger wapiti-1.1.6 (28 Jan 2007)
6. Scanner de vulnérabilités
télécharger wapiti-1.1.6 (28 Jan 2007) http://sourceforge.net/project/showfiles.php?group_id=168625&package_id=191974&release_id=482116
tar -zxvf wapiti-1.1.6.tar.gzcd wapiti-1.1.6
Procédure similaire pour wapiti-2.0.0-beta
![Page 106: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/106.jpg)
WAPITI Installation (2)
Durée 5-10 mn
Procédure � lswww (l’aspirateur des pages) a du mal a fonctionner avec des
pages HTML malformées. Pour permettre à lswww de
6. Scanner de vulnérabilités
pages HTML malformées. Pour permettre à lswww de
fonctionner correctement il faut installer :
Tidy - http://tidy.sourceforge.net/ctypes - http://starship.python.net/crew/theller/ctypes/uTidyLib - http://utidylib.berlios.de/
![Page 107: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/107.jpg)
WAPITI Installation (2)
Durée Encore 5-10 mn… si tout va bien…
Procédure # yum install tidy
# wget http://ovh.dl.sourceforge.net/sourceforge/ctypes/ctypes-1.0.2.tar.gz# tar -zxvf ctypes-1.0.2.tar.gz
6. Scanner de vulnérabilités
# tar -zxvf ctypes-1.0.2.tar.gz # cd ctypes-1.0.2# python setup.py build# python setup.py test# python setup.py install# cd ..# wget http://download.berlios.de/utidylib/uTidylib-0.2.zip# unzip uTidylib-0.2.zip# cd uTidylib-0.2# python setup.py install
![Page 108: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/108.jpg)
WAPITI Tests (3)
Exécuter python wapiti.py http://mon-site.com/repertoire/ [options]
Options-a <login%password>--auth <login%password>-c <cookie_file>--cookie <cookie_file>
Set credentials for HTTP authentication
To use a cookie
Set the name of the report file. If the
6. Scanner de vulnérabilités
-o <output> (v2.0.0-beta)--output <output_file>
Set the name of the report file. If the selected report type is "html", this parameter must be a directory
Tests réalisés
-File Handling Errors (Inclusions locales et distantes : include/require, fopen, readfile...)- Injections dans des bases de données (PHP/JSP/ASP SQL -Injections Injections XPath)- XSS (Cross Site Scripting)-Injections LDAP-Détection d’exécutions de commandes (eval(), system(), passtru()...)-Injection CRLF
![Page 109: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/109.jpg)
6. Scanner de vulnérabilitésWAPITI Résultats (4)
Sortie Texte (console), HTML (2.0.0-b), XML (2.0.0-b)
http://192.168.1.16/webexploitation_package_02/nabopoll/templates/compact/{SURVEY_URL}: HTTP Error 404: Not Found
http://192.168.1.16/webexploitation_package_02/nabopoll/templates/compact/{SURVEY_RESULTS}: HTTP Error 404: Not Found
http://192.168.1.16/webexploitation_package_02/phpBB2_2_0_12/emailto:[email protected]: HTTP Error 404: Not Found
http://192.168.1.16/webexploitation_package_02/phpBB2_2_0_13/emailto:[email protected]: HTTP Error 404: Not Found
Attacking urls (GET)...Attacking urls (GET)...
-----------------------
XSS () in http://192.168.1.16/info.php
Evil url: http://192.168.1.16/info.php?=<script>alert('a5bgvz4yjh')</script>
XSS (email) in http://192.168.1.16/webexploitation_package_01/exploitme001/reset.php
Evil url:
http://192.168.1.16/webexploitation_package_01/exploitme001/reset.php?email=<script>alert('lfaea5icxm')</script>&user=D
umbUser
XSS () in http://192.168.1.16/webexploitation_package_01/info.php
Evil url: http://192.168.1.16/webexploitation_package_01/info.php?=<script>alert('qhnoefnpv1')</script>
[…]
Attacking forms (POST)...
-------------------------
Found XSS in http://192.168.1.16/webexploitation_package_01/exploitme005/buy.php
with params = item=%3Cscript%3Ealert%28%27amsbj2xn3y%27%29%3C%2Fscript%3E&quantity=on
coming from http://192.168.1.16/webexploitation_package_01/exploitme005/
MySQL Injection in http://192.168.1.16/webexploitation_package_02/cyphor/index.php
with params = login=%BF%27%22%28&f_cookies=1&submit=Login&pass=on
coming from http://192.168.1.16/webexploitation_package_02/cyphor/
[…]
Upload scripts found :
----------------------
http://192.168.1.16/webexploitation_package_01/exploitme003/upload.php.
![Page 110: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/110.jpg)
6. Scanner de vulnérabilitésWAPITI Résultats (4)
Sortie Format HTML : v 2.2.0-beta
![Page 111: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/111.jpg)
6. Scanner de vulnérabilitésWAPITI Résultats (4)
Sortie Format HTML : v 2.2.0-beta
![Page 112: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/112.jpg)
6. Scanner de vulnérabilitésWAPITI Résultats (4)
Sortie Format HTML : v 2.2.0-beta
![Page 113: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/113.jpg)
6. Scanner de vulnérabilitésWAPITI Résultats (4)
Sortie Format HTML : v 2.2.0-beta
![Page 114: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/114.jpg)
WAPITI Conclusion (5)
+
� Ne repose pas sur une base de connaissances� Spider intégré, détections de failles multiples� Nouvelle méthode de scan XSS dans la v2.0.0-beta qui a détecté un XSS dans un wiki� Nouveau spider dans la v2.0.0-beta
6. Scanner de vulnérabilités
� Nouveau spider dans la v2.0.0-beta� Résultats concis (pas hyper verbeux)
-
� Bugs dans v2.0.0-beta, mais meilleure détection que la v1.1.6 => il faut utiliser les deux versions !� L’option -a n’est pas fonctionnelle dans la 1.1.6� Il faut savoir interpréter les résultats (faux positifs ?)� Ne fonctionne qu’avec du code html propre…� Installation de libtidy et uTidylib pénible sous certains systèmes (la version 1.1.6 est sur BackTrack 3)
![Page 115: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/115.jpg)
WAPITI Liens (6)
� http://wapiti.sourceforge.net/�http://devloop.lyua.org/blog/index.php?2008/03/01/499-playing-with-beautiful-soup
6. Scanner de vulnérabilités
+
soup�http://wapiti.sourceforge.net/�http://devloop.lyua.org/blog/index.php?2006/04/26/246-howto-faire-fonctionner-efficacement-lswww�http://devloop.lyua.org/blog/index.php?2007/01/28/390-wapiti-116�http://devloop.lyua.org/blog/index.php?2008/09/15/530-wapiti-117-alpha�http://devloop.lyua.org/blog/index.php?2008/10/11/534-wapiti-2-0-0-beta
![Page 116: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/116.jpg)
6. Scanner de vulnérabilités : SQLiX
![Page 117: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/117.jpg)
SQLiX Présentation (1)
Catégorie Scanner de vulnérabilités web
Nom SQLiX
Public Administrateurs, (développeurs)
6. Scanner de vulnérabilités
Public Administrateurs, (développeurs)
Editeur http://www.scrt.ch/pages_en/outils.html
Licence GNU GPL
FonctionnalitésInjections SQL
![Page 118: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/118.jpg)
SQLiX Installation (2)
Durée 5-10 mn et plus…
Procédure Nécessite le module Perl WWW::CheckSite::Spider
# perl -MCPAN -e shell
6. Scanner de vulnérabilités
# perl -MCPAN -e shell
cpan> install WWW::CheckSite::Spider
Instalation de SQLiX :
télécharger SQLiX_v1.0.tar.gzhttp://cedri.cc/tools/SQLiX_v1.0.tar.gz
$ tar -zxvf SQLiX_v1.0.tar.gz
$ cd SQLiX_v1.0
Présent sur les cds live BackTrack 3 et DVL (Damn Vulnerable Linux)
![Page 119: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/119.jpg)
SQLiX Tests (3)
Exécuter perl SQLiX.pl -crawl="http://localhost/" -all -v 2
Target
specification
-url [URL] Scan a given URL.
Example: -url="http://target.com/index.php?id=1"
--post_content [CONTENT] Add a content to the current [URL] and
change the HTTP method to POST
-file [FILE_NAME]Scan a list of URI provided via a flat file.
6. Scanner de vulnérabilités
-file [FILE_NAME]Scan a list of URI provided via a flat file.
Example: -file="./crawling"
-crawl [ROOT_URL]Scan a web site from the given root URL.
Example: -crawl="http://target.com/"
Injection vectors
-referer Use HTTP referer as a potential injection vector.
-agent Use HTTP User agent as a potential injection vector.
-cookie [COOKIE] Use the cookie as a potential injection vector.
Cookie value has to be specified and the injection area
tagged as "--INJECT_HERE--".
Example: -cookie="userID=--INJECT_HERE--"
![Page 120: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/120.jpg)
SQLiX Tests (3)
Injection
methods
-all Use all the injection methods.
-method_taggy Use MS-SQL "verbose" error messages method.
-method_error Use conditional error messages injection method.
-method_blind Use all blind injection methods.
-method_blind_integer Use integer blind injection method.
-method_blind_string Use string blind injection method.
-method_blind_statement Use statement blind injection method.
6. Scanner de vulnérabilités
-method_blind_statement Use statement blind injection method.
-method_blind_comment Use MySQL comment blind injection
method.
Attack modules
-exploit Exploit the found injection to extract information.
by default the version of the database will be retrieved
-function [function] Used with exploit to retrieve a given
function value.
Example: -function="system_user"
Example: -function="(select password from user_table)"
![Page 121: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/121.jpg)
6. Scanner de vulnérabilitésSQLiX Résultats (4)
Sortie Texte
SQLiX_v1.0 # perl SQLiX.pl -crawl http://localhost/ -all -v 2 -exploit
======================================================
-- SQLiX --
? Copyright 2006 Cedric COCHIN, All Rights Reserved.
======================================================
Analysing URI obtained by crawling [http://localhost/]
http://localhost/
http://localhost/webexploitation_package_02/
http://localhost/webexploitation_package_02/wordpress/
http://localhost/webexploitation_package_02/wordpress/wp-login.php
http://localhost/webexploitation_package_02/wordpress/wp-login.php?action=lostpassword
[+] working on action
[+] Method: MS-SQL error message
[+] Method: SQL error message
[+] Method: MySQL comment injection
[+] Method: SQL Blind Statement Injection
[+] Method: SQL Blind String Injection
http://localhost/webexploitation_package_02/wordpress/?m=200706
[+] working on m
[+] Method: MS-SQL error message
[+] Method: SQL error message
[+] Method: MySQL comment injection
[+] Method: SQL Blind Integer Injection
[+] Method: SQL Blind Statement Injection
[+] Method: SQL Blind String Injection
![Page 122: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/122.jpg)
6. Scanner de vulnérabilitésSQLiX Résultats (4)
http://localhost/webexploitation_package_02/wordpress/?cat=1
[+] working on cat
[+] Method: MS-SQL error message
[+] Method: SQL error message
[FOUND] Match found INPUT:['] - "You have an error in your
SQL syntax"
[INFO] Error with quote[INFO] Error with quote
[INFO] Current function: version()
[INFO] length: 255
[FOUND] SQL error message
Travail sur les différents champs de l’url et détection de faux positifs :
http://localhost/webexploitation_package_02/phpnuke7.8/modules.php?name=Web_Links&l_op=
TopRated&ratenum=10&ratetype=percent
[+] working on ratenum
[+] Method: MS-SQL error message
[+] Method: SQL error message
[+] Method: MySQL comment injection
[+] Method: SQL Blind Integer Injection
[FOUND] Blind SQL Injection: Integer based
[FOUND] Blind SQL Injection: Integer based with quotes
[ERROR] both methods can't be true simultanesly
![Page 123: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/123.jpg)
6. Scanner de vulnérabilitésSQLiX Résultats (4)
RESULTS:
The variable [cat] from [http://localhost/webexploitation_package_02/wordpress/
?cat=1] is vulnerable to SQL Injection [Error message (') - MySQL].
The variable [month] from [http://localhost/webexploitation_package_02/
phpnuke7.4/modules.php?name=Statistics&op=DailyStats&year=2009&month=1&date=31]
is vulnerable to SQL Injection [Statement with quotes - ].
The variable [sectionid] from [http://localhost/webexploitation_package_02/
joomla107/index.php?option=com_content&task=category§ionid=1&id=1&Itemid=2]
is vulnerable to SQL Injection [Comment without quotes - MySQL].
The variable [feedid] from [http://localhost/webexploitation_package_02/
joomla107/index.php?option=com_newsfeeds&task=view&feedid=6&Itemid=7]
is vulnerable to SQL Injection [Comment with quotes - MySQL].
![Page 124: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/124.jpg)
SQLiX Conclusion (5)
+
� Outil complet pour les tests d’injection� Spider intégré�Méthode de détection de faux positifs
6. Scanner de vulnérabilités
-
Fonctionne bien sur GETPOST….???Documentation inexistante
![Page 125: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/125.jpg)
SQLiX Liens (6)
6. Scanner de vulnérabilités
�http://www.owasp.org/index.php/Category:OWASP_SQLiX_Project
![Page 126: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/126.jpg)
6. Scanner de vulnérabilités : WebShag
![Page 127: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/127.jpg)
WebShag Présentation (1)
Catégorie Scanner de vulnérabilités web
Nom WebShag
Public Administrateurs
6. Scanner de vulnérabilités
Public Administrateurs
Editeur http://www.scrt.ch/pages_en/outils.html
Licence GNU GPL
FonctionnalitésCrawler, Fuzzer, Détection de vulnérabilités
![Page 128: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/128.jpg)
WebShag Installation (2)
Durée 5-10 mn
Procédure � télécharger l’outil et décompacter l’archive :http://www.scrt.ch/outils/webshag/ws100_linux.tar.gz
6. Scanner de vulnérabilités
# tar -zxvf ws100_linux.tar.gz
![Page 129: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/129.jpg)
WebShag Installation (2)
6. Scanner de vulnérabilités
INITIALISATION :
$ python config_linux.py
This script will setup all the required webshag parameters.
Detecting Nmap port scanner... Not Found!
Nmap location (blank if not installed):
Nmap not found. Port scan module will not be functional.
Valid Live Search AppID (blank if none):
Domain information module will not be functional.
Patching source code to setup config file location... Done!
Setting up path to file fuzzer lists... Done!
Setting up path to URL database files... Done!
Setting up path to (IDS) proxies list... Done!
Writing changes to configuration file... Done!
Thanks for your interest in webshag! It is now ready to be used!
If you move webshag folder, run this script again to reconfigure.
Enjoy! For more information please visit www.scrt.ch
![Page 130: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/130.jpg)
WebShag Installation (2)
6. Scanner de vulnérabilités
MISE A JOUR DES BASES :
$ python webshag.py -U
Update of Nikto database successful!
Update of SCRT database successful!Update of SCRT database successful!
![Page 131: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/131.jpg)
WebShag Tests (3)
Usage webshag.py [-U | -C [options] target(s)]
6. Scanner de vulnérabilités
Options:
-C Use the Command Line Interface (CLI) mode
-U Update the URL scanner databases and exit
-m MODULE *CLI only* Use MODULE [pscan|info|spider|uscan|fuzz].
(default: uscan)(default: uscan)
-p PORT *CLI only* Set target port to PORT. For modules uscan and
fuzz PORT can be a list of ports [port1,port2,...].
(default: 80)
-r ROOT *CLI only* Set root directory to ROOT. For modules uscan and
fuzz ROOT can be a list of directories [/root1/,/root2/,...]. (default: /)
-k SKIP *CLI (uscan) only* Set a false positive detection string
-s SERVER *CLI (uscan) only* Bypass server detection and force server as SERVER
-i SPIDER_INIT *CLI (spider) only* Set spider initial crawling page (default: /)
-n FUZZ_MODE *CLI (fuzz) only* Choose the fuzzing mode [list|gen]. (default: list)
-e FUZZ_EXT *CLI (fuzz / list) only* Set a default extension to append to all
filenames. (default: .html)
-g FUZZ_GEN *CLI (fuzz / gen) only* Set the filename generator
expression. Refer to documentation for syntax reference. (default: )
-x *CLI only* Export a report summarizing results.
-o OUTPUT *CLI only* Set the format of the exported report. [xml|html|txt].
(default: html)
-f OUTPUT_FILE *CLI only* Write report to FILE. (default: webshag_report.html)
![Page 132: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/132.jpg)
WebShag Tests (3)
Usage Module spider
6. Scanner de vulnérabilités
localhost:SCRT Webshag adm1n$ ./webshag.py -C -m spider -i /ADF localhost
~~~~~~~~~~~~~~~~~~~~~~~~~~ ## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
% webshag 1.00
% Module: spider
% Host: localhost% Host: localhost
% Port: 80
% Root: /ADF
~~~~~~~~~~~~~~~~~~~~~~~~~~ ## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
localhost / 80
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
% [ I ] % /ADF/TPs/
% [ I ] % /ADF/scripts_vulnerables/
% [ I ] % /ADF/scripts_vulnerables/XSS/
[…]
% [ I ] % /ADF/TPs/ex3_vol_session/bad_www/
% [ I ] % /ADF/TPs/ex3_vol_session/gentil/
% [ M ] % [email protected]
% [ M ] % [email protected]
% [ I ] % /ADF/scripts_vulnerables/XSS/cookie/
% [ I ] % /ADF/scripts_vulnerables/XSS/fichier/
~~~~~~~~~~~~~~~~~~~~~~~~~~ ## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Liens internes : ‘’% [ I ] %’’
grep, awk => uscan
![Page 133: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/133.jpg)
WebShag Tests (3)
Usage Module uscan
6. Scanner de vulnérabilités
#python webshag.py -C -m uscan -r/~user/moncms www.mon.serveur.a.moi.com
~~~~~~~~~~~~~~~~~~~~~~~~~~ ## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
% webshag 1.00
% Module: uscan
% Host(s): www.mon.serveur.a.moi.com% Host(s): www.mon.serveur.a.moi.com
% Port(s): 80
% Root(s): /~user/moncms/
~~~~~~~~~~~~~~~~~~~~~~~~~~ ## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
www.mon.serveur.a.moi.com / 80
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
% BANNER % Apache => apache
% INFO % FP(/~user/moncms/) => 200#text/html#c95db01c3a17545aced464c9df9fc1bd#…
% INFO % FP(/~user/moncms/OLgcREvt) => 404#text/html#a502f41af02329906a36b4e46…
% INFO % FP(/~user/moncms/index.php) => 200#text/html#8ec1c744dd883c80b717ef79…
% INFO % /~user/moncms/robots.txt found. It might be interesting to have a look
inside.
% 200 % /~user/moncms/install/
% DESC % This might be interesting...
% 200 % /~user/moncms/install/install.php
% DESC % Install file found.
% 200 % /~user/moncms/INSTALL.txt
![Page 134: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/134.jpg)
WebShag Tests (3)
Usage Module uscan
6. Scanner de vulnérabilités
% DESC % Default file found.
% 200 % /~user/moncms/UPGRADE.txt
% DESC % Default file found.
% 200 % /~user/moncms/install.php
% DESC % Drupal install.php file found.% DESC % Drupal install.php file found.
% 200 % /~user/moncms/LICENSE.txt
% DESC % License file found may identify site software.
% 200 % /~user/moncms/install.php
% DESC % install.php file found.
% 200 % /~user/moncms/CHANGELOG.txt
% DESC % A changelog was found.
% 200 % /~user/moncms/INSTALL.mysql.txt
% DESC % Drupal installation file found.
% 200 % /~user/moncms/INSTALL.pgsql.txt
% DESC % Drupal installation file found.
% 200 % /~user/moncms/update.php
% DESC % Drupal's update.php was found.
% 200 % /~user/moncms/xmlrpc.php
% DESC % xmlrpc.php was found.
![Page 135: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/135.jpg)
6. Scanner de vulnérabilitésWebShag Résultats (4)
Sortie Texte (console), HTML (2.0.0-b), XML (2.0.0-b)
http://192.168.1.16/webexploitation_package_02/nabopoll/templates/compact/{SURVEY_URL}: HTTP Error 404: Not Found
http://192.168.1.16/webexploitation_package_02/nabopoll/templates/compact/{SURVEY_RESULTS}: HTTP Error 404: Not Found
http://192.168.1.16/webexploitation_package_02/phpBB2_2_0_12/emailto:[email protected]: HTTP Error 404: Not Found
http://192.168.1.16/webexploitation_package_02/phpBB2_2_0_13/emailto:[email protected]: HTTP Error 404: Not Found
Attacking urls (GET)...Attacking urls (GET)...
-----------------------
XSS () in http://192.168.1.16/info.php
Evil url: http://192.168.1.16/info.php?=<script>alert('a5bgvz4yjh')</script>
XSS (email) in http://192.168.1.16/webexploitation_package_01/exploitme001/reset.php
Evil url:
http://192.168.1.16/webexploitation_package_01/exploitme001/reset.php?email=<script>alert('lfaea5icxm')</script>&user=D
umbUser
XSS () in http://192.168.1.16/webexploitation_package_01/info.php
Evil url: http://192.168.1.16/webexploitation_package_01/info.php?=<script>alert('qhnoefnpv1')</script>
[…]
Attacking forms (POST)...
-------------------------
Found XSS in http://192.168.1.16/webexploitation_package_01/exploitme005/buy.php
with params = item=%3Cscript%3Ealert%28%27amsbj2xn3y%27%29%3C%2Fscript%3E&quantity=on
coming from http://192.168.1.16/webexploitation_package_01/exploitme005/
MySQL Injection in http://192.168.1.16/webexploitation_package_02/cyphor/index.php
with params = login=%BF%27%22%28&f_cookies=1&submit=Login&pass=on
coming from http://192.168.1.16/webexploitation_package_02/cyphor/
[…]
Upload scripts found :
----------------------
http://192.168.1.16/webexploitation_package_01/exploitme003/upload.php.
![Page 136: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/136.jpg)
WebShag Conclusion (5)
+
� Spider « intégré » !!!!� Intégragion spider, scanner (Nikto), fuzzer (DirBuster)� Utilise un mécanisme de prise d’empreinte pour réduire le nombre de faux positifs� interface graphique
6. Scanner de vulnérabilités
� interface graphique� Sur cas réels a rapporté des choses intéressantes :-)
-
� Repose sur des bases de connaissances� Génère beaucoup de traces dans les logs� Certaines options non disponibles en CLI
![Page 137: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/137.jpg)
WebShag Liens (6)
6. Scanner de vulnérabilités
+� http://www.scrt.ch/pages_en/outils.html
![Page 138: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/138.jpg)
Méthodologie (5)
� Spider (list-urls.py, HarvestMan)� Recherche de contenu caché (Dirbuster)� Recherche de vulnérabilités connues (Nikto, WebShag)
6. Synthèse
� Recherche de vulnérabilités connues (Nikto, WebShag)� Scanner-Fuzzer automatique (wapiti)� Injections SQL (SQLiX)� Investigation ciblée (WebScarab)
![Page 139: ADF 2009 - CESARcesar.resinfo.org/cours-prive/ADF-012009/ADF_tools_2009.pdf · 2013-09-13 · 1. Google Hacking Opérateurs de recherche avancée Opérateur Recherche intitle:mot](https://reader030.vdocuments.mx/reader030/viewer/2022040304/5e9c8578cb10cb24446590c0/html5/thumbnails/139.jpg)
CONCLUSIONS (5)
�Résultats obtenus sur cas réels mitigés pour les outilsautomatiques�Ne dispense pas d’une bonne expertise (exploitation desrésultats)� Pas d’outils miracle !
6. Synthèse
� Pas d’outils miracle !� Il faut comprendre les failles pour être capable de les« tester » automatiquement via ces outils.� Outils expérimentaux, peu documentés� Combiner plusieurs outils + analyse interactive� ATTENTION : Tests sur serveur en Prod = DANGER !!!