Othmane Moutaouakkil
LinkedInGitHub
  • Introduction
  • OSCP Journey
    • HTB
      • HTB Linux Boxes
      • HTB Windows Boxes
  • Write-Ups
    • TCM Security
      • Practical Ethical Hacking
        • Networking Refresher
        • The Ethical Hacker Methodology
        • Information Gathering (Reconnaissance)
        • Scanning & Enumeration
        • Vulnerability Scanning with Nessus
        • Exploitation Basics
        • New Capstone
        • Active Directory (AD)
          • AD Overview
          • AD Lab Build
          • Attacking AD: Initial Attack Vectors
          • Attacking AD: Post-Compromise Enumeration
          • Attacking AD: Post-Compromise Attacks
          • We've Compromised the Domain - Now What?
          • Additional AD Attacks
          • AD Case Studies
        • Post Exploitation
        • Web Application Enumeration, Revisited
        • Find & Exploit Common Web Vulnerabilities
        • Wireless Penetration Testing
        • Legal Documents and Report Writing
      • Open-Source Intelligence (OSINT)
    • Hacking Challenges
      • OTW
        • Bandit
          • Level 0
          • Level 0 → 1
          • Level 1 → 2
          • Level 2 → 3
          • Level 3 → 4
          • Level 4 → 5
          • Level 5 → 6
          • Level 6 → 7
          • Level 7 → 8
          • Level 8 → 9
          • Level 9 → 10
          • Level 10 → 11
          • Level 11 → 12
          • Level 12 → 13
          • Level 13 → 14
          • Level 14 → 15
          • Level 15 → 16
          • Level 16 → 17
          • Level 17 → 18
          • Level 18 → 19
        • Natas
        • Leviathan
        • Krypton
        • Narnia
        • Behemoth
        • Utumno
        • Maze
        • Vortex
        • Manpage
        • Drifter
        • FormulaOne
      • THM
  • Research
  • Resume
Powered by GitBook
On this page
  • Level Goal
  • Write-Up
  • Lessons Learned

Was this helpful?

  1. Write-Ups
  2. Hacking Challenges
  3. OTW
  4. Bandit

Level 13 → 14

PreviousLevel 12 → 13NextLevel 14 → 15

Last updated 7 months ago

Was this helpful?

Level Goal

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. Note: localhost is a hostname that refers to the machine you are working on

Write-Up

  1. List the content of the current directory:

ls
  1. Display the content of the sshkey.private file:

cat sshkey.private

This reveals sshkey.private contains an RSA private key.

  1. Use the private key to SSH into bandit14 on localhost:

ssh -i sshkey.private -p 2220 bandit14@localhost
  • -i sshkey.private: Specifies the private key file to use for authentication

  • -p 2220: Specifies the port for the OverTheWire game server

  • bandit14@localhost: Connects to user bandit14 on the same machine

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

bandit14 accessed.

  1. Once logged in as bandit14, access the password file:

cat /etc/bandit_pass/bandit14

The retrieved password: MU4VWeTyJk8ROof1qqmcBPaLh7lDCPvS

  1. Log out of the bandit14 session to return to bandit13:

exit
  1. Access the next level:

ssh bandit14@bandit.labs.overthewire.org -p 2220

Enter the password when prompted.

Lessons Learned

  • SSH keys can be used as an alternative to password authentication

  • Different user accounts can have varying levels of access to files on a system

  • Private keys should be kept secure and protected, as they grant access without a password

-- Othmane

ls
cat sshkey.private
ssh -i sshkey.private -p 2220 bandit14@localhost
bandit14 accessed
cat /etc/bandit_pass/bandit14
exit