« Atelier SysRes SE2a5 2023/2024 E2 » : différence entre les versions

De wiki-se.plil.fr
Aller à la navigation Aller à la recherche
 
(64 versions intermédiaires par le même utilisateur non affichées)
Ligne 1 : Ligne 1 :
== '''Informations :''' ==
IP : 172.26.145.112
IP : 172.26.145.112
Nom du domaine: berlin2.lol
Machine de service: berlin
Machine mandataire: judo


== '''13/09/2023 :''' ==
== '''13/09/2023 :''' ==


=== Création de la VM ===
* Création de la VM
<syntaxhighlight lang="linux-config">
<syntaxhighlight lang="linux-config">
xen-create-image --hostname=berlin --ip=172.26.145.112 --dir=/usr/local/xen --dhcp
xen-create-image --hostname=berlin --ip=172.26.145.112 --dir=/usr/local/xen --dhcp
</syntaxhighlight>
</syntaxhighlight>
*Configuration de la VM
<syntaxhighlight lang="linux-config">
xen create berlin.cfg


* vi /etc/network/interfaces : remplacer DHCP par static
</syntaxhighlight>
address 172.26.145.112/24


* Accéder à la VM
<syntaxhighlight lang="linux-config">
xen console berlin
</syntaxhighlight>
*vi /etc/network/interfaces : remplacer DHCP par static
*Mise en place de l'adressage IP pour ssh :
<syntaxhighlight lang="linux-config">
address 172.26.145.112/24
gateway 172.26.145.254
gateway 172.26.145.254
</syntaxhighlight>
* Activation du PermitRootPassword dans /etc/ssh/sshd_config
<syntaxhighlight lang="linux-config">
PermitRootLogin yes
</syntaxhighlight>


== '''14/09/2023 :''' ==
=='''14/09/2023 :'''==


=== Configuration ===
* Configuration de l'interface eth0:
Configuration de l'interface:<syntaxhighlight lang="linux-config">
<syntaxhighlight lang="linux-config">
nano /etc/network/interfaces
nano /etc/network/interfaces




</syntaxhighlight>Modifications:<syntaxhighlight lang="linux-config">
</syntaxhighlight>
 
* Nous avons configuré le fichier /etc/network/interfaces
<syntaxhighlight lang="linux-config">
auto eth0
auto eth0
iface eth0 inet static
iface eth0 inet static
Ligne 26 : Ligne 52 :
gateway 172.26.145.254
gateway 172.26.145.254
</syntaxhighlight>
</syntaxhighlight>
=== Création d’un conteneur à la main ===
===Création d’un conteneur à la main===
Sous machine Zabeth:<syntaxhighlight lang="linux-config">
 
su -
* Sous machine Zabeth:
<syntaxhighlight lang="linux-config">
</syntaxhighlight><syntaxhighlight>
</syntaxhighlight><syntaxhighlight>
dd if=/dev/zero of=toto bs=1024k count=10240
dd if=/dev/zero of=toto bs=1024k count=10240
mkfs /home/pifou/toto
mkfs /home/pifou/toto
mkdir tmp/mnt
mkdir tmp/mnt
mount -oloop /home/pifou/toto /tmp/mnt
mount -oloop /home/pifou/toto /tmp/mnt
apt install debootstrap
apt install debootstrap
debootstrap stable /tmp/mnt
debootstrap stable /tmp/mnt
echo "proc /proc proc defaults 0 0" >> /tmp/mnt/etc/fstab
echo "proc /proc proc defaults 0 0" >> /tmp/mnt/etc/fstab
unshare -p -f -m chroot /tmp/mnt  /bin/sh -c "mount /proc ; /bin/bash"
unshare -p -f -m chroot /tmp/mnt  /bin/sh -c "mount /proc ; /bin/bash"
</syntaxhighlight>
</syntaxhighlight>


=== Docker ===
===Docker===
<syntaxhighlight>
<syntaxhighlight>
docker run -i -t debian /bin/bash
docker run -i -t debian /bin/bash
</syntaxhighlight>
</syntaxhighlight>


