online_unzipper源码
import osimport uuidfrom flask import Flask, request, redirect, url_for,send_file,render_template, session, send_from_directory, abort, Responseapp = Flask(__name__)app.secret_key = os.environ.get("FLASK_SECRET_KEY", "test_key")UPLOAD_FOLDER = os.path.join(os.getcwd(), "uploads")os.makedirs(UPLOAD_FOLDER, exist_ok=True)users = {}@app.route("/")def index(): if "username" not in session: return redirect(url_for ...
前情提要引子提到文件上传,大家能想到什么呢?
作业上传?
头像上传?
或者是视频投稿?
我们可以发现,文件上传在生活中随处可见。
但是,如果开发者没有对上传的文件做足够的校验与隔离,上传功能就可能成为入侵的入口 —— 上传 Webshell、触发远程代码执行(RCE)、引发信息泄露、造成资源耗尽等后果。
文件上传漏洞简介文件上传,即客户端(通常是浏览器、App 或脚本)把本地的文件传到服务器,让服务器保存并使用。
在 Web 里,“文件上传”一般是指通过 HTTP/HTTPS 请求,把文件作为请求体的一部分发到服务器。 最常见的方式是 HTML 表单中的 <input type="file">,提交后浏览器会自动把文件内容打包进请求(通常是 multipart/form-data 格式)。
为什么会产生文件上传漏洞?开发者过度信任用户上传的文件,没有对文件进行充分、严格的验证和限制。
防御措施:
使用白名单:只允许特定的、安全的文件扩展名和MIME类型。
重命名文件:使用随机生成的文件名,避免使用用户提供的文件名。
验证文 ...
Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.
Quick StartCreate a new post$ hexo new "My New Post"
More info: Writing
Run server$ hexo server
More info: Server
Generate static files$ hexo generate
More info: Generating
Deploy to remote sites$ hexo deploy
More info: Deployment
搭建教程:https://blog.fiveth.cc/p/bb32/
hexo cl #清除本地缓存hexo g ...



