Starting point: Privilege escalation - Invalid id_rsa format

Hello,

in the Privilege escalation target machine I’ve copied id_rsa key, create a new file, pasted the id_rsa copied from the host machine. Then I performed chmod 600 id_rsa. Finally I am trying to use ssh root@hostip -p hostport -i id_rsa and I get the following error:

Load key "id_rsa": invalid format

I’ve seen similar examples like Topics tagged starting-point, the solution provided was to use puttygen, however, the puttygen command also throws an error that it’s not the private key. Checking the file using file id_rsa shows as OpenSSH private key.

I’ve checked multiple times, checked the size, characters count from the host machine and my current id_rsa - everything is fine.

Not sure what to do. Thanks.

…I’ve copied id_rsa key, create a new file, pasted the id_rsa copied from the host machine.

Why?
The files has grp set to user2, so you can copy the id_rsa into authorize_key into you home/.ssh. Put the chmod 600 and stop, now you can escalation the privs

Hi, not sure I understood your comment, but I did everything again the same way I did yesterday - copied the host id_rsa to local machine and used ssh root@hostip -p hostport -i id_rsa and it worked. Maybe something was wrong with the machine, cannot tell exactly.

sometimes machine get off…reset option is useful. Its best to check “ping”

Maybe something was wrong with the machine, cannot tell exactly.

Sure :v:

For example a copy can corrupt a file.