YOUR AD GOES HERE

SQL Injection Leading to PHP RCE and YAML-Based Privilege Escalation to Root | HackTheBox Gavel

Published 29, Mar 2026

NullSecX


Description:
In this video, we walk through the HackTheBox Gavel machine, a medium-difficulty Linux target that demonstrates how multiple vulnerabilities can be chained together to achieve full system compromise.

We begin by analyzing a misconfigured PHP application that improperly uses PDO statements, leading to a **SQL Injection vulnerability**. By exploiting this flaw, we extract sensitive data from an internal database, which provides us with valuable insight into the system and potential entry points.

Next, we identify and exploit a **PHP code injection vulnerability**, allowing us to execute arbitrary commands on the target system. This step grants us initial access and a foothold on the machine.

Finally, we escalate our privileges by targeting a **root-owned daemon** that processes user-supplied YAML files. By crafting a malicious YAML payload, we trigger **PHP code execution within a sandboxed environment running as root**, ultimately achieving full root access.

This walkthrough highlights the importance of:

* Secure database query handling (avoiding unsafe PDO usage)
* Proper input validation and sanitization in PHP applications
* The risks of insecure file parsing (YAML deserialization / processing)
* Chaining multiple vulnerabilities for full system compromise

Whether you're preparing for certifications like OSCP or improving your penetration testing skills, this machine provides a great example of real-world exploitation techniques.

???? Follow us for more:
YouTube: https://www.youtube.com/@NullSecurityX
Medium: https://nullsecurityx.medium.com/
Twitter (X): https://x.com/NullSecurityX
Instagram: https://instagram.com/NullSecurityX
Facebook: https://www.facebook.com/nullsecurityx/

Video For Thank's ; Mohamad Alamin Yassin
Mohamad Alamin Yassin Contact: https://www.linkedin.com/in/strikoder/

hackthebox gavel walkthrough
htb gavel walkthrough full
htb gavel writeup detailed
gavel hackthebox solution step by step
hackthebox medium machine gavel
htb linux machine walkthrough
hackthebox gavel exploit guide
sql injection hackthebox tutorial
sql injection exploitation example php
pdo sql injection vulnerability example
php pdo misuse security vulnerability
sql injection login bypass tutorial
database dump via sql injection
blind sql injection hackthebox example
error based sql injection tutorial
time based sql injection exploitation
web application sql injection demo
penetration testing sql injection real example
php remote code execution tutorial
php rce exploit example
php code injection vulnerability tutorial
command execution php vulnerability
webshell php exploitation tutorial
upload vulnerability php exploitation
initial foothold hackthebox tutorial
linux reverse shell php example
getting shell via php exploit
web exploitation full chain tutorial
yaml deserialization vulnerability
yaml insecure deserialization exploit
yaml parsing security issue php
yaml file upload privilege escalation
yaml exploit linux root escalation
daemon exploitation linux privilege escalation
linux privilege escalation hackthebox
privilege escalation techniques linux
root privilege escalation tutorial
linux sudo privilege escalation example
linux misconfiguration privilege escalation
ctf privilege escalation walkthrough
oscp privilege escalation techniques
post exploitation linux tutorial
pivoting and escalation hackthebox
full chain exploitation hackthebox
end to end penetration testing demo
ethical hacking practical walkthrough
red team attack chain example
bug bounty web exploitation tutorial
cyber security training hackthebox
ctf hacking tutorial beginner to advanced
advanced web exploitation techniques
real world hacking scenario demo
linux hacking tutorial step by step
web security vulnerabilities php mysql
database exploitation techniques tutorial
offensive security lab walkthrough
oscp preparation hackthebox machines list
learn hacking through hackthebox machines
complete hackthebox walkthrough gavel
hackthebox writeup sql injection rce privesc
multi stage exploitation tutorial linux
attack chain sql injection to root
php yaml exploit privilege escalation
secure coding mistakes php pdo example
web hacking full tutorial series
cybersecurity hands on lab walkthrough

#hackthebox #gavel #sqlinjection #phprce #privilegeescalation #yaml #cybersecurity #pentesting #ethicalhacking #oscp #infosec #redteam #bugbounty #linuxhacking #websecurity #ctf #writeup #hackingtutorial

Releted More Videos

  • Sorry!!! Nothing to show

You May Also Like

YOUR AD GOES HERE

YOUR AD GOES HERE