Web

Wordpress

Reverse Shell #1 - Edit existing Plugin

Examples

Initial Shell

Kali

git clone https://github.com/pentestmonkey/php-reverse-shell.git
cp php-reverse-shell/php-reverse-shell.php .
subl php-reverse-shell.php 

Update the page with your reverse shell then save. This will make the plugin not appear anymore under Installed Plugins

Curl the page to activate it.

Kali

Reverse Shell #2 - Upload Plugin

Examples

Mr Robot CTFRetro

revshell.php code

Kali

TomCat

Common usernames and passwords

Examples

Thompson

Reverse Shell

Examples

Thompson

Kali

Spring Boot

Reverse Shell

Examples

Initial Shell

Exploit: https://spaceraccoon.dev/remote-code-execution-in-three-acts-chaining-exposed-actuators-and-h2-database/

Kali #1

Below example checks the IP which may not be necessary.

Kali #2

reverse.sh

Kali #1

Kali #2

Download payload

Kali #3

Run payload

Kali #3

See CMDS from page source

Examples

Jack-of-All-Trades

Sometimes you can't see the results of the output from the page so you need to check the page source.

Kali

Browser

CGI-Bin

Scanning

Examples

0day

See if a cgi-bin folder appears in the inital scans, if it does start scanning that direcoty for .cgi files.

Kali

Shell

Examples

0day

Link: https://book.hacktricks.xyz/network-services-pentesting/pentesting-web/cgi

Kali#1

Kali #2

Change request type

Examples

Mother's Secret

Change the request to POST and add everything else highlighted, we see the status message now changes.

Now we change the yaml to the the emergency override code mentioned in the room.

Now we perform the same steps again except this time for the api/nostromo route and the new file we discovered.

WebDav Cadvaer

If server is using WebDav and we have credentials we can login and upload files.

Examples

Dav

Kali

XXE Injection

Exploiting XXE - In-Band

Examples

Exploiting XXE - In-Band

Exploiting XXE - Out-of-Band

Examples

Exploiting XXE - Out-of-Band

SSRF + XXE

Examples

SSRF + XXE

XML-RPC

Check if it is enabled

Examples

Retro

wpscan or a scan maybe able identified that xmlrpc.php exists, if it is check if it is enabled.

View Files

Examples

MustacchioXEE - Read files

Input

Base64 encode the file

XSS

Reflected XSS

Examples

Reflected XSS

CVE-2023-38501 - Vulnerable Web Application 1

Stored XSS

Examples

Reflected XSS

CVE-2021-38757 - Vulnerable Web Application 2

Dom-Based XSS

Examples

DOM-Based XSS

XSS - Steal JVT

Examples

XSS - Steal JVT

https://jwt.io/

I tried updating the token it didn't work

Next we're going to try to steal the JWT from another user.

Kali

Browser

This was annoying because if I went to my posts it wouldn't work so I went to Jakes post and changed the number from 2 to 6 to get to the report page. Then just clicked the report button

we got a token from a user that isn't us

We can see it is from Michael who is an admin.

Sent again but this time just forwarded the request so we could see what that script was doing

The script was printing the flag

This wasn't working before but after next time I went to this box tried I could just update the cookie from the browser and it worked.

Brower cookie

CSRF

Examples

CSRF

Last updated