- Author Description
- Service Enumeration
- Web Application Investigation
- Non privileged shell
- Local privilege Escalation
Author Description
The object of the game is to acquire root access via any means possible (except actually hacking the VM server or player). The purpose of these games are to learn the basic tools and techniques in vulnerability assessment and exploitation. There are more ways then one to successfully complete the challenges.
Service Enumeration
Port | Service | Version Detection |
---|---|---|
|
SSH |
OpenSSH 3.9p1 (protocol 1.99) |
|
HTTP |
Apache httpd 2.0.52 ((CentOS)) |
|
RPC Bind |
N/A |
|
HTTPS |
Apache httpd 2.0.52 ((CentOS)) |
|
CUPS |
CUPS 1.1 |
|
RPC |
RPC |
|
MySQL |
MySQL (unauthorized) |
Web Application Investigation
The web form /index.php
was vulnerable to SQL injection, entering the username admin
and the password ' or '1'='
successfully bypassed auth.
SQL Injection - Why does ' or '1'='1 work ?
The web application is expecting the SQL query:
$query = "SELECT * FROM users WHERE username = 'admin' AND password='blah'";
Entering the above injects the statement after the password='blah'
and before the closing ";
, the entire sql injection query looks like:
$query = "SELECT * FROM users WHERE username = 'admin' AND password=' or '1'='1";"
1 = 1
will always be 1
, thus the statement will return true, allowing an attacker to authenticate as admin. The above injection statement correctly closes the sql syntax, however it is possible to comment out the rest of the sql statement using: -- -
The above authentication bypass exposed a web form vulnerable to command injection, the form filtering only checks for the presence of the ping command with no filtering to prevent an attacker tacking a comment on the end using ; insert-command-here
.
Non privileged shell
A non privileged reverse shell was obtained using:
Local privilege Escalation
Thanks for the VM :)