Explore HackDev

$ writeup

keiione
Nov 11, 2026

HackerDNA - Nmap Commands Lab: Port Scanning to Privilege Escalation

#hackerdna#ctf

author: keiione Difficulty: Very Easy Lab: https://hackerdna.com/labs/learn-102

  1. after we get the target IP, we scan it using nmap

image

  1. port 23 is open, as we know port 23 is telnet. So we need to login using telnet. using command "telnet [ip]". login: user

image

  1. after logged in, we want to see all files in the system. using command "ls -la"

image

as you can see, we found "flag-user.txt" file. to read it, we can use cat command "cat flag-user.txt". and we'll get the first flag.

  1. to find the second flag(root flag), you need to logged in as root. we can do it by typing "su root" in the terminal. If it ask the password, type "root". we're in.

  2. if we list all the files again, it may not be there. to search for it, we can use this command "find / -type f -name "flag*" 2>/dev/null"

find - find files command in linux -type f - file type -name - specific name for the file 2>/dev/null - hide all error

thenn press enter

image

  1. as we can see, we got the flag-root.txt in /root directory. read it using cat command "cat /root/flag-root.txt". we got the flag. submit it and you're done :)