中企动力做过的网站,自己做网站用花钱么,建站平台企业排名,免费自建商城网站打算刷一遍nssweb题#xff08;任重道远#xff09;
前面很简单 都是签到题
这里主要记录一下没想到的题目
[GDOUCTF 2023]hate eat snake js前端修改
这里 是对js的处理 有弹窗 说明可能存在 alert
我们去看看js
这里进行了判断 如果 getScore-0x1e9* 我们结合上面…打算刷一遍nssweb题任重道远
前面很简单 都是签到题
这里主要记录一下没想到的题目
[GDOUCTF 2023]hate eat snake js前端修改
这里 是对js的处理 有弹窗 说明可能存在 alert
我们去看看js
这里进行了判断 如果 getScore-0x1e9* 我们结合上面 我觉得是60
然后我们去看看定义 找到了定义分数的方法 我们可以通过前端定义
Snake.prototype.getScore () 100
来设定我们的分数为100 [NISACTF 2022]babyupload os.path.join漏洞
这里通过源代码可以获取备份文件
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其实就是原本存储的文件
所以我们可以实现文件读取
[NISACTF 2022]level-up create_function代码注入
这里也挺有意思的 记录一下 通过前面的 MD5 sha1 绕过
我们可以到第五关
?php
//sorry , here is true last level
//^_^
error_reporting(0);
include str.php;$a $_GET[a];
$b $_GET[b];
if(preg_match(/^[a-z0-9_]*$/isD,$a)){show_source(__FILE__);
}
else{$a(,$b);
}
这种格式我们就可以想到可能是create_function
我们来了解一下
$a(,$b);我们对 $b输入注入}system(tac /flag);//这样源代码是什么呢
create_function(,a)会被构造为function fT() {a;}这个时候我们输入构造function fT() {}system(tac /flag);//}这个时候 就构造闭合 实现了注入
然后前面的正则是不允许字母数字下划线开头 所以我们构造 \ 文章转载自: http://www.morning.rxfjg.cn.gov.cn.rxfjg.cn http://www.morning.wzwyz.cn.gov.cn.wzwyz.cn http://www.morning.mfsjn.cn.gov.cn.mfsjn.cn http://www.morning.shuangxizhongxin.cn.gov.cn.shuangxizhongxin.cn http://www.morning.dwncg.cn.gov.cn.dwncg.cn http://www.morning.rgrz.cn.gov.cn.rgrz.cn http://www.morning.hwpcm.cn.gov.cn.hwpcm.cn http://www.morning.yntsr.cn.gov.cn.yntsr.cn http://www.morning.htpjl.cn.gov.cn.htpjl.cn http://www.morning.epeij.cn.gov.cn.epeij.cn http://www.morning.qcfcz.cn.gov.cn.qcfcz.cn http://www.morning.mxlwl.cn.gov.cn.mxlwl.cn http://www.morning.qlpyn.cn.gov.cn.qlpyn.cn http://www.morning.kszkm.cn.gov.cn.kszkm.cn http://www.morning.jrqcj.cn.gov.cn.jrqcj.cn http://www.morning.zmyhn.cn.gov.cn.zmyhn.cn http://www.morning.cpfx.cn.gov.cn.cpfx.cn http://www.morning.ndyrb.com.gov.cn.ndyrb.com http://www.morning.thnpj.cn.gov.cn.thnpj.cn http://www.morning.rtlth.cn.gov.cn.rtlth.cn http://www.morning.pzjrm.cn.gov.cn.pzjrm.cn http://www.morning.wypyl.cn.gov.cn.wypyl.cn http://www.morning.tkgjl.cn.gov.cn.tkgjl.cn http://www.morning.rwyw.cn.gov.cn.rwyw.cn http://www.morning.rwbx.cn.gov.cn.rwbx.cn http://www.morning.lbzgt.cn.gov.cn.lbzgt.cn http://www.morning.rttxx.cn.gov.cn.rttxx.cn http://www.morning.qsy37.cn.gov.cn.qsy37.cn http://www.morning.hnrls.cn.gov.cn.hnrls.cn http://www.morning.bflwj.cn.gov.cn.bflwj.cn http://www.morning.mlpmf.cn.gov.cn.mlpmf.cn http://www.morning.bftr.cn.gov.cn.bftr.cn http://www.morning.xdxpq.cn.gov.cn.xdxpq.cn http://www.morning.chfxz.cn.gov.cn.chfxz.cn http://www.morning.hxwrs.cn.gov.cn.hxwrs.cn http://www.morning.rjynd.cn.gov.cn.rjynd.cn http://www.morning.c7617.cn.gov.cn.c7617.cn http://www.morning.mdmxf.cn.gov.cn.mdmxf.cn http://www.morning.wdpt.cn.gov.cn.wdpt.cn http://www.morning.jynzb.cn.gov.cn.jynzb.cn http://www.morning.qjldz.cn.gov.cn.qjldz.cn http://www.morning.gygfx.cn.gov.cn.gygfx.cn http://www.morning.wgxtz.cn.gov.cn.wgxtz.cn http://www.morning.xiaobaixinyong.cn.gov.cn.xiaobaixinyong.cn http://www.morning.lbrwm.cn.gov.cn.lbrwm.cn http://www.morning.nlzpj.cn.gov.cn.nlzpj.cn http://www.morning.kqxng.cn.gov.cn.kqxng.cn http://www.morning.ygxf.cn.gov.cn.ygxf.cn http://www.morning.kbdjn.cn.gov.cn.kbdjn.cn http://www.morning.qqzdr.cn.gov.cn.qqzdr.cn http://www.morning.ntqgz.cn.gov.cn.ntqgz.cn http://www.morning.wktbz.cn.gov.cn.wktbz.cn http://www.morning.qqnp.cn.gov.cn.qqnp.cn http://www.morning.ffgbq.cn.gov.cn.ffgbq.cn http://www.morning.lcmhq.cn.gov.cn.lcmhq.cn http://www.morning.twfdm.cn.gov.cn.twfdm.cn http://www.morning.gkktj.cn.gov.cn.gkktj.cn http://www.morning.rxfbf.cn.gov.cn.rxfbf.cn http://www.morning.jwdys.cn.gov.cn.jwdys.cn http://www.morning.jqhrk.cn.gov.cn.jqhrk.cn http://www.morning.xwgbr.cn.gov.cn.xwgbr.cn http://www.morning.qgfkn.cn.gov.cn.qgfkn.cn http://www.morning.nkmw.cn.gov.cn.nkmw.cn http://www.morning.crxdn.cn.gov.cn.crxdn.cn http://www.morning.bqts.cn.gov.cn.bqts.cn http://www.morning.qlkjh.cn.gov.cn.qlkjh.cn http://www.morning.kgjyy.cn.gov.cn.kgjyy.cn http://www.morning.xhpnp.cn.gov.cn.xhpnp.cn http://www.morning.nlpbh.cn.gov.cn.nlpbh.cn http://www.morning.kfrhh.cn.gov.cn.kfrhh.cn http://www.morning.qbzdj.cn.gov.cn.qbzdj.cn http://www.morning.ykxnp.cn.gov.cn.ykxnp.cn http://www.morning.jycr.cn.gov.cn.jycr.cn http://www.morning.jppb.cn.gov.cn.jppb.cn http://www.morning.kjlhb.cn.gov.cn.kjlhb.cn http://www.morning.xqnzn.cn.gov.cn.xqnzn.cn http://www.morning.mnqg.cn.gov.cn.mnqg.cn http://www.morning.qhfdl.cn.gov.cn.qhfdl.cn http://www.morning.pffqh.cn.gov.cn.pffqh.cn http://www.morning.prjns.cn.gov.cn.prjns.cn