Dissecton d`un outl d`audit de site web: Webshag

Transcription

Dissecton d`un outl d`audit de site web: Webshag
Dissecton d'un outl d'audit de site
web: Webshag
SCRT
Informaton Security
Switzerland
htp://www.scrt.ch
Table des matères
●
Introducton
●
Dissecton
–
Scanner d'URL
–
Fuzzer Dynamique
●
Démonstratons
●
Remerciements
-2-
Introducton
Scanners automatsés
●
●
●
Utlisés lors de tests d'intrusion pour « dégager le
terrain »
Utles ...
–
Font le gros du travail
–
N'ont pas besoin de dormir
–
Ne boivent pas de café
... mais limités et souvent facile à « tromper » !
-4-
Webshag
●
Quoi?
–
●
Qui?
–
●
Outl d'audit de site web
SCRT (Lausanne, Suisse)
Pourquoi?
–
Quelques amélioratons et nouvelles idées
–
Mult-plateforme (Python)
–
Public, gratuit et open source (GPL)
-5-
Webshag
●
Écrit entèrement en Python
●
Diverses fonctonnalités
–
●
Scan de ports (utlise Nmap), recherche de domaines
référencés, spider, scanner d'URL, fuzzer de
fchiers
« Nouvelles » idées
–
Authentfcaton HTTP, évasion IDS, détecton de
« sof 404 », fuzzing dynamique
-6-
Dissecton
Scanner d'URL
●
●
Utlise deux bases de signatures
–
Base Nikto
–
Base personalisée
Divers threads efectuent des requêtes en parallèle
-8-
Faux positfs
●
●
La plupart des signatures reposent uniquement sur
le comportement normal pour détecter un « hit »
–
200 OK = Gagné !
–
404 Not Found = Perdu !
Malheureusement tous les serveurs web ne sont
pas aussi « coopératfs »
–
« sof 404 »
–
Réponse avec la page d'accueil
Nombreux
faux positifs
-9-
Fingerprintng
●
Idée: Prendre l'empreinte (« fngerprintng ») de
pages type, et comparer avec les réponses
–
[RepertoireRacine] (/, /admin/, ...)
–
/[PageAleatoire] (/trFsWs, ...)
–
/index.php
MD5((modifed) page body)
MD5(HTML tags)
200, text/html, 9c7fd984b8858718dae69f6b841be1d6, d955299d7be7dee58f6ed5432324f5af
HTTP Status Code
HTTP Content-Type
- 10 -
Fuzzer de fchiers
●
Approche « habituelle »
–
●
Listes de fchiers communs
Fuzzing dynamique
–
Noms de fchiers générés dynamiquement
–
Tient compte du contexte (fuzzing intelligent)
- 11 -
Fuzzer dynamique
●
Mode “générateur”
log_[a-z]{3}_200[0-9]{1}.txt
log_
aaa
0
aab
1
...
...
apr
_200
7
...
8
zzz
9
.txt
175'760 noms générés à la volée !
- 12 -
Fuzzer dynamique
●
Expressions génératrices
[charset]{taille}
●
Jeux de caractères (« charsets »)
expression
elements
# elements
0-9
0123456789
10
a-z
abcdefghijklmnopqrstuvwxyz
26
A-Z
ABCDEFGHIJKLMNOPQRSTUVWXYZ
26
a-Z
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
52
- 13 -
Autres idées...
●
Authentfcaton HTTP (Basic, Digest)
●
Evasion IDS
–
Serveur « proxy » aléatoire
●
Génératon de rapports (txt, html, xml)
●
Interfaces utlisateurs
–
GUI
–
CLI
- 14 -
Démonstratons
Bibliographie
[1] urllib2 -- extensible library for opening URLs, 2006, http://docs.python.org/lib/module-urllib2.html
[2] httplib -- HTTP protocol client, 2006, http://docs.python.org/lib/module-httplib.html
[3] RFC 2617 - HTTP Authentication: Basic and Digest Access Authentication, 1999
[4] RFC2069 - An Extension to HTTP : Digest Access Authentication, 1997
[5] RFC 2616 - Hypertext Transfer Protocol -- HTTP/1.1, 1999,
[6] ConfigParser -- Configuration file parser, 2006, http://docs.python.org/lib/module-httplib.html
[7] subprocess -- Subprocess management, 2006, http://docs.python.org/lib/module-subprocess.html
[8] xml.dom.minidom -- Lightweight DOM implementation, , http://docs.python.org/lib/
[9] HTMLParser -- Simple HTML and XHTML parser, , http://docs.python.org/lib/moduleHTMLParser.html
[10] Jeremiah Grossman, Identifying Web Servers, 2002
[11] Saumil Shah, An Introduction to HTTP fingerprinting, 2004
[12] Saumil Shah, HTTP Fingerprinting and Advanced Assessment Techniques, 2003
[13] optparse -- More powerful command line option parser, , http://docs.python.org/lib/moduleoptparse.html
[14] netcraft.com, Netcraft Web Server Survey, , http://survey.netcraft.com/Reports/200801/
[15] Roelof Temmingh, Wikto V1.51 Documentation, 2004, http://www.sensepost.com/research/wikto/
[16] Chris Sullo, Nikto v2 / The Manual, 2008, http://www.cirt.net/nikto2-docs/
[17] Jan Bodnar, The wxPython tutorial, 2007, http://www.zetcode.com/wxpython/c
- 16 -