Exploit Writing
Table of Contents
Code Snippets
Starting Template
Useful imports
Using the requests library
requests libraryTroubleshooting
Reusable code
Tips
Perform a sanity check after every HTTP request using assert
assertPrint meaning messages after each step
Separate each exploitation step into its own function
Create a global Session object so it does not need to be explictly passed to each function call
Session object so it does not need to be explictly passed to each function callCreate a global BASE_URL string and construct the required URLs from it
BASE_URL string and construct the required URLs from itTo force all HTTP requests to go through Burp Suite without the use of the proxies argument , set the HTTP_PROXY / HTTPS_PROXY environment variable when running
proxies argument , set the HTTP_PROXY / HTTPS_PROXY environment variable when runningApply encoding/decoding scheme(s) to enable safe transmission of payloads
Use """ to create the payload string if it contains both single (') and double quotes (")
""" to create the payload string if it contains both single (') and double quotes (")Speed up SQL injections using multithreading
Hardcode an authenticated user's cookie when developing exploits for authenticated features
Avoid using f-strings (f"") or str.format if the payload contains too many curly braces ({})
f"") or str.format if the payload contains too many curly braces ({})Last updated