== '''02/10/2023''' ==
=='''02/10/2023'''==


* Configuration du ssh
*Configuration du ssh : /etc/ssh/sshd_config<syntaxhighlight lang="linux-config">
<syntaxhighlight lang="linux-config">
PermitRootLogin yes
nano /etc/ssh/sshd_config
</syntaxhighlight>
</syntaxhighlight>PermitRootLogin yes
 
* Installer '''apache2''' et '''bind9'''


*Installer '''apache2''' et '''bind9'''


* créez deux partitions LVM (var et home) de 10G pour notre VM:
<syntaxhighlight lang="linux-config">
lvcreate -L10G -nberlin-var virtual
lvcreate -L10G -nberlin-var virtual


lvcreate -L10G -nberlin-home virtual
lvcreate -L10G -nberlin-home virtual
</syntaxhighlight>
=='''05/10/2023'''==


== '''05/10/2023''' ==
* Nous avons implanté les répertoires <code>/var</code> et <code>/home</code> de la machine virtuelle sur les partitions LVM
<syntaxhighlight lang="linux-config">
mkdir /new-home
mkdir /new-var
mkfs /dev/xvdb1
mkfs /dev/xvdb1
mkfs /dev/xvdb2
mkfs /dev/xvdb2
mkdir new-var
mkdir new-home
mount /dev/xvdb1 /new-home
mount /dev/xvdb1 /new-home
mount /dev/xvdb2 /new-var
mount /dev/xvdb2 /new-var
mv /var/* /new-var
</syntaxhighlight>


lsblk<syntaxhighlight lang="linux-config">
* lsblk
<syntaxhighlight lang="linux-config">
xvda1 202:1    0  512M  0 disk [SWAP]
xvda1 202:1    0  512M  0 disk [SWAP]
xvda2 202:2    0  10G  0 disk /
xvda2 202:2    0  10G  0 disk /
Ligne 85 : Ligne 107 :
xvdb2 202:18  0  10G  0 disk /root/new-var
xvdb2 202:18  0  10G  0 disk /root/new-var


</syntaxhighlight>umount /root/new-var
</syntaxhighlight>


*nano /etc/fstab
<syntaxhighlight lang="linux-config">
/dev/xvdb1 /home ext2 defaults 0 2
/dev/xvdb2 /var  ext4 defaults 0 2
</syntaxhighlight><syntaxhighlight lang="linux-config">
umount /root/new-var
umount /root/new-home
umount /root/new-home
mount -a
mount -a
 
</syntaxhighlight>
lsblk<syntaxhighlight lang="linux-config">
*lsblk
<syntaxhighlight lang="linux-config">
xvda1 202:1    0  512M  0 disk [SWAP]
xvda1 202:1    0  512M  0 disk [SWAP]
xvda2 202:2    0  10G  0 disk /
xvda2 202:2    0  10G  0 disk /
Ligne 97 : Ligne 126 :
xvdb2 202:18  0  10G  0 disk /var
xvdb2 202:18  0  10G  0 disk /var


</syntaxhighlight>reboot
</syntaxhighlight>
 
=== Création de la machine mandataire judo(avec Baptiste): ===
 
* Création de la machine mandataire virtuelle
 
xen-create-image --hostname=judo --ip=193.48.57.165 --netmask=255.255.255.240 --bridge=SE2a5 --dir=/usr/local/xen --password=glopglop --gateway=193.48.57.161
 
* Création de la VM mandataire :
 
xen create /etc/xen/judo.cfg
xen console judo
<code>xen create /etc/xen/.cfg</code> <code>xen console judo</code>
 
Adresse IPV6 de notre machine JUDO : <code>2001:660:4401:60a0:216:3eff:fe0b:d504</code>
 
* Dand le fichier : /etc/resolv.conf
 
search plil.info
nameserver 8.8.8.8
nameserver 193.48.57.48
 
* Création du bridge:
 
#judo_bridge
auto judo
iface judo inet manual
  bridge_ports none
  post-up ip link set $IFACE up
  post-down ip link set $IFACE down
 
* ajout des interfaces sur la machine de service paris :
 
auto eth1
iface eth1 inet static
        address 192.168.165.2/24
        gateway 192.168.165.1
        post-up ethtool -K eth1 tx off
* ajout des interfaces sur la machine de service berlin :
<syntaxhighlight lang="linux-config">
auto eth1
iface eth1 inet static
        address 192.168.165.3/24
        gateway 192.168.165.1
        post-up ethtool -K eth1 tx off
</syntaxhighlight>
 
* ajout de l'interface sur la machine mandataire :
 
auto eth1
iface eth1 inet static
        address 192.168.165.1/24
Nous avons maintenant un réseau privé entre nos deux machines de services et notre machine mandataire.
 
* Mise en place de la mascarade:<syntaxhighlight lang="linux-config">
iptables -t nat -A POSTROUTING -j MASQUERADE -s 192.168.165.0/24
apt install iptables-persistent
iptable -save
 
</syntaxhighlight>
 
* Dans le fichier /etc/sysctl.conf :( nous avons modifié  la ligne permettant le forward ipv4 permettant a nos machines d'envoyer des paquets sur internet.
* pour activer le transfert de paquets IP<syntaxhighlight lang="linux-config">
net.ipv4.ip_forward=1
</syntaxhighlight>
 
Pour se connecter sur nos machines on utilise maintenant cette commande <code>ssh -J root@193.48.57.165 root@192.168.165.3</code>
* Création du serveur DNS sur gandi:
<syntaxhighlight lang="linux-config">
ns1.berlin2.lol
 
193.48.57.165
2001:660:4401:60a0:216:3eff:fe0b:d504
</syntaxhighlight>
 
== '''10/11/2023:''' ==
* Modification: nano /etc/bind/db.berlin2.lol
<syntaxhighlight lang="linux-config">
$TTL 1H
berlin2.lol.    IN      SOA    ns1.berlin2.lol. berlin222@mail.com. (
                                        2011041902 ; Serial
                                        1H ; Refresh
                                        15M ; Retry
                                        2W ; Expire
                                        3M ; Minimum TTL
                                        )
berlin.lol.      IN NS  ns1.berlin2.lol.
berlin.lol.      IN A    193.48.57.165
ns1.berlin2.lol. IN A    193.48.57.165
ns1.berlin2.lol. IN AAAA  2001:660:4401:60a0:216:3eff:fe9b:446d
www.berlin2.lol. IN CNAME ns1.berlin2.lol.
</syntaxhighlight>
 
* Ajout de la zone dans le fichier named.conf.local :
<syntaxhighlight lang="linux-config">
zone "berlin2.lol" {
    type master;
    file "/etc/bind/db.berlin2.lol";
    allow-transfer { 192.168.165.1; };
};
</syntaxhighlight>
 
* Machine mandataire :
 
modification du fichier de config named.config.local, nous avons ajouté les deux zones de nos machines de service:
zone "paris13.lol" {
        type slave;
        file "/etc/bind/db.paris13.lol";
        masters {192.168.165.2;};
};
zone "berlin2.lol" {
        type slave;
        file "/etc/bind/db.berlin2.lol";
        masters {192.168.165.3;};
};
 
=== Accès https sur apache, Création d'un certificat : ===
<syntaxhighlight lang="linux-config">
https://www.vincentliefooghe.net/content/activer-un-acc%C3%A8s-https-sur-apache
</syntaxhighlight>
* Création d'un certificat :<syntaxhighlight lang="linux-config">
openssl req -nodes -newkey rsa:2048 -sha256 -keyout berlin2.key -out berlinserver.csr -utf8
</syntaxhighlight>
 
* Création du Virtual Host :<syntaxhighlight lang="linux-config">
# vhost https
<VirtualHost *:443>
  DocumentRoot /var/www/html
  ServerName  berlin2.lol
 
  ServerSignature Off
  ErrorLog ${APACHE_LOG_DIR}/berlin2.log     
  LogLevel info     
  CustomLog ${APACHE_LOG_DIR}/berlin2.log combined     
 
  SSLEngine on
  SSLCertificateFile /etc/ssl/certs/berlinserver.crt
  SSLCertificateKeyFile /etc/ssl/private/berlin2.key
</VirtualHost>
</syntaxhighlight>
 
== '''23/11/2023:''' ==
 
* Sécurisation de la clé privée : chmod 440 berlin2.key
*Ajout des deux dns records dans notre fichier: /etc/bind/db.berlin2.lol
*Ajout du dns secondaire : ns6.gandi.net
*Recherche des adresse IPv4 et IPV6: host ns6.gandi.net
*Ajout des deux adresses IP dans le fichier: /config.name.local
*Incrémentation du numéro série puis service bind9 restart
*Sur le site gandi.net: nous avons ajouté le dns secondaire : ns6.gandi.net
 
=== Sécurisation dnssec: ===
*Gestion automatique des clefs: dans le fichier: /etc/bind/named.conf.local<syntaxhighlight lang="linux-config">
dnssec-policy "berlin2-lol" {
    keys {
        ksk key-directory lifetime unlimited algorithm 13;
        zsk key-directory lifetime unlimited algorithm 13;
    };
    nsec3param;
};
 
key-directory "/etc/bind/keys";
dnssec-policy "berlin2-lol";
inline-signing yes;
</syntaxhighlight>Note: dnssec-policy ne fonctionne pas sur bind9, nous avons dons mis à jour bind9 à la dernière version  nommé "named",
*Modification des sources dans '''/etc/apt/sources.list''' (chimaera) puis mis à jour avec '''apt update''' et '''apt install bind9'''
*chown bind : bind
*Service named restart
 
=== Validation du certificat sur gandi: ===
Apres avoir reçu le certificat dns sur gandi, je l'ai télechargé et je l'ai copié sur la machine mandataire puis sur la machine de service: <syntaxhighlight lang="linux-config">
scp /etc/ssl/private/berlin2.key root@193.48.57.165:/etc/ssl/private/
scp /etc/ssl/certs/berlin2.lol.crt root@192.168.165.3:/etc/ssl/certs
</syntaxhighlight>
 
* Modification du virtualhost de la machine de service: /etc/apache2/sites-available/vhost-https.conf
<syntaxhighlight lang="linux-config">
# vhost https
<VirtualHost *:443>
  DocumentRoot /var/www/html
  ServerName  berlin2.lol
 
  ServerSignature Off
  ErrorLog ${APACHE_LOG_DIR}/berlin2.log     
  LogLevel info     
  CustomLog ${APACHE_LOG_DIR}/berlin2.log combined     
 
  SSLEngine on
  SSLCertificateFile /etc/ssl/certs/berlin2.lol.crt
  SSLCertificateKeyFile /etc/ssl/private/berlin2.key
</VirtualHost>
</syntaxhighlight>
 
* Modification du virtualhost de la machine mandataire: /etc/apache2/sites-available/vhost-https.conf <syntaxhighlight lang="linux-config">
<VirtualHost *:443>
  DocumentRoot /var/www/html
  ServerName berlin2.lol
  ServerAlias www.berlin2.lol
 
  ServerSignature Off
  ErrorLog ${APACHE_LOG_DIR}/error_berlin2.log
  LogLevel info
  CustomLog ${APACHE_LOG_DIR}/access_berlin2.log combined
 
  SSLEngine on
  SSLCertificateFile  /etc/ssl/certs/berlin2.lol.crt
  SSLCertificateKeyFile /etc/ssl/private/berlin2.key
  SSLProxyEngine on
  ProxyPass / http://192.168.165.3
  ProxyPassReverse / http://192.165.3
</VirtualHost>
</syntaxhighlight>
* Activation du ssl : "a2enmode ssl"
* Activation du virtualhost: "a2ensite vhost-https.conf"
* Activation du proxy : "a2enmode proxy*", (pour activer proxy et proxy_http)
* Service apache2 restart
* analyse sur dnsvis.net
[[Fichier:Imagedns.png|vignette|centré]]
 
== '''24/11/2023:''' ==
 
=== Cassage de clef WEP d’un point d’accès WiFi ===
* Sur la machine zabeth: commande nmclic device wifi
<syntaxhighlight lang="linux-config">
BSSID              SSID            MODE  CHAN  RATE        SIGNAL  BARS  SECURITY
04:DA:D2:9C:50:51  cracotte02    Infra    13    54 Mbit/s  95      ▂▄▆█  WEP
 
</syntaxhighlight>
 
* airodump-ng
 
[[Fichier:Image airmon.png|1215x1215px|centré]]
 
 
* airodump-ng -c 13 --bssid 04:DA:D2:9C:50:51 -w output wlan1:
 
[[Fichier:Im.png|927x927px|centré]]
 
* aircrack-ng -b 04:DA:D2:9C:50:51 output*.cap
 
[[Fichier:Img1.png|948x948px|centré]]

Version actuelle datée du 24 novembre 2023 à 11:15

Informations :

IP : 172.26.145.112

Nom du domaine: berlin2.lol

Machine de service: berlin

Machine mandataire: judo

13/09/2023 :

  • Création de la VM
xen-create-image --hostname=berlin --ip=172.26.145.112 --dir=/usr/local/xen --dhcp
  • Configuration de la VM
xen create berlin.cfg
  • Accéder à la VM
xen console berlin
  • vi /etc/network/interfaces : remplacer DHCP par static
  • Mise en place de l'adressage IP pour ssh :
address 172.26.145.112/24
gateway 172.26.145.254
  • Activation du PermitRootPassword dans /etc/ssh/sshd_config
PermitRootLogin yes

14/09/2023 :

  • Configuration de l'interface eth0:
nano /etc/network/interfaces
  • Nous avons configuré le fichier /etc/network/interfaces
auto eth0
iface eth0 inet static
address 172.26.145.109/24
gateway 172.26.145.254

Création d’un conteneur à la main

  • Sous machine Zabeth:
dd if=/dev/zero of=toto bs=1024k count=10240
mkfs /home/pifou/toto
mkdir tmp/mnt
mount -oloop /home/pifou/toto /tmp/mnt
apt install debootstrap
debootstrap stable /tmp/mnt
echo "proc /proc proc defaults 0 0" >> /tmp/mnt/etc/fstab
unshare -p -f -m chroot /tmp/mnt  /bin/sh -c "mount /proc ; /bin/bash"

Docker

docker run -i -t debian /bin/bash

02/10/2023

  • Configuration du ssh : /etc/ssh/sshd_config
    PermitRootLogin yes
    
  • Installer apache2 et bind9
  • créez deux partitions LVM (var et home) de 10G pour notre VM:
lvcreate -L10G -nberlin-var virtual

lvcreate -L10G -nberlin-home virtual

05/10/2023

  • Nous avons implanté les répertoires /var et /home de la machine virtuelle sur les partitions LVM
mkdir /new-home
mkdir /new-var
mkfs /dev/xvdb1
mkfs /dev/xvdb2
mount /dev/xvdb1 /new-home
mount /dev/xvdb2 /new-var
mv /var/* /new-var
  • lsblk
xvda1 202:1    0  512M  0 disk [SWAP]
xvda2 202:2    0   10G  0 disk /
xvdb1 202:17   0   10G  0 disk /root/new-home
xvdb2 202:18   0   10G  0 disk /root/new-var
  • nano /etc/fstab
/dev/xvdb1 /home ext2 defaults 0 2
/dev/xvdb2 /var  ext4 defaults 0 2
umount /root/new-var
umount /root/new-home
mount -a
  • lsblk
xvda1 202:1    0  512M  0 disk [SWAP]
xvda2 202:2    0   10G  0 disk /
xvdb1 202:17   0   10G  0 disk /home
xvdb2 202:18   0   10G  0 disk /var

Création de la machine mandataire judo(avec Baptiste):

  • Création de la machine mandataire virtuelle
xen-create-image --hostname=judo --ip=193.48.57.165 --netmask=255.255.255.240 --bridge=SE2a5 --dir=/usr/local/xen --password=glopglop --gateway=193.48.57.161
  • Création de la VM mandataire :
xen create /etc/xen/judo.cfg
xen console judo

xen create /etc/xen/.cfg xen console judo

Adresse IPV6 de notre machine JUDO : 2001:660:4401:60a0:216:3eff:fe0b:d504

  • Dand le fichier : /etc/resolv.conf
search plil.info
nameserver 8.8.8.8
nameserver 193.48.57.48
  • Création du bridge:
#judo_bridge
auto judo
iface judo inet manual
  bridge_ports none
  post-up ip link set $IFACE up
  post-down ip link set $IFACE down
  • ajout des interfaces sur la machine de service paris :
auto eth1
iface eth1 inet static
        address 192.168.165.2/24
        gateway 192.168.165.1
        post-up ethtool -K eth1 tx off
  • ajout des interfaces sur la machine de service berlin :
auto eth1
iface eth1 inet static
        address 192.168.165.3/24
        gateway 192.168.165.1
        post-up ethtool -K eth1 tx off
  • ajout de l'interface sur la machine mandataire :
auto eth1
iface eth1 inet static
        address 192.168.165.1/24

Nous avons maintenant un réseau privé entre nos deux machines de services et notre machine mandataire.

  • Mise en place de la mascarade:
    iptables -t nat -A POSTROUTING -j MASQUERADE -s 192.168.165.0/24
    apt install iptables-persistent
    iptable -save
    
  • Dans le fichier /etc/sysctl.conf :( nous avons modifié la ligne permettant le forward ipv4 permettant a nos machines d'envoyer des paquets sur internet.
  • pour activer le transfert de paquets IP
    net.ipv4.ip_forward=1
    

Pour se connecter sur nos machines on utilise maintenant cette commande ssh -J root@193.48.57.165 root@192.168.165.3

  • Création du serveur DNS sur gandi:
ns1.berlin2.lol

193.48.57.165
2001:660:4401:60a0:216:3eff:fe0b:d504

10/11/2023:

  • Modification: nano /etc/bind/db.berlin2.lol
$TTL 1H
berlin2.lol.    IN      SOA     ns1.berlin2.lol. berlin222@mail.com. (
                                        2011041902 ; Serial
                                        1H ; Refresh
                                        15M ; Retry
                                        2W ; Expire
                                        3M ; Minimum TTL
                                        )
berlin.lol.      IN NS   ns1.berlin2.lol.
berlin.lol.      IN A    193.48.57.165
ns1.berlin2.lol. IN A    193.48.57.165 
ns1.berlin2.lol. IN AAAA  2001:660:4401:60a0:216:3eff:fe9b:446d
www.berlin2.lol. IN CNAME ns1.berlin2.lol.
  • Ajout de la zone dans le fichier named.conf.local :
zone "berlin2.lol" {
    type master;
    file "/etc/bind/db.berlin2.lol";
    allow-transfer { 192.168.165.1; };
};
  • Machine mandataire :

modification du fichier de config named.config.local, nous avons ajouté les deux zones de nos machines de service:

zone "paris13.lol" {
        type slave;
        file "/etc/bind/db.paris13.lol";
        masters {192.168.165.2;};
};

zone "berlin2.lol" {
        type slave;
        file "/etc/bind/db.berlin2.lol";
        masters {192.168.165.3;};
};

Accès https sur apache, Création d'un certificat :

https://www.vincentliefooghe.net/content/activer-un-acc%C3%A8s-https-sur-apache
  • Création d'un certificat :
    openssl req -nodes -newkey rsa:2048 -sha256 -keyout berlin2.key -out berlinserver.csr -utf8
    
  • Création du Virtual Host :
    # vhost https
    <VirtualHost *:443>
      DocumentRoot /var/www/html
      ServerName  berlin2.lol
    
      ServerSignature Off
      ErrorLog ${APACHE_LOG_DIR}/berlin2.log      
      LogLevel info      
      CustomLog ${APACHE_LOG_DIR}/berlin2.log combined      
    
      SSLEngine on
      SSLCertificateFile /etc/ssl/certs/berlinserver.crt
      SSLCertificateKeyFile /etc/ssl/private/berlin2.key
    </VirtualHost>
    

23/11/2023:

  • Sécurisation de la clé privée : chmod 440 berlin2.key
  • Ajout des deux dns records dans notre fichier: /etc/bind/db.berlin2.lol
  • Ajout du dns secondaire : ns6.gandi.net
  • Recherche des adresse IPv4 et IPV6: host ns6.gandi.net
  • Ajout des deux adresses IP dans le fichier: /config.name.local
  • Incrémentation du numéro série puis service bind9 restart
  • Sur le site gandi.net: nous avons ajouté le dns secondaire : ns6.gandi.net

Sécurisation dnssec:

  • Gestion automatique des clefs: dans le fichier: /etc/bind/named.conf.local
    dnssec-policy "berlin2-lol" {
        keys {
            ksk key-directory lifetime unlimited algorithm 13;
            zsk key-directory lifetime unlimited algorithm 13;
        };
        nsec3param;
    };
    
     key-directory "/etc/bind/keys";
     dnssec-policy "berlin2-lol";
     inline-signing yes;
    
    Note: dnssec-policy ne fonctionne pas sur bind9, nous avons dons mis à jour bind9 à la dernière version nommé "named",
  • Modification des sources dans /etc/apt/sources.list (chimaera) puis mis à jour avec apt update et apt install bind9
  • chown bind : bind
  • Service named restart

Validation du certificat sur gandi:

Apres avoir reçu le certificat dns sur gandi, je l'ai télechargé et je l'ai copié sur la machine mandataire puis sur la machine de service:

scp /etc/ssl/private/berlin2.key root@193.48.57.165:/etc/ssl/private/
scp /etc/ssl/certs/berlin2.lol.crt root@192.168.165.3:/etc/ssl/certs
  • Modification du virtualhost de la machine de service: /etc/apache2/sites-available/vhost-https.conf
# vhost https
<VirtualHost *:443>
  DocumentRoot /var/www/html
  ServerName  berlin2.lol

  ServerSignature Off
  ErrorLog ${APACHE_LOG_DIR}/berlin2.log      
  LogLevel info      
  CustomLog ${APACHE_LOG_DIR}/berlin2.log combined      

  SSLEngine on
  SSLCertificateFile /etc/ssl/certs/berlin2.lol.crt
  SSLCertificateKeyFile /etc/ssl/private/berlin2.key
</VirtualHost>
  • Modification du virtualhost de la machine mandataire: /etc/apache2/sites-available/vhost-https.conf
    <VirtualHost *:443>
      DocumentRoot /var/www/html
      ServerName berlin2.lol
      ServerAlias www.berlin2.lol
    
      ServerSignature Off
      ErrorLog ${APACHE_LOG_DIR}/error_berlin2.log
      LogLevel info
      CustomLog ${APACHE_LOG_DIR}/access_berlin2.log combined
    
      SSLEngine on
      SSLCertificateFile  /etc/ssl/certs/berlin2.lol.crt
      SSLCertificateKeyFile /etc/ssl/private/berlin2.key
      SSLProxyEngine on
      ProxyPass / http://192.168.165.3
      ProxyPassReverse / http://192.165.3
    </VirtualHost>
    
  • Activation du ssl : "a2enmode ssl"
  • Activation du virtualhost: "a2ensite vhost-https.conf"
  • Activation du proxy : "a2enmode proxy*", (pour activer proxy et proxy_http)
  • Service apache2 restart
  • analyse sur dnsvis.net
Imagedns.png

24/11/2023:

Cassage de clef WEP d’un point d’accès WiFi

  • Sur la machine zabeth: commande nmclic device wifi
BSSID              SSID            MODE   CHAN  RATE        SIGNAL  BARS  SECURITY 
04:DA:D2:9C:50:51  cracotte02     Infra    13    54 Mbit/s   95      ▂▄▆█  WEP
  • airodump-ng
Image airmon.png


  • airodump-ng -c 13 --bssid 04:DA:D2:9C:50:51 -w output wlan1:
Im.png
  • aircrack-ng -b 04:DA:D2:9C:50:51 output*.cap
Img1.png