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

Supprimer les caractères non imprimables

Suppression caractères bizarres avec sed

Voir aussi perl_one-liners

  • dos2unix

Cette commande sed ne fonctionne pas. Pourquoi ?

sed -e 's/[^[:print:]]//g'
cat monfichier.txt | perl -pe 's/[^[:ascii:]]//g' > monfichier.txt.cleaned

Sed n'a pas fonctionné sur le pb pb_ansible_-//failure_when_attempting_to_use_callback_plugin//-_ascii_codec_can_t_decode_byte_in_position_ordinal_not_in_range alors que Perl si.

C'est parque qu'il faut faire :

cat monfichier.txt | env LANG=C sed 's/[^\x00-\x7F]//g'
# LANG=C sed -i -E "s|[\d128-\d255]||g" /path/to/file(s)

Supprimer tous les caractères non-imprimables (sauf les \n) avec Perl

perl -lpe 's/[[:^print:]]+//g' fichier.txt

Permet de voir les caractères non imprimable.
Utilise les notations « ^ » et « M- » pour les caractères non imprimables à l'exception des sauts de ligne et des tabulations

cat -v fichier.txt

Certain caractère peuvent être corrigé à la mano grâce à

#vim -b
set list

Enlever la couleur d'un texte en mode console

Source : http://www.commandlinefu.com/commands/view/3584/remove-color-codes-special-characters-with-sed

sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"

Autres

tr -d '\0' < bad_file.csv > bad_file.csv.fixed
2025/03/24 15:06

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

Voir aussi :

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

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