\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{Yohan33} \pdfinfo{ /Title (adressage-reseau-et-ip.pdf) /Creator (Cheatography) /Author (Yohan33) /Subject (Adressage réseau et ip Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{A3A3A3} \definecolor{LightBackground}{HTML}{F3F3F3} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{Adressage réseau et ip Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{Yohan33} via \textcolor{DarkBackground}{\uline{cheatography.com/208543/cs/44699/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}Yohan33 \\ \uline{cheatography.com/yohan33} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Not Yet Published.\\ Updated 19th November, 2024.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{multicols*}{4} \begin{tabularx}{3.833cm}{x{1.7165 cm} x{1.7165 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{3.833cm}}{\bf\textcolor{white}{Terminal régulier}} \tn % Row 0 \SetRowColor{LightBackground} \seqsplit{/mnt/netta/apps/vnet/nemu-vnet} netadm & sert à lancer le réseau virtuel \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \seqsplit{/mnt/netta/apps/vnet/nemu-restore} ∼/vnet/netadm.tgz & restaurer le réseau virtuel précédemment sauvegardé \tn % Row Count 5 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{x{1.7165 cm} x{1.7165 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{3.833cm}}{\bf\textcolor{white}{Administration réseau local}} \tn % Row 0 \SetRowColor{LightBackground} ifconfig & lister les interfaces allumées \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} ifconfig -a & lister toutes les interfaces \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} ifconfig \textless{}iface\textgreater{} \textless{}@IP\textgreater{} netmask \textless{}netmask\textgreater{} & configurer l'interface \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} ifconfig \textless{}iface\textgreater{} up & allumer l'interface \tn % Row Count 7 (+ 1) % Row 4 \SetRowColor{LightBackground} ifconfig \textless{}iface\textgreater{} down & éteindre l'interface \tn % Row Count 9 (+ 2) % Row 5 \SetRowColor{white} ip -br addr & lister toutes les interfaces \tn % Row Count 11 (+ 2) % Row 6 \SetRowColor{LightBackground} ip addr add \textless{}@IP\textgreater{}/\textless{}netmask\textgreater{} dev \textless{}iface\textgreater{} & configurer l'interface \tn % Row Count 13 (+ 2) % Row 7 \SetRowColor{white} ip link set \textless{}iface\textgreater{} up & allumer l'interface \tn % Row Count 15 (+ 2) % Row 8 \SetRowColor{LightBackground} ip link set \textless{}iface\textgreater{} down & éteindre l'interface \tn % Row Count 17 (+ 2) % Row 9 \SetRowColor{white} ping \textless{}ip\textgreater{} & ping sur la machine local l'ip d'une machine \tn % Row Count 20 (+ 3) % Row 10 \SetRowColor{LightBackground} echo 1 \textgreater{} \seqsplit{/proc/sys/net/ipv4/ip\_forward} & ransmettre les paquets qui ne lui sont pas destinés \tn % Row Count 23 (+ 3) % Row 11 \SetRowColor{white} route -n & lister toutes les routes \tn % Row Count 25 (+ 2) % Row 12 \SetRowColor{LightBackground} route add default gw \textless{}@IP passerelle\textgreater{} & ajouter une route par défaut \tn % Row Count 27 (+ 2) % Row 13 \SetRowColor{white} route del default gw \textless{}@IP passerelle\textgreater{} & supprimer une route par défaut \tn % Row Count 29 (+ 2) % Row 14 \SetRowColor{LightBackground} ip route & lister toutes les routes \tn % Row Count 31 (+ 2) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{3.833cm}{x{1.7165 cm} x{1.7165 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{3.833cm}}{\bf\textcolor{white}{Administration réseau local (cont)}} \tn % Row 15 \SetRowColor{LightBackground} ip route add default via \textless{}@IP passerelle\textgreater{} & ajouter une route par défaut \tn % Row Count 3 (+ 3) % Row 16 \SetRowColor{white} ip route del default via \textless{}@IP passerelle\textgreater{} & supprimer une route par défaut \tn % Row Count 6 (+ 3) % Row 17 \SetRowColor{LightBackground} route add -net \textless{}@IP réseau\textgreater{} netmask \textless{}netmask\textgreater{} gw \textless{}@IP passerelle\textgreater{} & indiquer une passerelle spécifique par réseau de destinatio \tn % Row Count 10 (+ 4) % Row 18 \SetRowColor{white} ip route add \textless{}@IP réseau\textgreater{}/\textless{}netmask\textgreater{} via \textless{}@IP passerelle\textgreater{} & indiquer une passerelle spécifique par réseau de destinatio \tn % Row Count 14 (+ 4) % Row 19 \SetRowColor{LightBackground} ssh \textless{}login\textgreater{}@\textless{}destination\textgreater{} & test la communication entre 2 machines \tn % Row Count 16 (+ 2) % Row 20 \SetRowColor{white} traceroute \textless{}destination\textgreater{} & trace le chemin des échanges \tn % Row Count 18 (+ 2) % Row 21 \SetRowColor{LightBackground} \seqsplit{/etc/network/interfaces} & permet de modifier le fichier de configuration réseau \tn % Row Count 21 (+ 3) % Row 22 \SetRowColor{white} ifup eth0 & redémarre l'interface \tn % Row Count 23 (+ 2) % Row 23 \SetRowColor{LightBackground} ifdown eth0 & éteins l'interface \tn % Row Count 24 (+ 1) % Row 24 \SetRowColor{white} /var/www/html & écrire une page simple html dans le fichier \tn % Row Count 27 (+ 3) % Row 25 \SetRowColor{LightBackground} /etc/hostname & Configurez le nom de chaque machine \tn % Row Count 29 (+ 2) % Row 26 \SetRowColor{white} auto eth0 iface eth0 inet static address 192.168.0.1 netmask 255.255.255.0 gateway 192.168.0.254 & Configuration Statique dans le fichier \seqsplit{/etc/network/interfaces} \tn % Row Count 34 (+ 5) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{p{0.58361 cm} x{2.84939 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{3.833cm}}{\bf\textcolor{white}{terminal NEmu}} \tn % Row 0 \SetRowColor{LightBackground} \seqsplit{quit()} & quitter le réseau virtuel \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \seqsplit{save()} & sauvegarder le réseau virtuel \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \seqsplit{reboot()} & redémarrer violemment le réseau virtuel \tn % Row Count 4 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{x{1.7165 cm} x{1.7165 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{3.833cm}}{\bf\textcolor{white}{Attaque sur un réseau}} \tn % Row 0 \SetRowColor{LightBackground} arp -n, ip neigh & permet de consulter la table IP \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} arpspoof -t \textless{}@IP machine qui va se faire pwned\textgreater{} \textless{}@IP machine dont on souhaite usurper l'identité\textgreater{} & permet d'exécuter une attaque de spoofing ARP en redirigeant les paquets destinés à une adresse IP spécifique (la machine ciblée) vers l'attaquant, en faisant croire à la machine ciblée que l'attaquant est la passerelle ou une autre machine sur le réseau. \tn % Row Count 16 (+ 14) % Row 2 \SetRowColor{LightBackground} wireshark -i eth0 -k & capture le trafic qui passe sur le réseau \tn % Row Count 19 (+ 3) % Row 3 \SetRowColor{white} echo "/:\textless{}username\textgreater{}:\$(busybox httpd -m '\textless{}password\textgreater{}')" \textgreater{} /etc/httpd.conf Exemple: echo \seqsplit{"/:monsuperuser:\$(busybox} httpd -m \seqsplit{'monsupermotdepasse')"} \textgreater{} /etc/httpd.conf & ajoute une authentification au site web \tn % Row Count 27 (+ 8) % Row 4 \SetRowColor{LightBackground} busybox httpd -f -vv -h /var/www/html -r "Restricted Area:" -c /etc/httpd.conf & démarre un site web \tn % Row Count 31 (+ 4) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{x{2.09413 cm} x{1.33887 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{3.833cm}}{\bf\textcolor{white}{Attaque de type Deny Of Service}} \tn % Row 0 \SetRowColor{LightBackground} hping3 -{}-flood -{}-syn -{}-spoof \textless{}@IP source usurpée\textgreater{} \textless{}@IP victime\textgreater{} & inonde d'une ip à l'autre \tn % Row Count 3 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{x{1.7165 cm} x{1.7165 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{3.833cm}}{\bf\textcolor{white}{Réseau étendu}} \tn % Row 0 \SetRowColor{LightBackground} /sbin/ifconfig & pour récuperer les adresses ip du poste physique \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} \seqsplit{/mnt/netta/apps/vnet/nemu-vnet} netadm {[}nemu{]}-\textgreater{} slink() & lance le serveur pour le premier réseau \tn % Row Count 6 (+ 3) % Row 2 \SetRowColor{LightBackground} \seqsplit{/mnt/netta/apps/vnet/nemu-vnet} netadm {[}nemu{]}-\textgreater{} clink('\textless{}@IP du groupe principal\textgreater{}') & lancer le deuxième groupe \tn % Row Count 11 (+ 5) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{x{1.09856 cm} x{2.33444 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{3.833cm}}{\bf\textcolor{white}{compte admin}} \tn % Row 0 \SetRowColor{LightBackground} startx & démarre l'interface graphique \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} id: root mdp: plop & connexion au compte admin \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} reboot() & redémarre la machine \tn % Row Count 5 (+ 1) % Row 3 \SetRowColor{white} poweroff,halt & arrête proprement la machine virtuel \tn % Row Count 7 (+ 2) % Row 4 \SetRowColor{LightBackground} passwd \textless{}login\textgreater{} & changer le mot de passe \tn % Row Count 9 (+ 2) % Row 5 \SetRowColor{white} adduser \textless{}login\textgreater{} & ajoute un nouvel utilisateur \tn % Row Count 11 (+ 2) % Row 6 \SetRowColor{LightBackground} login \textless{}login\textgreater{} & se connecter sur un nouvel utilisateur \tn % Row Count 13 (+ 2) % Row 7 \SetRowColor{white} exit() & quitte le compte courant \tn % Row Count 14 (+ 1) % Row 8 \SetRowColor{LightBackground} hostname \textless{}name\textgreater{} & change le nom de la machine \tn % Row Count 16 (+ 2) % Row 9 \SetRowColor{white} \seqsplit{/etc/hostname} & change dans le fichier le nom \tn % Row Count 18 (+ 2) % Row 10 \SetRowColor{LightBackground} nano \textless{}fichier\textgreater{} & exécute un fichier \tn % Row Count 20 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{x{1.7165 cm} x{1.7165 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{3.833cm}}{\bf\textcolor{white}{Sécuristaion serveur SSL/TLS}} \tn % Row 0 \SetRowColor{LightBackground} openssl req -new -newkey rsa:4096 -x509 -sha256 -days 365 \textbackslash{} -nodes -out alcest.crt -keyout alcest.key & génère une nouvelle paire de clés RSA de 4096 bits, crée un certificat auto-signé au format X.509 valide pendant 365 jours, et enregistre le certificat dans le fichier alcest.crt et la clé privée dans le fichier alcest.key \tn % Row Count 12 (+ 12) % Row 1 \SetRowColor{white} cat & permet de lire le contenu du certificat \tn % Row Count 14 (+ 2) % Row 2 \SetRowColor{LightBackground} openssl x509 -in alcest.crt -text & permet de lire le contenu plus agréablement \tn % Row Count 17 (+ 3) % Row 3 \SetRowColor{white} cat alcest.key alcest.crt \textgreater{} alcest.pem & créer un fichier pem pour le serveur web. Ce type de fichier contient à la fois le certificat du serveur ainsi que sa clé privée \tn % Row Count 24 (+ 7) % Row 4 \SetRowColor{LightBackground} etc/lighttpd/conf- enabled/tls.conf & fichier permetttant d'activer SSL/TLS \tn % Row Count 26 (+ 2) % Row 5 \SetRowColor{white} server.modules += ("mod\_openssl") \$SERVER{[}"socket"{]} == "0.0.0.0:443" \{ ssl.engine = "enable" ssl.pemfile = \seqsplit{"/etc/lighttpd/security/alcest}.pem" \} & permet d'activer SSL/TLS dans un fichier \tn % Row Count 34 (+ 8) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{3.833cm}{x{1.7165 cm} x{1.7165 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{3.833cm}}{\bf\textcolor{white}{Sécuristaion serveur SSL/TLS (cont)}} \tn % Row 6 \SetRowColor{LightBackground} echo "\textless{}username\textgreater{}:\$(busybox httpd -m '\textless{}password\textgreater{}')" \textgreater{} \textless{}auth file\textgreater{} & ajoute une authentification au site web \tn % Row Count 4 (+ 4) % Row 7 \SetRowColor{white} systemctl start lighttpd & lance le serveur web \tn % Row Count 6 (+ 2) % Row 8 \SetRowColor{LightBackground} systemctl status lighttpd & vérifie l'état du serveur \tn % Row Count 8 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}