- Description
- Enumeration
- Reverse Shell
- Local Enumeration
- Shellshock Local Privilege Escalation
- Root Flag
Description
Sokar was a vulnhub competition, unfortunately I did not have enough free time to compete.
Author: @_RastaMouse
Download: VulnHub
Enumeration
Port Scanning
Service Enumeration
Port | Service | Version Detection |
---|---|---|
|
HTTP |
Apache httpd 2.2.15 ((CentOS)) |
HTTP Enumeration
Inspection of the Web Application revealed /cgi-bin/cat
which indicated it could be vulnerable to shellshock.
Shellshock
The Shellshock exploit was used to execute remote commands on the target system, however a reverse shell or bind shell were not possible due to restrictive ingress and egress firewall rules. This made for a painful local enumeration of the system via Burp Suite.
Identify Current User
Shellshock home dir perms
Shellshock files owned by user bynarr
The file /tmp/stats
appeared to get updated every few minutes, indicating a cronjob could be running.
Shellshock mail spool readable
The above disclosed bynarrs
passwords and the outbound port 51242
rule for the user.
Reverse Shell
The following shellshock payload was sent using Burp Suite:
The cronjob called the .profile file and execute the file contents.
A reverse shell was successfully spawned as the user bynarr
Local Enumeration
The following disclosed several bash environment variables were permitted to run as the user bynarr
with sudo permissions.
Shellshock Local Privilege Escalation
The following shellshock payload was crafted to successfully escalate permissions to root:
Root Flag
Thanks for the VM :)