Skip to content

Instantly share code, notes, and snippets.

@jeroenhe
Created June 19, 2021 19:24
Show Gist options
  • Save jeroenhe/451db2a595150310b978e793d3843c43 to your computer and use it in GitHub Desktop.
Save jeroenhe/451db2a595150310b978e793d3843c43 to your computer and use it in GitHub Desktop.
Acquire _csrf token from html page using python
#!/usr/bin/env python3
import re
import sys
for i in sys.stdin:
g = re.match('.*\<.*name="_csrf".*value="(.*)"\>.*', i);
if g is not None:
print (g.group(1))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment