- Author Description
- Enumeration
- Inspection of the Web Application
- XSS Session ID Hijacking
- Reverse Shell
- Hashcat MD5 cracking
- Hydra SSH Brute Force
- SSH Account Compromise
- Local Privilege Escalation
Author Description
The LAMPSecurity project is an effort to produce training and benchmarking tools that can be used to educate information security professionals and test products.
Author: madirish2600
Download: VulnHub
Enumeration
Dislcaimer: Multiple Entry Points
The LAMPSecurity series is not particularly challenging, for each VM in the series I've targeted the web application as the entry point.
Host Service Enumeration
Port | Service | Version Detection |
---|---|---|
|
FTP |
vsftpd 2.0.5 |
|
SSH |
OpenSSH 4.3 (protocol 2.0) |
|
SMTP |
Sendmail |
|
HTTP |
Apache httpd 2.2.3 ((CentOS)) |
|
POP3 |
Dovecot pop3d |
|
rpcbind |
N/A |
|
Netbios |
Samba smbd 3.X (workgroup: WORKGROUP) |
|
IMAP |
Dovecot imapd |
|
HTTPS |
Apache httpd 2.2.3 ((CentOS)) |
|
Netbios |
Samba smbd 3.X (workgroup: WORKGROUP) |
|
TCP |
N/A |
|
IMAP SSL |
Dovecot imapd |
|
POP3 SSL |
Dovecot pop3d |
|
MySQL |
MySQL (unauthorized) |
|
VNC HTTP |
RealVNC 4.0 (resolution: 400x250; VNC TCP port: 5901) |
|
VNC |
VNC (protocol 3.8) |
|
X11 |
X11 |
Inspection of the Web Application
As with the previous CTF series VM’s, I’ve chosen to ignore other entry points and focus on the web application is used for the entry point.
Inspection of the web application revealed it was vulnerable to XSS (Cross Site Scripting):
Confirmed:
XSS Session ID Hijacking
From insepecting the web application it appeared Barbara
was an
admin, a guess based on her user activity. A XSS comment was placed on one of
the pages Barbara had created and an email was sent to Barbara instructing her
to view the page.
The XXS script will execute and attempt to contact a web server on the attacking machine, the url will disclose Barbara’s session ID.
Once the ID has been obtained, Cookie Manager+ Firefox plugin or Burp Suite is used to manipulate the stored cookie and replace the session ID with Barbara’s, hijacking Barbara’s session.
XSS Comment
Joomla required a user to preview a comment before saving, in this case the XSS executes and Joomla fails to save the comment. To evade this behavior, a normal comment was posted, then edited to include the XSS snipet.
HTTP Server
A HTTP server was setup on attacking machine: python -m SimpleHTTPServer
80
Email Barbara (victim)
After a couple of minutes the following appeared in the web server logs:
Barbaras Session ID: 9ehlga5fhnh8o81om1aq5so040
Swapped Session ID Burp Suite
Cookie Manager+ and / or Tamper Data can also be used for this purpose.
Successfuly logged in as Barbara:
Reverse Shell
A reverse shell was injected into a new page using Barbara’s admin account:
Drupal settings.php
The following disclosed settings.php
file for Drupal existed.
File path:
/var/www/html/drupal/sites/default/settings.php
The file contained the root account credentials for mysql.
The following SQL was used to disclose the password hashes:
Hashcat MD5 cracking
Hashcat wased to crack the hashes offline:
Hydra SSH Brute Force
Hyrda was used to brute force SSH using the previously cracked password hashes:
SSH Account Compromise
Local Privilege Escalation
Thanks for the VM :)