石家庄房和城乡建设部网站网站建设属于设备吗
news/
2025/9/25 17:27:44/
文章来源:
石家庄房和城乡建设部网站,网站建设属于设备吗,wordpress主查询翻页,seo工具大全打算刷一遍nssweb题#xff08;任重道远#xff09;
前面很简单 都是签到题
这里主要记录一下没想到的题目
[GDOUCTF 2023]hate eat snake
这里 是对js的处理 有弹窗 说明可能存在 alert
我们去看看js
这里进行了判断 如果 getScore-0x1e9* 我们结合上面 我觉得是6…打算刷一遍nssweb题任重道远
前面很简单 都是签到题
这里主要记录一下没想到的题目
[GDOUCTF 2023]hate eat snake
这里 是对js的处理 有弹窗 说明可能存在 alert
我们去看看js
这里进行了判断 如果 getScore-0x1e9* 我们结合上面 我觉得是60
然后我们去看看定义 找到了定义分数的方法 我们可以通过前端定义
Snake.prototype.getScore () 100
来设定我们的分数为100 [NISACTF 2022]babyupload
这里通过源代码可以获取备份文件
from flask import Flask, request, redirect, g, send_from_directory
import sqlite3
import os
import uuidapp Flask(__name__)SCHEMA CREATE TABLE files (
id text primary key,
path text
);
def db():g_db getattr(g, _database, None)if g_db is None:g_db g._database sqlite3.connect(database.db)return g_dbapp.before_first_request
def setup():os.remove(database.db)cur db().cursor()cur.executescript(SCHEMA)app.route(/)
def hello_world():return !DOCTYPE html
html
body
form action/upload methodpost enctypemultipart/form-dataSelect image to upload:input typefile namefileinput typesubmit valueUpload File namesubmit
/form
!-- /source --
/body
/htmlapp.route(/source)
def source():return send_from_directory(directory/var/www/html/, pathwww.zip, as_attachmentTrue)app.route(/upload, methods[POST])
def upload():if file not in request.files:return redirect(/)file request.files[file]if . in file.filename:return Bad filename!, 403conn db()cur conn.cursor()uid uuid.uuid4().hextry:cur.execute(insert into files (id, path) values (?, ?), (uid, file.filename,))except sqlite3.IntegrityError:return Duplicate fileconn.commit()file.save(uploads/ file.filename)return redirect(/file/ uid)app.route(/file/id)
def file(id):conn db()cur conn.cursor()cur.execute(select path from files where id?, (id,))res cur.fetchone()if res is None:return File not found, 404# print(res[0])with open(os.path.join(uploads/, res[0]), r) as f:return f.read()if __name__ __main__:app.run(host0.0.0.0, port80)读取完毕后发现 不允许有后缀
并且读取文件是通过 # print(res[0])with open(os.path.join(uploads/, res[0]), r) as f:return f.read()
这里来进行的
这里主要是 os.path.join 存在一个漏洞
第一个以”/”开头的参数开始拼接之前的参数全部丢弃,当有多个时从最后一个开始
这个时候 我们如果输入 /flag 就会读取/flag 生成 uuid 那么这个时候的flag其实就是原本存储的文件
所以我们可以实现文件读取
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/917303.shtml
如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!