Outils pour utilisateurs

Outils du site


blog

Test connexion IMAP

Vérification qu'aucun mot de passe de sera échangé en clair

$ telnet imap.acme.fr 143
1 CAPABILITY
2 LOGIN "user" "pass"
* BAD [ALERT] Plaintext authentication not allowed without SSL/TLS, but your client did it anyway. If anyone was listening, the password was exposed.
2 NO [PRIVACYREQUIRED] Plaintext authentication disallowed on non-secure (SSL/TLS) connections.

Connexion IMAP (starttls)

$ openssl s_client -starttls imap -connect imap.acme.fr:143 -crlf
1 LOGIN "user" "pass"
2 LIST "INBOX" "*"
3 LIST "*" "*"
4 SELECT inbox
5 LIST "INBOX" "*Archive*"
6 FETCH 1243:* FLAGS
7 LIST "" "INBOX.%"
34 SEARCH DELETED
* SEARCH
* 1162 FETCH (FLAGS (\Seen NonJunk))
34 OK Search completed (0.000 secs).
35 FETCH 1162 FULL
* 1162 FETCH (FLAGS (\Seen NonJunk) INTERNALDATE "21-May-2015 18:10:03 +0200" RFC822.SIZE 986 ENVELOPE ("Thu, 21 May 2015 18:10:03 +0200 (CEST)" "Postfix SMTP server: errors from unknown[142.54.162.199]" (("Mail Delivery System" NIL "MAILER-DAEMON" "smtp.acme.fr")) (("Mail Delivery System" NIL "MAILER-DAEMON" "smtp.acme.fr")) (("Mail Delivery System" NIL "MAILER-DAEMON" "smtp.acme.fr")) (("Postmaster" NIL "postmaster" "acme.fr")) NIL NIL NIL "<20150521161003.489C72AB1D@smtp.acme.fr>") BODY ("text" "plain" ("charset" "us-ascii") NIL NIL "7bit" 508 20))
35 OK Fetch completed.
37 SEARCH DELETED SINCE 22-may-2015
38 LOGOUT
tag login user@gmail.com password

tag LIST "" "*"
TAG DELETE Trash
tag create Trash
tag create Trash.T

SEARCH FROM "info@commerbank.com" BEFORE 1-Nov-2009 
2025/03/24 15:06

Terminal shell script faille de sécurité XSS injection code malveillant cat

Source https://makandracards.com/makandra/35943-terminal-escape-sequences-the-new-xss-for-linux-sysadmins

$ printf '#!/bin/bash\necho doing something evil!\nexit\n\033[2Aecho doing something very nice!\n' > backdoor.sh

$ chmod +x backdoor.sh

$ cat backdoor.sh
#!/bin/bash
echo doing something very nice!

$ ./backdoor.sh
doing something evil!
2025/03/24 15:06

Cobbler déploiement Ubuntu ou Debian

Voir :

Notes : Nous n'utiliserons pas debmirror

Contexte : Nous sommmes sur une CentOS7 (Serveur Cobbler) et nous allons déployer une Ubuntu Server 16.04

Mise-à-jour de la liste des signatures (--os-version)

cobbler signature update

Import de l'ISO montée sur /mnt

mount ubuntu-16.04-server-amd64.iso /mnt
cobbler import --name=ubuntu-server --path=/mnt --breed=ubuntu --os-version=xenial --arch=x86_64
umount /mnt

Copie du profile original

cobbler profile copy --name=ubuntu-server-x86_64 --newname=ubuntu-server-16.04.vm

Modif du nouveau profile

cobbler profile edit --name=ubuntu-server-16.04.vm --proxy=http://192.168.100.3:8080/ --virt-path=/var/lib/libvirt/images

Modif du nouveau profile (pour visrsh console et autre)

cobbler profile edit --name=ubuntu-server-16.04.vm --kopts-post="console=ttyS0,115200n8 ipv6.disable=1 vga=0x317" --kopts="console=ttyS0,115200n8 ipv6.disable=1"

vga=0x317 est déprécié, utiliser à la place : gfxpayload=1024x768x16,1024×768

Copie de la “distro” d'origine, car nous allons la modifier

cobbler distro copy --name ubuntu-server-x86_64 --newname=ubuntu-server-x86_64-orig

Modification du Kickstart Metadata de la distro ubuntu-server-x86_64
Nous changeons la ligne suivante :

tree=http://@@http_server@@/cblr/links/ubuntu-server-x86_64
en
tree=http://fr.archive.ubuntu.com/ubuntu/dists/xenial/main/installer-amd64

cobbler distro edit --name=ubuntu-server-x86_64 --ksmeta='tree=http://fr.archive.ubuntu.com/ubuntu/dists/xenial/main/installer-amd64'

Copie du fichier d'exemple preseed (sample.seed) Nous modifierons la copie de la manière suivante :

