NCTF-2025-Web-Writeup
sqlmap-master 题目 1from fastapi import FastAPI, Request 2from fastapi.responses import FileResponse, StreamingResponse 3import subprocess 4 5app = FastAPI() 6 [email protected]("/") 8async def index(): 9 return FileResponse("index.html") 10 [email protected]("/run") 12async def run(request: Request): 13 data = await request.json() 14 url = data.get("url") 15 16 if not url: 17 return {"error": "URL is required"} 18 19 command = f'sqlmap -u {url} --batch --flush-session' 20 21 def generate(): 22 process = subprocess.Popen( 23 command.split(), 24 stdout=subprocess.PIPE, 25 stderr=subprocess.STDOUT, 26 shell=False 27 ) 28 29 while True: 30 output = process.stdout.readline() 31 if output == '' and process.poll() is not None: 32 break 33 if output: 34 yield output 35 36 return StreamingResponse(generate(), media_type="text/plain") 其实就是一个网页端的sqlmap 看一下sqlmap的使用文档 ...