secres:https-interception
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| secres:https-interception [2017/11/24 15:17] – orel | secres:https-interception [2024/03/18 15:06] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| Nous allons mettre en oeuvre le mécanisme d' | Nous allons mettre en oeuvre le mécanisme d' | ||
| - | |||
| - | === Démo === | ||
| Considérons le réseau suivant : | Considérons le réseau suivant : | ||
| - | Client Web < | + | Client Web < |
| - | | + | |
| + | === Proxy SSL === | ||
| + | |||
| + | Voici le code de notre proxy SSL : | ||
| <code python sslproxy.py> | <code python sslproxy.py> | ||
| Line 18: | Line 19: | ||
| import ssl | import ssl | ||
| import sys | import sys | ||
| - | import OpenSSL | ||
| import time | import time | ||
| import datetime | import datetime | ||
| Line 126: | Line 126: | ||
| </ | </ | ||
| + | === Génération des faux certificats === | ||
| Commençons par générer un //fake CA// : | Commençons par générer un //fake CA// : | ||
| - | $ certtool --generate-privkey --outfile ca-key.pem | + | $ certtool --generate-privkey --outfile |
| - | $ certtool --generate-self-signed --load-privkey ca-key.pem --outfile ca-cert.pem | + | $ certtool --generate-self-signed --load-privkey |
| - | $ certtool --certificate-info --infile ca-cert.pem | + | |
| + | Voici les réponses à donner strictement : | ||
| * La plupart des champs peuvent rester vides. | * La plupart des champs peuvent rester vides. | ||
| - | * Common name: CA | + | * Common name: FAKECA |
| * The certificate will expire in (days): 255 | * The certificate will expire in (days): 255 | ||
| * Does the certificate belong to an authority? (y/N): y | * Does the certificate belong to an authority? (y/N): y | ||
| Line 140: | Line 142: | ||
| * CRL signing: y | * CRL signing: y | ||
| * All other extensions: NO (required) | * All other extensions: NO (required) | ||
| + | |||
| + | Pour afficher le contenu de son certificat : | ||
| + | |||
| + | $ certtool --infile fake-ca-cert.pem -i | ||
| Générons maintenant le //fake// certifcat de notre serveur. | Générons maintenant le //fake// certifcat de notre serveur. | ||
| - | $ certtool --generate-privkey --outfile server-key.pem | + | $ certtool --generate-privkey --outfile |
| - | $ certtool --generate-certificate --load-privkey server-key.pem --outfile server-cert.pem --load-ca-certificate ca-cert.pem --load-ca-privkey ca-key.pem | + | $ certtool --generate-certificate --load-privkey |
| - | $ certtool --certificate-info --infile server-cert.pem | + | |
| - | | + | Voici les réponses à donner strictement : |
| * La plupart des champs peuvent rester vides | * La plupart des champs peuvent rester vides | ||
| * CN=nile.metal.fr | * CN=nile.metal.fr | ||
| Line 155: | Line 162: | ||
| * Will the certificate be used for encryption (not required for TLS)? (y/N): y | * Will the certificate be used for encryption (not required for TLS)? (y/N): y | ||
| - | + | Vous pouvez également utiliser le script | |
| - | Vous pouvez également utiliser le script | + | |
| ./ | ./ | ||
| Line 166: | Line 172: | ||
| import sys | import sys | ||
| import pprint | import pprint | ||
| - | import OpenSSL | + | import OpenSSL |
| import time | import time | ||
| import datetime | import datetime | ||
| import os | import os | ||
| import struct | import struct | ||
| - | |||
| # this certificate must be trusted by the client victim! | # this certificate must be trusted by the client victim! | ||
| Line 275: | Line 280: | ||
| </ | </ | ||
| | | ||
| + | |||
| + | === Lancement du Proxy HTTPS === | ||
| + | |||
| Lancement du proxy : | Lancement du proxy : | ||
| Line 281: | Line 289: | ||
| ./ | ./ | ||
| + | === Mise en oeuvre avec un client === | ||
| Sur le client : | Sur le client : | ||
| Line 288: | Line 297: | ||
| Pour ajouter le //fake// CA dans le store du client, il faut faire : | Pour ajouter le //fake// CA dans le store du client, il faut faire : | ||
| - | | + | |
| cp ca-cert.crt / | cp ca-cert.crt / | ||
| dpkg-reconfigure ca-certificates | dpkg-reconfigure ca-certificates | ||
| | | ||
| + | Puis, il suffit de faire : | ||
| + | | ||
| + | wget -4 https:// | ||
| + | | ||
| + | |||
| + | Video de démo par A. Guermouche : https:// | ||
| + | |||
| ==== Documentation ==== | ==== Documentation ==== | ||
| - | Le code et la documentation du projet sont ici : https:// | + | Le code et la documentation du projet |
| About HTTPS interception: | About HTTPS interception: | ||
secres/https-interception.1511536623.txt.gz · Last modified: 2024/03/18 15:05 (external edit)
