Sau

Intro
Recon
Start Reconnaissance
Browse to http://10.10.11.224:55555/
Powered by request-baskets - version:
1.2.1- a web service used to colect arbitrary HTTP requests and inspect them via RESTful API or simple web UI
Exploitation
SSRF - Request-baskets
The request-baskets project has been associated with a Server-Side Request Forgery (SSRF) vulnerability, specifically identified as CVE-2023-27163.
This vulnerability affects request-baskets up to version 1.2.1 and allows attackers to forward HTTP requests to internal or private services.
The vulnerability is present in the
/api/baskets/{name}component, which can be exploited to access network resources and sensitive information.Information Disclosure: The SSRF lets attackers retrieve any internal resource over HTTP, enabling exfiltration of sensitive data beyond just unauthenticated images.
Unauthenticated Internal Access: Exploitation grants access to internal services like Nginx, APIs, and databases across the local network without credentials.
Port Scanning and Enumeration: Attackers can scan ports and map internal hosts, exposing network architecture and potential attack surfaces.
An exploit for this vulnerability has been published, demonstrating how attackers can leverage the SSRF flaw to create a local proxy for HTTP requests on the targeted machine.
The exploit calls the vulnerable API component to create a new basket, initiating a
POSTrequest. The attacker can modify theforward_urlparameter to a local service and set theproxy_responsetotrue.
Let's try the following PoC by entr0pie:
Visit the generated URL -> http://10.10.11.224:55555/izlhms
The webserver on port
80is powered by Maltrailv0.53Same on port
8338

Foothold
RCE - Maltrail
Maltrail v0.53 is associated with the CVE-2023-27163 vulnerability, which is a remote code execution (RCE) flaw.
This vulnerability allows attackers to execute arbitrary code on the target system without authentication. The exploit leverages a command injection vulnerability in the
params.get("username")parameter of themailtrail/core/http.pyfileGitHub - spookier/Maltrail-v0.53-Exploit: RCE Exploit For Maltrail-v0.53
The
usernameparameter of the login page does not properly sanitize the input, allowing an OS command injection attack
Check manual exploit by Ippsec

Use the generated URL in the following Maltrail Exploit ->
http://10.10.11.224:55555/oxmauw
The exploit encodes a reverse shell payload in Base64 to bypass potential WAF, IPS/IDS protections, delivers it via a
curlrequest to the target URL and executes it to establish a reverse shell back to the attacker's IP and port.In this specific case, remove the
+ "/login"on line 28 of theexploit.py, save and run the modified script

Shell upgrade
Shell as user puma
Privilege Escalation
Systemd CVE-2023-26604
pumauser can run a specificsystemctlcommand as root without password
Google Systemd 245.4 CVE
Found CVE-2023-26604
Before version 247, systemd failed to set
LESSSECURE=1when runningsystemctl statusviasudo, allowingless(pager) to launch other programs asrootif the output didnβt fit the terminal. This could lead to local privilege escalation ifsudoerspermittedsystemctlexecution.
Shell as root
Run the following command with puma user and exploit less
Since the weird TTY and screen, the output gets passed to
lessEnter
!shthat will runshand drops to a shell with therootuser

Summary
Target runs Request Baskets.
CVE-2023-27163 SSRF vulnerability present.
Malicious basket created to proxy internal requests.
Internal Maltrail service discovered via SSRF.
Maltrail has unauthenticated OS command injection.
Exploited injection to get reverse shell as
puma.Enumerated
sudopermissions.Found
systemdlesspager vulnerability (CVE-2023-26604).Abused
lessto execute commands asroot.
Extra
Last updated
