Lantern

Recon

nmap_scan.log|h-50%_styled
└─$ grep lant /etc/hosts
10.129.65.97    lantern.htb

HTTP (80) [Enum]

Simple website serving some html. Vacancies page seems interesting. Upon uploading a file that ends with .pdf we get Thank you! We will conact you very soon!

Writeup.png

No subdomains or interesting files found on port 80.

The file upload only accepted PDF, I tried uploading malicious payloads but no callback and XSS too didn't work. malicious-pdfarrow-up-right

HTTP (3000) [Enum]

Some kind of Admin panel which seems to be using Blazor

Writeup-1.png

Hmmm..

Writeup-2.png

Communication happens on Websockets?

Writeup-3.png

Feroxbuster with common.txt wordlist found /error

Writeup-4.png

In the response headers we get Server: Kestrel too.

HTTP (80)

Skipper Proxy

Port 80 also runs on blazor and the response headers has Server: Skipper Proxy

Skipper vulnerable to SSRF via X-Skipper-Proxyarrow-up-right

Looks like SSRF is valid.

While searching around for blazor common files I came across the chanan/BlazorStyled/docs/_frameworkarrow-up-right which had interesting files, like jsons. The files were not readable unless we used the X-Skipper-Proxy header:

Writeup-5.png
Writeup-6.png

Internal

Note: Using the proxy key we are able to see all DLLs used by blazor application in Network.

Add the X-Skipper-Proxy key to burp requests and then we are able to see Internal Pages of website

Writeup-9.png

SQLi

Book vacation is vulnerable to SQLi.

Writeup-10.png

Based on Dotnet application I assumed the database was MSSQL, but it's sqlite3?!

Writeup-11.png

110% rabbit hole as database is controlled by Javascript 💀

HTTP (3000) [Admin]

Creds: admin:AJbFA_Q@925p9ap#22

Admin Dashboard

Writeup-7.png

File Upload

If we try to upload any web shell via Upload Content we can't activate it because we get Content-Type: application/octet-stream

Writeup-8.png

Source

In files we can get source of app:

LFI

LFI successful

There's a database somewhere...

I tried getting program cmdline's, but for whatever reason they were empty.. almost all PIDs.......

Components

If we enter incorrect module name we get the path to components:

Writeup-12.png

Craft malicious payload:

I tried changing the path as file was being uploaded, but wasn't able to get it into the components directory. If we reverse the process and point to images directory another error happens.

Writeup-13.png

Most probably no permission to read the file..

It also seems case sensitive.

Writeup-14.png

SHEEEEEEEEEEEEEEEEEEEEEH!! After so much blood and sweat finally managed to get the right DLL type to get reverse shell.

Generate DLL like so: https://www.c-sharpcorner.com/UploadFile/1e050f/creating-and-using-dll-class-library-in-C-Sharp/arrow-up-right Revshells C# TCP Client payload from https://www.revshells.comarrow-up-right

ReverseShellDLL.cs|h-50%

Project version and settings.

Note: Not positive if Microsoft.AspNetCore.Components was required.

Compile that bitch and upload. Make sure to use BTP Burp extension while editing or it might not work.

Writeup-16.png

Trigger the payload by Choose module and BAM Reverse shell babyyyyy!

Writeup-15.png

Reverse Shell

User.txt

Privilege Escalation

To use proper shell add your public key in .ssh/authorized_keys and SSH into the box.

Gather data about the process, after some time running the program top 2 syscalls were read and write so export only them:

Writeup-17.png

Note: It's better to add -c flag and specify the output file from CLI. F6 export works, just no confirmation about save but its saved in cwd.

Binary: ProcMon-for-Linuxarrow-up-right

There's a lot of suspicious pattern like {CHAR}[?25h, following up on that I filtered out the stream:

Nice, it's actual lines that nano is writing!

Split the lines by suuddoo word, get single line and delete repeated chars:

Root.txt

Root scripts

Last updated