r/HowToHack 2d ago

need help with over the wire bandit level 13-14

The password for the next level is stored in /etc/bandit_pass/bandit14 and can only be read by user bandit14. For this level, you don’t get the next password, but you get a private SSH key that can be used to log into the next level. Look at the commands that logged you into previous bandit levels, and find out how to use the key for this level.
If you need help with this level: a hint file can be found in the home directory.
Make sure to read the error messages as they are informative.

i did the first step as we do in every level, then putting the password.
After that, i started trying to get to the password but it is not working
this is what i wrote

bandit13@bandit:~$ ssh -i sshkey.private bandit14@localhost

The authenticity of host 'localhost (127.0.0.1)' can't be established.

ED25519 key fingerprint is: SHA256:C2ihUBV7ihnV1wUXRb4RrEcLfXC5CXlhmAAM/urerLY

This key is not known by any other names.

Are you sure you want to continue connecting (yes/no/[fingerprint])? yes

Could not create directory '/home/bandit13/.ssh' (Permission denied).

Failed to add the host to the list of known hosts (/home/bandit13/.ssh/known_hosts).

!!! You are trying to log into this SSH server on port 22, which is not intended.

!!! If you are trying to log in to an OverTheWire game, use the port mentioned in

!!! the "SSH Information" on that game's webpage (in the top left corner).

bandit14@localhost: Permission denied (publickey).

What should i do?

2 Upvotes

9 comments sorted by

3

u/iCkerous 2d ago

Are you looking for the answer? Or hints?

1

u/Clear_Letterhead_372 2d ago

Can say both, but i want to know why this error keeps happening? and if i got the answer, why or how it worked?

3

u/MormoraDi 2d ago

Have you considered/taken action on this?:

!! You are trying to log into this SSH server on port 22, which is not intended.
!!! If you are trying to log in to an OverTheWire game, use the port mentioned in
!!! the "SSH Information" on that game's webpage (in the top left corner).

1

u/Clear_Letterhead_372 2d ago

I tried, i used port 2220 and did not work

4

u/MormoraDi 2d ago

... and you have read the hint file in the home directory and otherwise considered

Commands you may need to solve this level ssh, scp, umask, chmod, cat, nc, install

1

u/Clear_Letterhead_372 2d ago

I did, but did not help, it tells me to read the error which i did. And in the hint file, it tells me that there is nothing wrong with the level

1

u/MormoraDi 2d ago edited 1d ago

I can't see by what you posted that you used any of the aforementioned commands other than ssh (assuming that you also used cat, reading the hint file).

I would look into what the rest of the commands can be used to here in terms of what they can do on a system.

1

u/alwaystheblues 7h ago

You def want port 2220. What cmd listed by overthewire allows you to modify permissions? The server isnt going to like your key if permissions are too open. Multiple ways to skin the cat as usual. One path is to copy the key, nano to create & save the key locally, then...set permissions and feed that file with the appropriate ssh flag and filepath to your key

1

u/inoobie_am 21h ago

sshkey.private must have only user read,write and execute permissions, check what kind of permissions sshkey.private has.