Reading time: < 1 minute
Reading time: < 1 minute
Reading time: < 1 minute
L’Abyss Webserver guarda en un fitxer de configuració en format XML els usuaris i passwords. Doncs bé el format en que estan enmagatzemats els passwords en el fitxer XML és:
usercode = nom_usuari + ":" + plaintext_password encoded_password = md5(base64(usercode))
Doncs bé aquí ve el petit trick de com fer això amb python:
#!/usr/bin/env python import md5 import base64 import re
def genera_pass_abyss(usercode): b64usercode = base64.encodestring(usercode) b64usercode = re.sub('\n','',b64usercode) hash = md5.new(b64usercode) return hash.hexdigest()
user = 'usuari1' passw = 'password1' usercode = user + ":" + passw print usercode print genera_pass_abyss(usercode)
Reading time: < 1 minute
No heu tingut mai la necessitat de protegir una de les opcions de botat del grub amb un password, doncs aquí teniu un exemple de com fer-ho:
grub> md5crypt Password: ********* Encrypted: $1$sEOFN1$dalP1fzlFCHD4saxlnNzM/ grub>
Com queda el menu.lst:
# Start GRUB global section #timeout 30 color light-gray/blue black/light-gray # End GRUB global section
# Other bootable partition config begins title Forbidden (on /dev/hda1) rootnoverify (hd0,0) makeactive chainloader +1 # Other bootable partition config ends
# Linux bootable partition config begins title Ubuntu Breezy (on /dev/hda2) root (hd0,1) kernel /boot/vmlinuz-2.6.12-9-386 root=/dev/hda2 ro vga=790 initrd /boot/initrd.img-2.6.12-9-386 password --md5 $1$sEOFN1$dalP1fzlFCHD4saxlnNzM/ # Linux bootable partition config ends
Reading time: < 1 minute
Sense ajudes, descripcions ni notes… només per refrescar el tema amb 1s:
Reading time: < 1 minute
Algunes vegades hi ha aplicatius que ens demanen en els fitxers de configuració que entrem les dades en certs formats que no ens són massa familiars. Sobre tot passwords. Avui m’ha passat això configurant el fitxer d’usuaris del dokuWiki. Finalment ho he resolt gràcies a aquesta web: Convertidor de formats de text. Ens converteix un text en aquests formats: MD5, CRYPT, CRC32, sha1, str_rot13, urlencode, urldecode, rawurlencode, rawurldecode, htmlentities, html_entity_decode, base64_decode, base64_encode, chr, ord quoted_printable_decode.