Compare commits
2 commits
d71ca0efbc
...
f5be203305
Author | SHA1 | Date | |
---|---|---|---|
![]() |
f5be203305 | ||
![]() |
7fa4124d57 |
10 changed files with 247 additions and 22 deletions
22
Rapport.md
22
Rapport.md
|
@ -1,22 +0,0 @@
|
||||||
# Protocole Cryptographique
|
|
||||||
## Introduction
|
|
||||||
Le projet a pour but de réaliser une attaque ARP dit 'ARP Spoofing' sur un serveur web. L'attaque ARP Spoofing consiste à envoyer des paquets ARP falsifiés à une machine cible pour lui faire croire que l'attaquant est la passerelle par défaut. Ainsi, l'attaquant peut intercepter le trafic entre la machine cible et la passerelle.
|
|
||||||
|
|
||||||
## Réflexion sur la mise en place
|
|
||||||
Pour réaliser cette démonstration, nous utilisons docker pour créer un réseau local de deux machines. La première machine est le serveur web et la deuxième machine est l'attaquant. La machine hôte joue le rôle de la victime qui se connecte au mauvais serveur web.
|
|
||||||
|
|
||||||
## Mise en place
|
|
||||||
### Prérequis
|
|
||||||
- Docker
|
|
||||||
- Docker-compose
|
|
||||||
|
|
||||||
### Lancement
|
|
||||||
Pour lancer le projet, il suffit de ce placer dans le dossier du projet et de lancer la commande suivante:
|
|
||||||
```bash
|
|
||||||
docker-compose up --build
|
|
||||||
```
|
|
||||||
Cette commande lancera les deux containers et les reliera entre eux. Le serveur web est accessible à l'adresse `http://localhost:8080`. Puis pour lancer l'attaque, il suffit de lancer le script `arp_spoof.py` dans le container de l'attaquant.
|
|
||||||
|
|
||||||
## Démonstration
|
|
||||||
|
|
||||||
|
|
5
Rapport/.gitignore
vendored
Normal file
5
Rapport/.gitignore
vendored
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
*.pdf
|
||||||
|
*.aux
|
||||||
|
*.lof
|
||||||
|
*.log
|
||||||
|
*.toc
|
BIN
Rapport/images/logo_ensibs.jpg
Normal file
BIN
Rapport/images/logo_ensibs.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 88 KiB |
BIN
Rapport/images/spoof.png
Normal file
BIN
Rapport/images/spoof.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 69 KiB |
BIN
Rapport/images/website.png
Normal file
BIN
Rapport/images/website.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 107 KiB |
80
Rapport/lib/cr.sty
Normal file
80
Rapport/lib/cr.sty
Normal file
|
@ -0,0 +1,80 @@
|
||||||
|
\usepackage{graphicx}
|
||||||
|
\usepackage{geometry}
|
||||||
|
\usepackage[french]{babel}
|
||||||
|
\usepackage[T1]{fontenc}
|
||||||
|
\usepackage{xparse}
|
||||||
|
\usepackage{hyperref}
|
||||||
|
|
||||||
|
\graphicspath{{images/}}
|
||||||
|
\geometry{
|
||||||
|
a4paper,
|
||||||
|
left=2.5cm,
|
||||||
|
right=2.5cm,
|
||||||
|
top=1.5cm,
|
||||||
|
bottom=1.5cm
|
||||||
|
}
|
||||||
|
|
||||||
|
\newcommand{\subtitle}[1]{\def\@subtitle{#1}}
|
||||||
|
\newcommand{\@subtitle}{}
|
||||||
|
|
||||||
|
\newcommand{\coverpage}[3] {
|
||||||
|
\begin{titlepage}
|
||||||
|
|
||||||
|
\begin{figure}[h]
|
||||||
|
\centering
|
||||||
|
\includegraphics[width=0.20\textwidth]{#2}
|
||||||
|
\end{figure}
|
||||||
|
|
||||||
|
\begin{center}
|
||||||
|
\large #1
|
||||||
|
|
||||||
|
\vspace{0.5cm}
|
||||||
|
|
||||||
|
\rule{\textwidth}{1pt}
|
||||||
|
|
||||||
|
\Huge \@title
|
||||||
|
|
||||||
|
\large \@subtitle
|
||||||
|
|
||||||
|
\rule{\textwidth}{1pt}
|
||||||
|
|
||||||
|
\large Par \@author
|
||||||
|
|
||||||
|
\large Le \today
|
||||||
|
\end{center}
|
||||||
|
|
||||||
|
\vspace{0.5cm}
|
||||||
|
|
||||||
|
\begin{figure}[h]
|
||||||
|
\centering
|
||||||
|
\includegraphics[width=0.75\textwidth]{#3}
|
||||||
|
\end{figure}
|
||||||
|
|
||||||
|
\end{titlepage}
|
||||||
|
}
|
||||||
|
|
||||||
|
\NewDocumentCommand{\crfigure}{O{0.75\textwidth} m m}{
|
||||||
|
\begin{figure}[h]
|
||||||
|
\centering
|
||||||
|
\includegraphics[width=#1]{#2}
|
||||||
|
\caption{#3}
|
||||||
|
\end{figure}
|
||||||
|
}
|
||||||
|
|
||||||
|
\NewDocumentCommand{\twofigures}{O{0.75\textwidth} m m m m}{
|
||||||
|
\begin{figure}[h]
|
||||||
|
\centering
|
||||||
|
\begin{minipage}[t]{0.45\dimexpr#1}
|
||||||
|
\centering
|
||||||
|
\includegraphics[width=\textwidth]{#2}
|
||||||
|
\caption{#3}
|
||||||
|
\end{minipage}
|
||||||
|
\hspace{0.05\textwidth}
|
||||||
|
\begin{minipage}[t]{0.45\dimexpr#1}
|
||||||
|
\centering
|
||||||
|
\includegraphics[width=\textwidth]{#4}
|
||||||
|
\caption{#5}
|
||||||
|
\end{minipage}
|
||||||
|
\end{figure}
|
||||||
|
}
|
||||||
|
|
10
Rapport/makefile
Normal file
10
Rapport/makefile
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
name=CR_TP3_Protocole_Cryptographique
|
||||||
|
|
||||||
|
make:
|
||||||
|
pdflatex -jobname=$(name) src/source.tex
|
||||||
|
pdflatex -jobname=$(name) src/source.tex
|
||||||
|
rm -rf *.lof *.log *.toc *.aux *.out
|
||||||
|
rm -rf src/*.lof src/*.log src/*.toc src/*.aux
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -rf *.pdf
|
19
Rapport/src/source.fdb_latexmk
Normal file
19
Rapport/src/source.fdb_latexmk
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
# Fdb version 3
|
||||||
|
["pdflatex"] 1737459327 "/home/student/Documents/Protocole_Crypto/TP3/Rapport/src/source.tex" "/home/student/Documents/Protocole_Crypto/TP3/Rapport/src/source.pdf" "source" 1737459327
|
||||||
|
"/etc/texmf/web2c/texmf.cnf" 1727780187 475 c0e671620eb5563b2130f56340a5fde8 ""
|
||||||
|
"/home/student/Documents/Protocole_Crypto/TP3/Rapport/src/./lib/cr.sty" 0 -1 0 ""
|
||||||
|
"/home/student/Documents/Protocole_Crypto/TP3/Rapport/src/source.aux" 1737459327 8 a94a2480d3289e625eea47cd1b285758 ""
|
||||||
|
"/home/student/Documents/Protocole_Crypto/TP3/Rapport/src/source.tex" 1737459326 5508 b784d438524158ecb0dcca6e0837fbb6 ""
|
||||||
|
"/usr/share/texlive/texmf-dist/fonts/map/fontname/texfonts.map" 1577235249 3524 cb3e574dea2d1052e39280babc910dc8 ""
|
||||||
|
"/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmr12.tfm" 1136768653 1288 655e228510b4c2a1abe905c368440826 ""
|
||||||
|
"/usr/share/texlive/texmf-dist/tex/latex/base/article.cls" 1580683321 20023 e427dd9e17e239bf926ef3aab67fe35e ""
|
||||||
|
"/usr/share/texlive/texmf-dist/tex/latex/base/size12.clo" 1580683321 8447 5c4b8ee712f8e349df2722115bc8c513 ""
|
||||||
|
"/usr/share/texlive/texmf-dist/web2c/texmf.cnf" 1581979058 38841 ce3692aa899bb693b90b87eaa5d4d84e ""
|
||||||
|
"/usr/share/texmf/web2c/texmf.cnf" 1581979058 38841 ce3692aa899bb693b90b87eaa5d4d84e ""
|
||||||
|
"/var/lib/texmf/web2c/pdftex/pdflatex.fmt" 1727850466 8256687 0ab32530cd61ac827b7b341df2f6aaf3 ""
|
||||||
|
"lib/cr.sty" 0 -1 0 ""
|
||||||
|
"source.tex" 1737459326 5508 b784d438524158ecb0dcca6e0837fbb6 ""
|
||||||
|
(generated)
|
||||||
|
"/home/student/Documents/Protocole_Crypto/TP3/Rapport/src/source.pdf"
|
||||||
|
"/home/student/Documents/Protocole_Crypto/TP3/Rapport/src/source.log"
|
||||||
|
"source.log"
|
13
Rapport/src/source.fls
Normal file
13
Rapport/src/source.fls
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
PWD /home/student/Documents/Protocole_Crypto/TP3/Rapport/src
|
||||||
|
INPUT /etc/texmf/web2c/texmf.cnf
|
||||||
|
INPUT /usr/share/texmf/web2c/texmf.cnf
|
||||||
|
INPUT /usr/share/texlive/texmf-dist/web2c/texmf.cnf
|
||||||
|
INPUT /var/lib/texmf/web2c/pdftex/pdflatex.fmt
|
||||||
|
INPUT /home/student/Documents/Protocole_Crypto/TP3/Rapport/src/source.tex
|
||||||
|
OUTPUT /home/student/Documents/Protocole_Crypto/TP3/Rapport/src/source.log
|
||||||
|
INPUT /usr/share/texlive/texmf-dist/tex/latex/base/article.cls
|
||||||
|
INPUT /usr/share/texlive/texmf-dist/tex/latex/base/article.cls
|
||||||
|
INPUT /usr/share/texlive/texmf-dist/tex/latex/base/size12.clo
|
||||||
|
INPUT /usr/share/texlive/texmf-dist/tex/latex/base/size12.clo
|
||||||
|
INPUT /usr/share/texlive/texmf-dist/fonts/map/fontname/texfonts.map
|
||||||
|
INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmr12.tfm
|
120
Rapport/src/source.tex
Normal file
120
Rapport/src/source.tex
Normal file
|
@ -0,0 +1,120 @@
|
||||||
|
\documentclass[12pt, a4paper]{article}
|
||||||
|
\usepackage{./lib/cr}
|
||||||
|
|
||||||
|
\title{Compte-rendu TP ARP Spoofing}
|
||||||
|
\author{Lukian LEIZOUR, Jérémy DEMON, Titouan DIARD}
|
||||||
|
\date{\today}
|
||||||
|
|
||||||
|
\begin{document}
|
||||||
|
|
||||||
|
\coverpage{ICE - Informatique et Cybersécurité (Cybersécurité du logiciel)}{logo_ensibs}{logo_ensibs}
|
||||||
|
\tableofcontents
|
||||||
|
\listoffigures
|
||||||
|
\newpage
|
||||||
|
|
||||||
|
|
||||||
|
\section{Introduction}
|
||||||
|
Le projet a pour but de réaliser une attaque ARP dit 'ARP Spoofing' sur un serveur web. L'attaque ARP Spoofing consiste à envoyer des paquets ARP falsifiés à une machine cible pour lui faire croire que l'attaquant est la passerelle par défaut. Ainsi, l'attaquant peut intercepter le trafic entre la machine cible et la passerelle.
|
||||||
|
|
||||||
|
|
||||||
|
\section{Méthodologie}
|
||||||
|
Pour réaliser cette démonstration, nous utilisons docker pour créer un réseau local de deux machines. La première machine est le serveur web et la deuxième machine est l'attaquant. La machine hôte joue le rôle de la victime qui se connecte au mauvais serveur web.
|
||||||
|
|
||||||
|
Après les trois heures de TP, nous avons pas pu terminer la partie 1 car l'architecture docker ne fonctionnait pas correctement. La partie 1 ne sera donc pas totalement traiter dans ce rapport.
|
||||||
|
|
||||||
|
\section{Prérequis}
|
||||||
|
Pour réaliser ce TP, il est nécessaire d'avoir installé docker et docker-compose sur la machine hôte. Il est également nécessaire d'avoir des connaissances en réseautage et en sécurité informatique.
|
||||||
|
|
||||||
|
\section{Installation}
|
||||||
|
Pour installer le projet, il suffit de cloner le dépôt git à l'adresse suivante : \url{git@git.leizour.fr:CyberFlingues/arp-spoofing.git}.
|
||||||
|
|
||||||
|
Si vous souhaitez lancer l'ARP Spoofing, il suffit de lancer la commande \texttt{docker-compose up} dans le répertoire "apache".
|
||||||
|
Si vous souhaitez lancer la partie de sécurisation RSA, il suffit de lancer la commande \texttt{docker-compose up} dans le répertoire "rsa".
|
||||||
|
|
||||||
|
|
||||||
|
\section{Partie 1 : ARP Spoofing}
|
||||||
|
|
||||||
|
\subsection{Configuration du réseau}
|
||||||
|
Nous avons commencer par créer les docker avec les fichiers docker-compose.yml et Dockerfile. Le docker compose crée trois containers : un serveur web, un attaquant et une victime. Le serveur web est un serveur apache qui sert une page web. L'attaquant est un container debian avec les outils nécessaires pour le réseautage. La victime est un container debian qui se connecte au serveur web.
|
||||||
|
|
||||||
|
Voici les identités des machines:
|
||||||
|
|
||||||
|
\begin{table}[h!]
|
||||||
|
\centering
|
||||||
|
\begin{tabular}{|c|c|c|}
|
||||||
|
\hline
|
||||||
|
\textbf{Machine} & \textbf{Adresse IP} & \textbf{Adresse MAC} \\
|
||||||
|
\hline
|
||||||
|
Serveur web & 172.21.0.2 & 02:42:ac:15:00:02 \\
|
||||||
|
\hline
|
||||||
|
Attaquant & 172.21.0.3 & 02:42:ac:15:00:03 \\
|
||||||
|
\hline
|
||||||
|
Victime & 172.21.0.4 & 02:42:ac:15:00:04 \\
|
||||||
|
\hline
|
||||||
|
\end{tabular}
|
||||||
|
\caption{Identités des machines dans le réseau}
|
||||||
|
\label{tab:identites}
|
||||||
|
\end{table}
|
||||||
|
|
||||||
|
\subsection{Configuration du serveur web}
|
||||||
|
Le serveur web est un container apache qui sert une page web. Pour cela, nous avons créé un fichier index.html dans le répertoire /var/www/html du container. Le serveur web est accessible en localhost depuis le pc hote des containers.
|
||||||
|
On génère une clé privée et un certificat auto-signé pour le serveur web avec la commande \texttt{openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/apache-selfsigned.key -out /etc/ssl/certs/apache-selfsigned.crt}.
|
||||||
|
On configure ensuite le serveur apache pour qu'il utilise le certificat auto-signé avec les commandes suivantes:
|
||||||
|
\begin{verbatim}
|
||||||
|
a2enmod ssl
|
||||||
|
a2ensite default-ssl
|
||||||
|
service apache2 restart
|
||||||
|
\end{verbatim}
|
||||||
|
|
||||||
|
On modifie les fichiers 000-default.conf et default-ssl.conf pour qu'ils utilisent le certificat auto-signé puis on redémarre le serveur apache.
|
||||||
|
|
||||||
|
\begin{figure}[h!]
|
||||||
|
\centering
|
||||||
|
\includegraphics[width=0.8\textwidth]{images/website.png}
|
||||||
|
\caption{Page web du serveur apache sécurisé}
|
||||||
|
\label{fig:website}
|
||||||
|
\end{figure}
|
||||||
|
|
||||||
|
\subsection{ARP Spoofing}
|
||||||
|
A ce moment là, le serveur web fonctionne correctement et la victime et l'attaquant peuvent se connecter au serveur web.
|
||||||
|
Avec la commande \texttt{arpspoof -i eth0 -c host -t 172.21.0.4 -r 172.21.0.2}, l'attaquant envoie des paquets ARP à la victime pour lui faire croire que l'attaquant est la passerelle par défaut. Ainsi, l'attaquant peut intercepter le trafic entre la victime et le serveur web.
|
||||||
|
|
||||||
|
\begin{figure}[h!]
|
||||||
|
\centering
|
||||||
|
\includegraphics[width=0.8\textwidth]{images/spoof.png}
|
||||||
|
\caption{Résultats obtenus lors de l'attaque ARP Spoofing}
|
||||||
|
\label{fig:arpspoof}
|
||||||
|
\end{figure}
|
||||||
|
|
||||||
|
On observe que la table ARP de la victime est modifiée pour associer l'adresse IP du serveur web à l'adresse MAC de l'attaquant.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
\begin{table}[h!]
|
||||||
|
\centering
|
||||||
|
\begin{tabular}{|c|c|c|c|c|}
|
||||||
|
\hline
|
||||||
|
\textbf{Address} & \textbf{HWtype} & \textbf{HWaddress} & \textbf{Flags} & \textbf{Iface} \\
|
||||||
|
\hline
|
||||||
|
attacker & ether & 02:42:ac:15:00:03 & C & eth0 \\
|
||||||
|
\hline
|
||||||
|
webserver & ether & 02:42:ac:15:00:03 & C & eth0 \\
|
||||||
|
\hline
|
||||||
|
\end{tabular}
|
||||||
|
\caption{Résultats obtenus lors de l'attaque ARP Spoofing}
|
||||||
|
\label{tab:resultats}
|
||||||
|
\end{table}
|
||||||
|
|
||||||
|
On s'est arrêté à ce stade car malgré plusieurs tentatives, la victime a ça table ARP empoisonnée mais il peut toujours accéder au serveur web. Il y a une interception des packets mais la victime n'est pas redirigée vers une page web malveillante.
|
||||||
|
|
||||||
|
\section{Partie 2 : Sécurisation des communications avec RSA}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
\end{document}
|
Loading…
Add table
Add a link
Reference in a new issue