Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1336 CNY

100%

CVE-2018-11776 PoC — Apache Struts 输入验证错误漏洞

Source
Associated Vulnerability
Title:Apache Struts 输入验证错误漏洞 (CVE-2018-11776)
Description:Apache Struts versions 2.3 to 2.3.34 and 2.5 to 2.5.16 suffer from possible Remote Code Execution when alwaysSelectFullNamespace is true (either by user or a plugin like Convention Plugin) and then: results are used with no namespace and in same time, its upper package have no or wildcard namespace and similar to results, same possibility when using url tag which doesn't have value and action set and in same time, its upper package have no or wildcard namespace.
Description
Spins up an isolated test environment for experimentation with Apache Struts vulnerability CVE-2018-11776.
Readme
# Apache Struts Vulnerability Demo (CVE-2018-11776)
## Description

Spins up an isolated test environment for experimentation with Apache Struts vulnerability CVE-2018-11776.  

## Getting Started

To bring up the test environment, run the following command:

```
aws cloudformation create-stack \
--template-body file://cfn.yml \
--stack-name <STACK_NAME> \
--parameters \
ParameterKey=Ec2KeyName,ParameterValue=<KEY_NAME> \
ParameterKey=Linux2Ami,ParameterValue=<AMAZON_LINUX2_AMI_ID>
```

## Usage

1. Retrieve the victim and attacker IPs. Initiate SSH sessions to both:

	```
	# Victim public IP
	aws cloudformation describe-stacks --stack-name=<STACK_NAME> \
	--query 'Stacks[0].Outputs[?OutputKey==`VictimPublicIp`].OutputValue' --output text
	
	# Attacker public IP
	aws cloudformation describe-stacks --stack-name=<STACK_NAME> \
	--query 'Stacks[0].Outputs[?OutputKey==`AttackerPublicIp`].OutputValue' --output text
	```

2. Retrieve the command used to to check if the victim is vulnerable. Execute it on the attacker session:
	
	```
	aws cloudformation describe-stacks --stack-name=<STACK_NAME> \
	--query 'Stacks[0].Outputs[?OutputKey==`CheckVuln`].OutputValue' --output text
	```
	
3. (Optional) Retrieve the command used to see if the exploit works. Execute it on the attacker session:
	
	```
	aws cloudformation describe-stacks --stack-name=<STACK_NAME> \
	--query 'Stacks[0].Outputs[?OutputKey==`RunExploit`].OutputValue' --output text
	```
	
4. 	Set up the attacker machine to listen for reverse tunnels:
 
	```
	nc -lvp 31337
	```

5. 	Retrieve the command used to force the victim initiate a reverse tunnel to the attacker: 

	```
	aws cloudformation describe-stacks --stack-name=<STACK_NAME> \
	--query 'Stacks[0].Outputs[?OutputKey==`RunReverseShell`].OutputValue' --output text
	```

6. Open an additional SSH session to the attacker machine. Then, run the command retrieved in the previous step.
	
	Return to the reverse tunnel session. You now have CLI access to the victim machine.

## Clean up

To destroy the test environment, issue the following command:

```
aws cloudformation delete-stack --stack-name <STACK_NAME> 
```
	
# Credit

This demo is based off [hook-s3c's CVE-2018-11776-Python-PoC](https://github.com/hook-s3c/CVE-2018-11776-Python-PoC) PoC code.
File Snapshot

Log in to view the POC file snapshot cached by Shenlong Bot

Log in to view
Remarks
    1. It is advised to access via the original source first.
    2. Local POC snapshots are reserved for subscribers — if the original source is unavailable, the local mirror is part of the paid plan.
    3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online — thank you for the support. View subscription plans →