/var/lib/cobbler/kickstarts/ubuntu-server-16.04.seed

d-i mirror/http/hostname string fr.archive.ubuntu.com
d-i mirror/http/directory string /ubuntu
cp -p /var/lib/cobbler/kickstarts/sample.seed /var/lib/cobbler/kickstarts/ubuntu-server-16.04.seed
sed -i -e 's%^\(d-i mirror/http/hostname string\).*%\1 fr.archive.ubuntu.com%' /var/lib/cobbler/kickstarts/ubuntu-server-16.04.seed
sed -i -e 's%^\(d-i mirror/http/directory string\).*%\1 /ubuntu%' /var/lib/cobbler/kickstarts/ubuntu-server-16.04.seed

A faire aussi

cp -p /var/lib/cobbler/scripts/preseed_late_default /var/lib/cobbler/scripts/preseed_late_ubuntu-server-16.04
sed -i -e 's/preseed_late_default/preseed_late_ubuntu-server-16.04/' /var/lib/cobbler/kickstarts/ubuntu-server-16.04.seed

On modifie le script de postinstall

/var/lib/cobbler/kickstarts/ubuntu-server-16.04.seed

echo "$hostname" > /etc/hostname
/bin/hostname $hostname
 
$SNIPPET('download_config_files')
$SNIPPET('kickstart_done')

Lier le nouveau fichier kickstart/preseed au profile

cobbler profile edit --name=ubuntu-server-16.04.vm --kickstart=/var/lib/cobbler/kickstarts/ubuntu-server-16.04.seed

Puis

cobbler sync

L'adresse MAC un un chiffre hexadécimal écrit sous la forme '52:54:XX:XX:XX:XX' (où X est un chiffre en base 16 entre 0 et F)

cobbler system add      --name=${HostName}                                      \
                        --gateway=${Gateway}                                    \
                        --hostname=${HostName}                                  \
                        --ipv6-autoconfiguration=false                          \
                        --power-type=ack_manual                                 \
                        --profile=ubuntu-server-16.04.vm                        \
                        --repos-enabled=false                                   \
                        --status=production                                     \
                        --virt-auto-boot=0                                      \
                        --virt-type=kvm
 
cobbler system edit     --name=${HostName}                                      \
                        --interface=ens3                                        \
                        --ip-address=${IP_Addr}                                 \
                        --mac=$Mac                                              \
                        --netmask=${NetMask}                                    \
                        --static=1

Retour arrière

Effacement de la nouvelle distro

Exemple à adapter

cobbler system remove --name=ttest01
cobbler profile remove --name=ubuntu-server-16.04.vm
cobbler profile remove --name=ubuntu-server-x86_64
cobbler distro remove --name=ubuntu-server-x86_64
cobbler repo remove --name=ubuntu-server-x86_64
2025/03/24 15:06

Terminal screen

#!/bin/bash
 
qua3=('VBox' 'qua-gdp1.st')
qua=('Qua1' 'qua-web1.st')
qua2=('Qua2' 'qua-web2.st')
rec1=('Rec1' 'rec-web1.st')
rec2=('Rec2' 'rec-web2.st')
prod1=('Prod1' 'prod-web1.st')
prod2=('Prod2' 'prod-web2.st')
prod3=('Prod3' 'prod-web3.st')
prod4=('Prod4' 'prod-web4.st')
gdp1=('Gdp1' 'prod-gdp1.st')
gdp2=('Gdp2' 'prod-gdp2.st')
fast=('Fast' 'prod-fast1.st')
ftp1=('Ftp1' 'prod-ftp1.st')
 
Args=""
 
for platforme in prod1 prod2 prod3 prod4 gdp1 rec1 rec2 fast ftp1 qua qua2 qua3
do
	Args="$Args --tab -t \"$(eval echo \${$platforme[0]})\" -e \"ssh -t $(eval echo \${$platforme[1]}) screen -x\""
done
 
echo $Args |xargs gnome-terminal
2025/03/24 15:06

Température matériel CPU carte mère Debian lm-sensors

Voir nouvelle_install_debian_configuration_optimisation

Voir aussi : https://github.com/cyring/CoreFreq

apt-get install lm-sensors
sensors-detect --auto
sensors
# acpi -t
Thermal 0: ok, 29.8 degrees C
Thermal 1: ok, 27.8 degrees C

Température du disque

# smartctl -A /dev/sda | egrep -i "ATTRIBUTE_NAME|temperature"
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
194 Temperature_Celsius     0x0022   105   099   000    Old_age   Always       -       42

Ici le disque est à 42°C. Sur une échelle de 0 (Très chaud) à 255 (très froid) il est à 105. Il a déjà connu pire, une fois à 99.

Pour afficher les températures et leurs historiques

smartctl -x /dev/sda
2025/03/24 15:06
blog.txt · Dernière modification : de 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki