Home
HTB - Daily-Bugle

Scanning and Enumeration
Using NMAP to scan the host, we have...nmap -p- --min-rate=1000 -sC -A $dailybugle
Starting Nmap 7.92 ( https://nmap.org ) at 2022-03-09 20:56 WAT
Warning: 10.10.190.155 giving up on port because retransmission cap hit (10).
Nmap scan report for 10.10.190.155
Host is up (0.22s latency).
Not shown: 51485 closed tcp ports (conn-refused), 14047 filtered tcp ports (no-response)
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 7.4 (protocol 2.0)
| ssh-hostkey:
| 2048 68:ed:7b:19:7f:ed:14:e6:18:98:6d:c5:88:30:aa:e9 (RSA)
| 256 5c:d6:82:da:b2:19:e3:37:99:fb:96:82:08:70:ee:9d (ECDSA)
|_ 256 d2:a9:75:cf:2f:1e:f5:44:4f:0b:13:c2:0f:d7:37:cc (ED25519)
80/tcp open http Apache httpd 2.4.6 ((CentOS) PHP/5.6.40)
|_http-generator: Joomla! - Open Source Content Management
| http-robots.txt: 15 disallowed entries
| /joomla/administrator/ /administrator/ /bin/ /cache/
| /cli/ /components/ /includes/ /installation/ /language/
|_/layouts/ /libraries/ /logs/ /modules/ /plugins/ /tmp/
|_http-title: Home
|_http-server-header: Apache/2.4.6 (CentOS) PHP/5.6.40
3306/tcp open mysql MariaDB (unauthorized)
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 333.68 seconds
We have an ssh server, web server and a SQL server running on the host. Let's check the web server...Web Server - TCP 80
Loading the web page, we get...


http://www.[thejoomlawebsite].com/administrator/manifests/files/joomla.xml
This typically works for versions of joomla from 1.6.0 until 3.7.x. After accessing it, we get...

version 3.7.0
running on the web application. SQL injection vulnerability found for this version on
https://blog.sucuri.net/2017/05/sql-injection-vulnerability-joomla-3-7.html
.
PoC: http://[joomla_site]/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=[sql_code]
Using the url...
http://[ip_address]/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=(SELECT * FROM (SELECT(SLEEP(30)))GDiu)
confirms the vulnerability as it takes the web application 30 seconds to reply.Exploiting the SQL Injection vulnerability
Python exploit found for this vulnerability onhttps://github.com/stefanlucas/Exploit-Joomla
. Running the exploit we have...



Looking through the internet,
https://www.hackingarticles.in/joomla-reverse-shell/
explains how to get a reverse shell using the administrator endpoint
we have access to after post-exploitation.


Although, we got a shell, we are not a normal user. We are the web application user "apache". Looking around the file system in the
/var/www/html
directory we have
a file called configuration.php
. In it contains SQL login information, using the password to login for user "jjameson" in the home directory we successfully get a shell
and can view the user FLAG...

Privilege Escalation
Checking for binaries with SUID bit; nothing of interest except "SUDO". Let's view the user privileges configured...
jjameson
has sudo access to yum
binary. How to escalate privilege using the yum binary through sudo found on gtfobins; https://gtfobins.github.io/gtfobins/yum/#sudo
.
Gtfobins is a curated list of Unix binaries that can be used to bypass local security restrictions in misconfigured systems.Run the following commands...

Thank you for reading my writeup 😀 | Home