Skip to main content

Enumeration

Run Nmap Scan

View Website

Port 5080 Untitled Click help button (located at the bottom) and Login to check the version of GitLab Untitled Let’s find the vulnerability based on the GitLab Version

Exploitation

Testing CRLF Injection

https://www.youtube.com/watch?v=LrLJuyAdoAg Untitled Untitled
Tip: If the response is different from my burp and if you are not getting any netcat response (Git name error), then try removing all the projects inside your project dashboard!

CVE-2018-19585 (CRLF)

Generate Reverse Shell

Online - Reverse Shell Generator
Generate the python3 reverse shell and paste the code into reverse.sh

Listen to Reverse Shell and Exploit

Untitled
TLDR; this is a redis command sequence inside a git url that sends a task to background job queues to Redis system and executes malicious tasks GitLab 11.4.7 Remote Code Execution

Privilege Escalation

Finding Secrets

cat /opt/backup/gitlab-secrets.json
Nothing interesting here..

Token Found

Command used: cat gitlab.rb
smtp_password looks like a root password!

Privilege Escalation to Root with the Found Credentials

Mounting the Filesystem

Checking if the docker has a privilege to access local resources

The privileged: true option in a docker-compose.yml file is used to give a Docker container full access to the host’s resources, such as the host’s devices, system calls, and network stack. - stackoverflow
Analyzing the filesystem, we want to know the specific directory to get our root credentials. (/dev/sda2)
Once you mount the disk and change current directory to the /mnt filesystem, you are in!

Reference