Spectra

Intro
Recon
Start Reconnaissance
Visiting the http://10.129.240.86/ webpage
http://spectra.htb/main/ is a WordPress site.
http://spectra.htb/testing/index.php has an error:
Error establishing a database connection
Add the found values to the /etc/hosts file
Run ffuf to find the directories of the web server.
Let's browse http://spectra.htb/testing/ - file listing is enabled

Download the files locally
Try the same password for the administrator user at the login page:
http://spectra.htb/main/wp-login.php
it works with
administrator:devteam01
Run a WpScan (just for fun)
Exploitation
https://www.hackingarticles.in/wordpress-reverse-shell/
Insert reverse shell into the WP theme
To perform a reverse shell using a WordPress 404 page, follow these steps:
Log in to the WordPress admin panel and navigate to the theme editor
Take note of the current theme being edited. Let's use an inactive theme, e.g.
Twenty Nineteenand locate the404.phpfile within the theme's filesReplace the content of the
404.phpfile with a PHP reverse shell code. For example, you can use a simple bash reverse shell or the code from/usr/share/webshells/php/php-reverse-shell.php, modifying the IP address and port to match the attacker machine's details.
Once the 404.php file is updated with the reverse shell code, start a netcat listener on the attacker machine to receive the incoming connection. Access the modified 404.php page by navigating to the appropriate URL, such as
http://spectra.htb/main/wp-content/themes/twentynineteen/404.php
which will trigger the reverse shell.
Shell as user nginx
Foothold
Shell as user katie
Get a shell as
katie. SSH withkatie:SummerHereWeCome!!
Privilege Escalation
/sbin/initctl is a control interface for the Upstart init system (used in some older Ubuntu and Debian systems, like Ubuntu ≤ 15.04). It manages services defined in /etc/init/*.conf. If you can write or modify an Upstart config file, you can escalate privileges.
Shell as root
Since
katieis in thedevelopersgroups,katiecan modify thetest.confservice
Get a shell as
root:
Post Exploitation
Extra
Last updated
Was this helpful?
