from zxcvbn import zxcvbn
--------------------------------------------------------------------------- ModuleNotFoundError Traceback (most recent call last) Cell In[1], line 1 ----> 1 from zxcvbn import zxcvbn ModuleNotFoundError: No module named 'zxcvbn'
!pip install --user zxcvbn
Requirement already satisfied: zxcvbn in ./.local/lib/python3.11/site-packages (4.4.28)
from zxcvbn import zxcvbn
zxcvbn('rkbBPD2023', user_inputs=['rkb', 'bpd'])
{'password': 'rkbBPD2023', 'guesses': Decimal('209500000'), 'guesses_log10': 8.321184027302312, 'sequence': [{'pattern': 'dictionary', 'i': 0, 'j': 2, 'token': 'rkb', 'matched_word': 'rkb', 'rank': 1, 'dictionary_name': 'user_inputs', 'reversed': False, 'l33t': False, 'base_guesses': 1, 'uppercase_variations': 1, 'l33t_variations': 1, 'guesses': 50, 'guesses_log10': 1.6989700043360185}, {'pattern': 'dictionary', 'i': 3, 'j': 5, 'token': 'BPD', 'matched_word': 'bpd', 'rank': 2, 'dictionary_name': 'user_inputs', 'reversed': False, 'l33t': False, 'base_guesses': 2, 'uppercase_variations': 2, 'l33t_variations': 1, 'guesses': 50, 'guesses_log10': 1.6989700043360185}, {'pattern': 'date', 'token': '2023', 'i': 6, 'j': 9, 'separator': '', 'year': 2003, 'month': 2, 'day': 20, 'guesses': 7300, 'guesses_log10': 3.8633228601204554}], 'calc_time': datetime.timedelta(microseconds=1113), 'crack_times_seconds': {'online_throttling_100_per_hour': Decimal('7542000000.000000418665102586'), 'online_no_throttling_10_per_second': Decimal('20950000'), 'offline_slow_hashing_1e4_per_second': Decimal('20950'), 'offline_fast_hashing_1e10_per_second': Decimal('0.02095')}, 'crack_times_display': {'online_throttling_100_per_hour': 'centuries', 'online_no_throttling_10_per_second': '8 months', 'offline_slow_hashing_1e4_per_second': '6 hours', 'offline_fast_hashing_1e10_per_second': 'less than a second'}, 'score': 3, 'feedback': {'warning': '', 'suggestions': []}}
!ls /etc/pam.d/
chfn common-session-noninteractive other su chpasswd cron passwd sudo chsh lightdm ppp sudo-i common-account lightdm-autologin runuser su-l common-auth lightdm-greeter runuser-l common-password login samba common-session newusers sshd
!cat /etc/pam.d/common-password
# # /etc/pam.d/common-password - password-related modules common to all services # # This file is included from other service-specific PAM config files, # and should contain a list of modules that define the services to be # used to change user passwords. The default is pam_unix. # Explanation of pam_unix options: # The "yescrypt" option enables #hashed passwords using the yescrypt algorithm, introduced in Debian #11. Without this option, the default is Unix crypt. Prior releases #used the option "sha512"; if a shadow password hash will be shared #between Debian 11 and older releases replace "yescrypt" with "sha512" #for compatibility . The "obscure" option replaces the old #`OBSCURE_CHECKS_ENAB' option in login.defs. See the pam_unix manpage #for other options. # As of pam 1.0.1-6, this file is managed by pam-auth-update by default. # To take advantage of this, it is recommended that you configure any # local modules either before or after the default block, and use # pam-auth-update to manage selection of other modules. See # pam-auth-update(8) for details. # here are the per-package modules (the "Primary" block) password [success=1 default=ignore] pam_unix.so obscure yescrypt # here's the fallback if no module succeeds password requisite pam_deny.so # prime the stack with a positive return value if there isn't one already; # this avoids us returning an error just because nothing sets a success code # since the modules above will each just jump around password required pam_permit.so # and here are more per-package modules (the "Additional" block) password optional pam_gnome_keyring.so # end of pam-auth-update config
!grep pam.unix /etc/pam.d/common-password
# used to change user passwords. The default is pam_unix. # Explanation of pam_unix options: #`OBSCURE_CHECKS_ENAB' option in login.defs. See the pam_unix manpage password [success=1 default=ignore] pam_unix.so obscure yescrypt
!grep -i pass /etc/login.defs
# Password aging controls: # PASS_MAX_DAYS Maximum number of days a password may be used. # PASS_MIN_DAYS Minimum number of days allowed between password changes. # PASS_WARN_AGE Number of days warning given before a password expires. PASS_MAX_DAYS 99999 PASS_MIN_DAYS 0 PASS_WARN_AGE 7 # Max number of login retries if password is bad. This will most likely be # the user to be removed (passed as the first argument). # If set to "yes", new passwords will be encrypted using the MD5-based # It supports passwords of unlimited length and longer salt strings. # Set to "no" if you need to copy encrypted passwords to other systems # If set to MD5, MD5-based algorithm will be used for encrypting password # If set to SHA256, SHA256-based algorithm will be used for encrypting password # If set to SHA512, SHA512-based algorithm will be used for encrypting password # If set to BCRYPT, BCRYPT-based algorithm will be used for encrypting password # If set to YESCRYPT, YESCRYPT-based algorithm will be used for encrypting password # If set to DES, DES-based algorithm will be used for encrypting password (default) # With a lot of rounds, it is more difficult to brute-force the password. # With a higher cost factor, it is more difficult to brute-force the password. # their home directory in /etc/passwd to avoid a spurious warning. # Prevents an empty password field to be interpreted as "no authentication #PASS_CHANGE_TRIES #PASS_ALWAYS_WARN #PASS_MIN_LEN #PASS_MAX_LEN # NO_PASSWORD_CONSOLE
!grep pam.unix.so /etc/pam.d/common-password
password [success=1 default=ignore] pam_unix.so obscure yescrypt
!sudo sed -i "/pam.unix.so/s/$/ minlen=12/" /etc/pam.d/common-password
!grep pam.unix.so /etc/pam.d/common-password
password [success=1 default=ignore] pam_unix.so obscure yescrypt minlen=12
Teraz je minimalna dlzka hesla 12 pre bezneho pouzivatela.
!sudo sed -i "/pam.unix.so/s/$/ retry=3 remember=5/" /etc/pam.d/common-password
!grep pam.unix.so /etc/pam.d/common-password
password [success=1 default=ignore] pam_unix.so obscure yescrypt minlen=12
!sudo apt install -y libpam-pwquality
Reading package lists... Done Building dependency tree... Done Reading state information... Done The following additional packages will be installed: cracklib-runtime libcrack2 libpwquality-common libpwquality1 wamerican The following NEW packages will be installed: cracklib-runtime libcrack2 libpam-pwquality libpwquality-common libpwquality1 wamerican 0 upgraded, 6 newly installed, 0 to remove and 233 not upgraded. Need to get 485 kB of archives. After this operation, 2,429 kB of additional disk space will be used. Get:1 http://quantum-mirror.hu/mirrors/pub/kali kali-rolling/main amd64 wamerican all 2020.12.07-2 [221 kB] Get:2 http://http.kali.org/kali kali-rolling/main amd64 libcrack2 amd64 2.9.6-5+b1 [44.0 kB] Get:3 http://http.kali.org/kali kali-rolling/main amd64 cracklib-runtime amd64 2.9.6-5+b1 [143 kB] Get:4 http://quantum-mirror.hu/mirrors/pub/kali kali-rolling/main amd64 libpwquality-common all 1.4.5-1 [51.3 kB] Get:5 http://http.kali.org/kali kali-rolling/main amd64 libpwquality1 amd64 1.4.5-1+b1 [12.8 kB] Get:6 http://http.kali.org/kali kali-rolling/main amd64 libpam-pwquality amd64 1.4.5-1+b1 [12.9 kB] Fetched 485 kB in 1s (376 kB/s) Preconfiguring packages ... 78Selecting previously unselected package wamerican. (Reading database ... 399891 files and directories currently installed.) Preparing to unpack .../0-wamerican_2020.12.07-2_all.deb ... 7Progress: [ 0%] [..........................................................] 87Progress: [ 4%] [##........................................................] 8Unpacking wamerican (2020.12.07-2) ... 7Progress: [ 8%] [####......................................................] 8Selecting previously unselected package libcrack2:amd64. Preparing to unpack .../1-libcrack2_2.9.6-5+b1_amd64.deb ... 7Progress: [ 12%] [######....................................................] 8Unpacking libcrack2:amd64 (2.9.6-5+b1) ... 7Progress: [ 16%] [#########.................................................] 8Selecting previously unselected package cracklib-runtime. Preparing to unpack .../2-cracklib-runtime_2.9.6-5+b1_amd64.deb ... 7Progress: [ 20%] [###########...............................................] 8Unpacking cracklib-runtime (2.9.6-5+b1) ... 7Progress: [ 24%] [#############.............................................] 8Selecting previously unselected package libpwquality-common. Preparing to unpack .../3-libpwquality-common_1.4.5-1_all.deb ... 7Progress: [ 28%] [################..........................................] 8Unpacking libpwquality-common (1.4.5-1) ... 7Progress: [ 32%] [##################........................................] 8Selecting previously unselected package libpwquality1:amd64. Preparing to unpack .../4-libpwquality1_1.4.5-1+b1_amd64.deb ... 7Progress: [ 36%] [####################......................................] 8Unpacking libpwquality1:amd64 (1.4.5-1+b1) ... 7Progress: [ 40%] [#######################...................................] 8Selecting previously unselected package libpam-pwquality:amd64. Preparing to unpack .../5-libpam-pwquality_1.4.5-1+b1_amd64.deb ... 7Progress: [ 44%] [#########################.................................] 8Unpacking libpam-pwquality:amd64 (1.4.5-1+b1) ... 7Progress: [ 48%] [###########################...............................] 8Setting up libpwquality-common (1.4.5-1) ... 7Progress: [ 52%] [##############################............................] 87Progress: [ 56%] [################################..........................] 8Setting up wamerican (2020.12.07-2) ... 7Progress: [ 60%] [##################################........................] 87Progress: [ 64%] [#####################################.....................] 8Setting up libcrack2:amd64 (2.9.6-5+b1) ... 7Progress: [ 68%] [#######################################...................] 87Progress: [ 72%] [#########################################.................] 8Setting up cracklib-runtime (2.9.6-5+b1) ... 7Progress: [ 76%] [############################################..............] 8skipping line: 1 7Progress: [ 80%] [##############################################............] 8Setting up libpwquality1:amd64 (1.4.5-1+b1) ... 7Progress: [ 84%] [################################################..........] 87Progress: [ 88%] [###################################################.......] 8Setting up libpam-pwquality:amd64 (1.4.5-1+b1) ... 7Progress: [ 92%] [#####################################################.....] 87Progress: [ 96%] [#######################################################...] 8Processing triggers for kali-menu (2023.4.5) ... Processing triggers for doc-base (0.11.1) ... Processing 38 changed doc-base files, 2 added doc-base files... Processing triggers for libc-bin (2.37-12) ... Processing triggers for man-db (2.11.2-3) ... Processing triggers for dictionaries-common (1.29.7) ... 78
!grep qual /etc/pam.d/common-password
password requisite pam_pwquality.so retry=3 dcredit=-1
!cat /etc/pam.d/common-password
# # /etc/pam.d/common-password - password-related modules common to all services # # This file is included from other service-specific PAM config files, # and should contain a list of modules that define the services to be # used to change user passwords. The default is pam_unix. # Explanation of pam_unix options: # The "yescrypt" option enables #hashed passwords using the yescrypt algorithm, introduced in Debian #11. Without this option, the default is Unix crypt. Prior releases #used the option "sha512"; if a shadow password hash will be shared #between Debian 11 and older releases replace "yescrypt" with "sha512" #for compatibility . The "obscure" option replaces the old #`OBSCURE_CHECKS_ENAB' option in login.defs. See the pam_unix manpage #for other options. # As of pam 1.0.1-6, this file is managed by pam-auth-update by default. # To take advantage of this, it is recommended that you configure any # local modules either before or after the default block, and use # pam-auth-update to manage selection of other modules. See # pam-auth-update(8) for details. # here are the per-package modules (the "Primary" block) password requisite pam_pwquality.so retry=3 dcredit=-1 password [success=1 default=ignore] pam_unix.so obscure use_authtok try_first_pass yescrypt minlen=12 # here's the fallback if no module succeeds password requisite pam_deny.so # prime the stack with a positive return value if there isn't one already; # this avoids us returning an error just because nothing sets a success code # since the modules above will each just jump around password required pam_permit.so # and here are more per-package modules (the "Additional" block) password optional pam_gnome_keyring.so # end of pam-auth-update config
!echo "heslo"|cracklib-check
heslo: it is too short
!echo "password"|cracklib-check
password: it is based on a dictionary word
!echo "heslo"|pwscore
zsh:1: command not found: pwscore
!sudo apt install libpwquality-tools
Reading package lists... Done Building dependency tree... Done Reading state information... Done The following NEW packages will be installed: libpwquality-tools 0 upgraded, 1 newly installed, 0 to remove and 233 not upgraded. Need to get 11.1 kB of archives. After this operation, 50.2 kB of additional disk space will be used. Get:1 http://http.kali.org/kali kali-rolling/main amd64 libpwquality-tools amd64 1.4.5-1+b1 [11.1 kB] Fetched 11.1 kB in 1s (8,595 B/s) 78Selecting previously unselected package libpwquality-tools. (Reading database ... 100%400050 files and directories currently installed.) Preparing to unpack .../libpwquality-tools_1.4.5-1+b1_amd64.deb ... 7Progress: [ 0%] [..........................................................] 87Progress: [ 20%] [###########...............................................] 8Unpacking libpwquality-tools (1.4.5-1+b1) ... 7Progress: [ 40%] [#######################...................................] 8Setting up libpwquality-tools (1.4.5-1+b1) ... 7Progress: [ 60%] [##################################........................] 87Progress: [ 80%] [##############################################............] 8Processing triggers for kali-menu (2023.4.5) ... Processing triggers for man-db (2.11.2-3) ... 78
!echo "heslo" | pwscore
Password quality check failed: The password is shorter than 8 characters
!echo "password" | pwscore
Password quality check failed: The password fails the dictionary check - it is based on a dictionary word
!echo "bpd.2023" | pwscore
25
!echo "1Aa.7brc9$" | pwscore
65
!sudo apt install pwgen
Reading package lists... Done Building dependency tree... Done Reading state information... Done The following NEW packages will be installed: pwgen 0 upgraded, 1 newly installed, 0 to remove and 233 not upgraded. Need to get 19.6 kB of archives. After this operation, 52.2 kB of additional disk space will be used. Get:1 http://quantum-mirror.hu/mirrors/pub/kali kali-rolling/main amd64 pwgen amd64 2.08-2 [19.6 kB] Fetched 19.6 kB in 1s (26.3 kB/s) 78Selecting previously unselected package pwgen. (Reading database ... 400059 files and directories currently installed.) Preparing to unpack .../pwgen_2.08-2_amd64.deb ... 7Progress: [ 0%] [..........................................................] 87Progress: [ 20%] [###########...............................................] 8Unpacking pwgen (2.08-2) ... 7Progress: [ 40%] [#######################...................................] 8Setting up pwgen (2.08-2) ... 7Progress: [ 60%] [##################################........................] 87Progress: [ 80%] [##############################################............] 8Processing triggers for man-db (2.11.2-3) ... Processing triggers for kali-menu (2023.4.5) ... 78
#generate 5 secure passwords with length 8
!pwgen -s 8 5
dnxIuKP3 6xxvwJmY 4t3S8P6k KvLigUb5 7Hpp51su
!sudo apt install apg
Reading package lists... Done Building dependency tree... Done Reading state information... Done The following NEW packages will be installed: apg 0 upgraded, 1 newly installed, 0 to remove and 233 not upgraded. Need to get 52.7 kB of archives. After this operation, 145 kB of additional disk space will be used. Get:1 http://http.kali.org/kali kali-rolling/main amd64 apg amd64 2.2.3.dfsg.1-5+b2 [52.7 kB] Fetched 52.7 kB in 1s (47.3 kB/s) 78Selecting previously unselected package apg. (Reading database ... 400064 files and directories currently installed.) Preparing to unpack .../apg_2.2.3.dfsg.1-5+b2_amd64.deb ... 7Progress: [ 0%] [..........................................................] 87Progress: [ 20%] [###########...............................................] 8Unpacking apg (2.2.3.dfsg.1-5+b2) ... 7Progress: [ 40%] [#######################...................................] 8Setting up apg (2.2.3.dfsg.1-5+b2) ... 7Progress: [ 60%] [##################################........................] 87Progress: [ 80%] [##############################################............] 8Processing triggers for kali-menu (2023.4.5) ... Processing triggers for man-db (2.11.2-3) ... 78
!apg
yidFu0blac( (yid-Fu-ZERO-blac-LEFT_PARENTHESIS) 0BinAirgelb[ (ZERO-Bin-Airg-elb-LEFT_BRACKET) #Iveadwav0 (CROSSHATCH-Iv-ead-wav-ZERO) tyWif(Ott8 (ty-Wif-LEFT_PARENTHESIS-Ott-EIGHT) Grernarc7swot) (Grern-arc-SEVEN-swot-RIGHT_PARENTHESIS) Sed0olvOkloc& (Sed-ZERO-olv-Okl-oc-AMPERSAND)
!apg -a 1
nf,Y3\IF@+ svw;ef]JqP ^n8=)>91h. <HjU(OuW ^gZ>C$*^"9 F'.+t<j}J
!sudo apt install -y makepasswd
Reading package lists... Done Building dependency tree... Done Reading state information... Done The following additional packages will be installed: libcrypt-passwdmd5-perl The following NEW packages will be installed: libcrypt-passwdmd5-perl makepasswd 0 upgraded, 2 newly installed, 0 to remove and 233 not upgraded. Need to get 18.1 kB of archives. After this operation, 61.4 kB of additional disk space will be used. Get:1 http://quantum-mirror.hu/mirrors/pub/kali kali-rolling/main amd64 libcrypt-passwdmd5-perl all 1.42-2 [8,448 B] Get:2 http://quantum-mirror.hu/mirrors/pub/kali kali-rolling/main amd64 makepasswd all 1.10-14 [9,692 B] Fetched 18.1 kB in 1s (24.3 kB/s) 78Selecting previously unselected package libcrypt-passwdmd5-perl. (Reading database ... 400082 files and directories currently installed.) Preparing to unpack .../libcrypt-passwdmd5-perl_1.42-2_all.deb ... 7Progress: [ 0%] [..........................................................] 87Progress: [ 11%] [######....................................................] 8Unpacking libcrypt-passwdmd5-perl (1.42-2) ... 7Progress: [ 22%] [############..............................................] 8Selecting previously unselected package makepasswd. Preparing to unpack .../makepasswd_1.10-14_all.deb ... 7Progress: [ 33%] [###################.......................................] 8Unpacking makepasswd (1.10-14) ... 7Progress: [ 44%] [#########################.................................] 8Setting up libcrypt-passwdmd5-perl (1.42-2) ... 7Progress: [ 56%] [################################..........................] 87Progress: [ 67%] [######################################....................] 8Setting up makepasswd (1.10-14) ... 7Progress: [ 78%] [#############################################.............] 87Progress: [ 89%] [###################################################.......] 8Processing triggers for kali-menu (2023.4.5) ... Processing triggers for man-db (2.11.2-3) ... 78
!makepasswd -count 5 -minchars 8
R1QHqULiRq UKeY1Wsx5 nNRa4bbv E3t30rRjjt L9RVCQF5
!makepasswd -string 1234567890 -chars 4
6366
!date +%s | sha256sum | base64 | head -c 32
ZGJkODk0NmI4OTAwMzUyODhlODNmZTZl
!openssl rand -base64 14
suELh1X6pM4d4/SsEVE=
!gpg --gen-random --armor 1 16
gpg: keybox '/home/kali/.gnupg/pubring.kbx' created AlsKjHUeLsjiqhRiilAuuA==