keiione
HackerDNA - Nmap Commands Lab: Port Scanning to Privilege Escalation
#hackerdna#ctf
author: keiione Difficulty: Very Easy Lab: https://hackerdna.com/labs/learn-102
- after we get the target IP, we scan it using nmap

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

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

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.
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.
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

- 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 :)
