Portál AbcLinuxu, 5. května 2025 13:11
#!/bin/bash
python -c "import crypt, getpass, pwd;clear=getpass.getpass(); print crypt.crypt(clear, '\$6\$SALTsalt\$');"
Spravne vytvori sha-512 hash hesla.
#!/usr/bin/python
import crypt, getpass, pwd;
print "Zadejte heslo administratora:"
clear = getpass.getpass()
print crypt.crypt(clear, '\$6\$saltSLAT\$')
print clear
Sice vytvori hash ale jiny, pravdepodobne des.
Napada vas co musim nastavit aby se kod choval stejne?
Dekuji za kazdy napad
Řešení dotazu:
#!/usr/bin/python import crypt, getpass, pwd print "Zadejte heslo administratora:" clear = getpass.getpass() print crypt.crypt(clear, '$6$SALTsalt$') print clear
echo
:
$ echo "import crypt, getpass, pwd;clear=getpass.getpass(); print crypt.crypt(clear, '\$6\$SALTsalt\$');" import crypt, getpass, pwd;clear=getpass.getpass(); print crypt.crypt(clear, '$6$SALTsalt$');
Unlike Standard C, all unrecognized escape sequences are left in the string unchanged, i.e., the backslash is left in the string. (This behavior is useful when debugging: if an escape sequence is mistyped, the resulting output is more easily recognized as broken.)
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.