I noticed that there is a user named lachlan on this machine. I saw a backup.sh file in the bin directory of user lachlan, but it didn’t seem to contain anything particularly interesting. I then continued by reading this user’s .bash_history file and discovered the following line:
“echo -e “dHY5pzmNYoETv7SUaY\nthisistheway123\nthisistheway123” | passwd”
This line means changing the password of the current user in a non-interactive way.
I’ll explain it briefly:
Normally, when you run passwd, it expects interactive input like this:
Current password:
New password:
Retype new password:
passwd reads three consecutive lines from stdin.
The command echo -e provides those lines through stdin, which results in the following input being passed to passwd:
dHY5pzmNYoETv7SuaY
thisistheway123
thisistheway123
Therefore, the new password of user lachlan is: thisistheway123