Читать книгу Kali Linux Penetration Testing Bible - Gus Khawaja - Страница 24

Managing Passwords in Kali

Оглавление

You probably want your root user back like in the old days. To get this account back, you will need to set its password first. To change a user password, you have to use the passwd command:

Gus@kali:~$ sudo passwd root New password: Retype new password: passwd: password updated successfully

Now to use the powerful root account, you have to use the su command to switch user:

Gus@kali:~$ sudo su root root@kali:/home/Gus#

From now on, on the login screen, you can choose your root account instead of your nonroot user.

Finally, to list all the user's credentials in Kali Linux, you can reveal them in the file /etc/shadow . Use the grep command to get the user credentials for Gus:

root@kali:/# cat /etc/shadow | grep "Gus" Gus:$6$Hb.QBfIoaCBTiqK$EUJ4ZdWmbsFqHMsPbMEz2df6FtWVf4J/tMulxCoLQmfMlVWyqpMUHBGmHFulRknYHgSrFIF.hQTANgzJ6CQM8/:18527:0:99999:7:::

Let's simplify what you need to understand from the string. The delimiter that separates each section is the colon character (:).

Second, the $6$ means that the password is hashed using SHA‐512. Finally, the hashed password starts after $6$ and right before the : delimiter:

Hb.QBfIoaCBTiqK$EUJ4ZdWmbsFqHMsPbMEz2df6FtWVf4J/tMulxCoLQmfMlVWyqpMUHBGmHFulRknYHgSrFIF.hQTANgzJ6CQM8/

Kali Linux Penetration Testing Bible

Подняться наверх