[TOC]

image-20211018221452760

希望我们都能永远记得当下!

QQ图片20211020002953.png

签到

image-20211019232235842

image-20211022123135771

直接扫码就可以了。

WEB

image-20211022123232476

web0.1

image-20211022123251008

image-20211022123316952

直接修改

X-Forwarded-For: 127.0.0.1

web0.2

image-20211022123446206

image-20211022123531714

可以下载flag.txt,但是打开后并不是。

这道题的考点是可以使用file协议下载文件:

image-20211022123648186

payload: ?file=flag.php

image-20211022123736543

打开的源码:

<?php
header('Content-Type: text/html; charset=utf-8'); //网页编码
function encrypt($data, $key) {
$key = md5 ( $key );
$x = 0;
$len = strlen ( $data );
$l = strlen ( $key );
for($i = 0; $i < $len; $i ++) {
if ($x == $l) {
$x = 0;
}
$char .= $key {$x};
$x ++;
}
for($i = 0; $i < $len; $i ++) {
$str .= chr ( ord ( $data {$i} ) + (ord ( $char {$i} )) % 256 );
}
return base64_encode ( $str );
}

function decrypt($data, $key) {
$key = md5 ( $key );
$x = 0;
$data = base64_decode ( $data );
$len = strlen ( $data );
$l = strlen ( $key );
for($i = 0; $i < $len; $i ++) {
if ($x == $l) {
$x = 0;
}
$char .= substr ( $key, $x, 1 );
$x ++;
}
for($i = 0; $i < $len; $i ++) {
if (ord ( substr ( $data, $i, 1 ) ) < ord ( substr ( $char, $i, 1 ) )) {
$str .= chr ( (ord ( substr ( $data, $i, 1 ) ) + 256) - ord ( substr ( $char, $i, 1 ) ) );
} else {
$str .= chr ( ord ( substr ( $data, $i, 1 ) ) - ord ( substr ( $char, $i, 1 ) ) );
}
}
return $str;
}

$key="TSW";
$data="l5zCzLDRydSPmtfPlKzNoaGYm6rDzM/Vm9SZqKWZz5iu";//encrypt($flag,$key)


?>

源码的解密程序是对的,但是需要添加执行语句进行回响,得到flag.

直接添加下列语句至代码尾行,123是测试语句,哈哈哈!
echo decrypt($data,$key);
echo 123;

但是这里需要说一下,执行的echo语句如果在尾行,可以不带分号,但如果在中间一定要带分号。

web0.3

image-20211022124430236

image-20211022124505414

这道题限制就在输出位有位数限制,改下源码就行:

image-20211022124611831

把长度1改大一点就可以了。

image-20211022124719962

web0.4

image-20211022124752580

这个题真的有点难,是php中ereg截断绕过:

image-20211022124914171

可以从源码中发现提示flag.php:

image-20211022124954096

image-20211022125022797

<?php
header ( 'Content-Type: text/html; charset=utf-8' ); // 网页编码
error_reporting ( 0 );
highlight_file(__FILE__);
$flag = "flag{xxxxxxxxxxxxxx}";
//echo $_POST['num'];
if (isset ( $_POST ['num'] )) {
if (@ereg ( "^[1-9]+$", $_POST['num'] ) === FALSE)
echo '说好的数字呢?';
else if (strpos ( $_POST['num'], '#testaasafd' ) !== FALSE)
die ( 'Flag: ' . $flag );
else
echo '你的数字不太符合我的心意哦!';
}
?>
<html>
<head>
<title>猜密码</title>
</head>
<body style="text-align: center">
<center>
<img src="1.gif"/>
<form action="index.php" method="post">
<input type="text" name="num" /> <input type="submit" value="提交" />
</form>
</center>
<!-- flag.php -->
</body>
</html>

重点关注这里:

image-20211022125135004

首先得存在一个POST方法传参的num变量,然后使用截断绕过ereg函数,接着字符串中得有#testaasafd就可以到达die()方法获得flag。

POST:
num=2%00#testaasafd

image-20211022125620304

但是没有看到flag,这是因为需要在web4默认网页下进行POST传参:

image-20211022125931235

web3

image-20211022130004628

这道题一定不要想复杂,直接SQL注入万能密码就行!

不过username和password都需要注入

image-20211022130139516

image-20211022130229556

image-20211022130212746

web1

image-20211022130300175

这个也是php代码审计,但是有个问题,一定不能改下载的文件名:

<?php
echo 'try Anonymous and Password<br>';

//echo $_SERVER['PHP_SELF']."<br>";
//echo $_SERVER["QUERY_STRING"]."<br>";
echo $_SERVER["REQUEST_URI"]."<br>";

$username = $_GET['username'];
$password = $_GET['password'];
if(isset($username) && isset($password) )
{
if(md5($username)=="7079c72c21415131774625ba1d64f4b0" && md5($password) == 'dc647eb65e6711e155375218212b3964' )
{
echo 'Congratulations!ctf flag:'.md5($_SERVER["REQUEST_URI"]);
}
else if($username=="anonimous"){
echo 'flag lost';
}else if($password == 'password'){
echo 'flag lost';
}
else
{
echo 'flag lost';
}
}else{
echo 'flag lost';
}
?>


payload:
?username=Anonimous&&password=Passowrd

这道题出的有点问题,因为&&和&的不同导致结果也不一样,存在非预期解。

image-20211022130724758

image-20211022130902108

尝试提交一下就好了。

web2

image-20211022131016730

<?php



if (isset($_GET['name']) and isset($_GET['password']))
{
if ($_GET['name'] == $_GET['password']){
echo '<p>Your password can not be your name!</p>';
}
else if (sha1($_GET['name']) === sha1($_GET['password']))
{
$namearr = $_GET['name'];
$passwdarr = $_GET['password'];
if(($namearr[0] == 1) && ($passwdarr[0] == 2)){
$flag = "{".$_SERVER["REQUEST_URI"]."}";

echo ''.md5($flag);
}else{
$flag = 'error';
die('Flag: '.$flag);
}


}

else{
echo '<p>Invalid password.</p>';
}
}
else
echo '<p>Login first!</p>';
?>

这道题和上一题一样,因为是自己配php环境,导致存在非预期解。

?name[]=1&&password[]=2

image-20211022132851047

?name[0]=1&&password[0]=2

image-20211022133213504

MISC

image-20211023105138874

老色逼

熟悉的中国矿业大学图

直接使用stegsolve进行色块分析,在red,green,blue中发现顶部有黑色图层:

Analyse—>Data Extract

image-20211023105043283

保存下来时一张二维码,奈斯,一扫就是flag。

黑客流量包

开局流量分析,wireshark上:

image-20211023105355618

以字符串为关键字索引flag:

image-20211023105543497

image-20211023105527268

password就是flag

misc1

是二进制转为ascii码:

11001100110110001100001011001110111101100110000001100010011000001101001011100110110011101101111011011110110010001111101

但由于空格没有,使用某些工具可能跑不出来,所以可以采取截断的方式进行转化:

这道题就是工具的问题:

image-20211023112113541

image-20211023112041390

11001100110110001100001011001110111101100110000001100010011000001101001011100110110011101101111011011110110010001111101		

666c61677b3031306973676f6f647d 
flag{010isgood}

misc2

image-20211023113947840

直接熊曰

悟空

image-20211023114023071

直接佛曰

曲折的人生

这道题是压缩包嵌套问题:

CRYPTO

image-20211023101116168

猪圈里有小猪

很明显的猪圈密码:

在首部加上前缀

data:image/jpg;base64/

再将其base64转为图片对照猪圈密码就可以

image-20211023101904361

image-20211023101920732

Crypro2

image-20211023101956154

这道题是用python脚本解密或者直接凯撒解密:

##from flag import FLAG
plaintext='Qwlr{EdH1DEs1M1de}'
def encrypt(plaintext):
for j in range(26):
str_list = list(plaintext)
i = 0
while i <len(plaintext):
if not str_list[i].isalpha():
str_list[i] = str_list[i]
else:
a = "A" if str_list[i].isupper() else "a"
str_list[i] = chr((ord(str_list[i]) - ord(a) + j) % 26 + ord(a))
i = i + 1

print(''.join(str_list))
encrypt(Qwlr{EdH1DEs1M1de})

##if __name__ == '__main__':
## plaintext = FLAG
## encrypt(plaintext)
##


#Print Qwlr{EdH1DEs1M1de}

crypto1

image-20211023102138176

直接用银河密码就可以:

image-20211023102252526

诡异的编码

image-20211023102315743

前半段是ook,后半段是brainfuck

解密链接

010

二进制转ascii码文本:

image-20211023102706219

链接:http://www.ab126.com/goju/1711.html

hex

image-20211023102742679

十六进制转文本

莫斯

..-./.-../.-/--./----.--/-../...--/..-./-.-./-.../..-./.----/--.../..-./----./...--/----./----./...../-----/....-/-----.-

莫斯电码直接转换就可以

真正的贝斯

直接复制文本到浏览器url框。base64转图片就可以

真正的真正的贝斯

image-20211023103042016

@iH<,{bdR2H;i6*Tm,Wx2izpx2!

base91

image-20211023103128303

链接:

www.atoolbox.net/Tool.php?Id=935

培根

image-20211023103325482

链接:

http://rumkin.com/tools/cipher/baconian.php

凯撒

image-20211023103513710

iodj{fdvhu_lv_hdvb}

image-20211023103558667

熟悉的编码

image-20211023103735885

url解密:

http://tool.chinaz.com/tools/urlencode.aspx

表情

这个表情可以直接在控制台输入,会回响结果的。

゚ω゚ノ= /`m´)ノ ~┻━┻   //*´∇`*/ ['_']; o=(゚ー゚)  =_=3; c=(゚Θ゚) =(゚ー゚)-(゚ー゚); (゚Д゚) =(゚Θ゚)= (o^_^o)/ (o^_^o);(゚Д゚)={゚Θ゚: '_' ,゚ω゚ノ : ((゚ω゚ノ==3) +'_') [゚Θ゚] ,゚ー゚ノ :(゚ω゚ノ+ '_')[o^_^o -(゚Θ゚)] ,゚Д゚ノ:((゚ー゚==3) +'_')[゚ー゚] }; (゚Д゚) [゚Θ゚] =((゚ω゚ノ==3) +'_') [c^_^o];(゚Д゚) ['c'] = ((゚Д゚)+'_') [ (゚ー゚)+(゚ー゚)-(゚Θ゚) ];(゚Д゚) ['o'] = ((゚Д゚)+'_') [゚Θ゚];(゚o゚)=(゚Д゚) ['c']+(゚Д゚) ['o']+(゚ω゚ノ +'_')[゚Θ゚]+ ((゚ω゚ノ==3) +'_') [゚ー゚] + ((゚Д゚) +'_') [(゚ー゚)+(゚ー゚)]+ ((゚ー゚==3) +'_') [゚Θ゚]+((゚ー゚==3) +'_') [(゚ー゚) - (゚Θ゚)]+(゚Д゚) ['c']+((゚Д゚)+'_') [(゚ー゚)+(゚ー゚)]+ (゚Д゚) ['o']+((゚ー゚==3) +'_') [゚Θ゚];(゚Д゚) ['_'] =(o^_^o) [゚o゚] [゚o゚];(゚ε゚)=((゚ー゚==3) +'_') [゚Θ゚]+ (゚Д゚) .゚Д゚ノ+((゚Д゚)+'_') [(゚ー゚) + (゚ー゚)]+((゚ー゚==3) +'_') [o^_^o -゚Θ゚]+((゚ー゚==3) +'_') [゚Θ゚]+ (゚ω゚ノ +'_') [゚Θ゚]; (゚ー゚)+=(゚Θ゚); (゚Д゚)[゚ε゚]='\\'; (゚Д゚).゚Θ゚ノ=(゚Д゚+ ゚ー゚)[o^_^o -(゚Θ゚)];(o゚ー゚o)=(゚ω゚ノ +'_')[c^_^o];(゚Д゚) [゚o゚]='\"';(゚Д゚) ['_'] ( (゚Д゚) ['_'] (゚ε゚+(゚Д゚)[゚o゚]+ (゚Д゚)[゚ε゚]+(゚Θ゚)+ (゚ー゚)+ (゚Θ゚)+ (゚Д゚)[゚ε゚]+(゚Θ゚)+ ((゚ー゚) + (゚Θ゚))+ (゚ー゚)+ (゚Д゚)[゚ε゚]+(゚Θ゚)+ (゚ー゚)+ ((゚ー゚) + (゚Θ゚))+ (゚Д゚)[゚ε゚]+(゚Θ゚)+ ((o^_^o) +(o^_^o))+ ((o^_^o) - (゚Θ゚))+ (゚Д゚)[゚ε゚]+(゚Θ゚)+ ((o^_^o) +(o^_^o))+ (゚ー゚)+ (゚Д゚)[゚ε゚]+((゚ー゚) + (゚Θ゚))+ (c^_^o)+ (゚Д゚)[゚ε゚]+(゚ー゚)+ ((o^_^o) - (゚Θ゚))+ (゚Д゚)[゚ε゚]+(゚Θ゚)+ (゚ー゚)+ ((o^_^o) +(o^_^o))+ (゚Д゚)[゚ε゚]+(゚Θ゚)+ ((゚ー゚) + (゚Θ゚))+ (゚ー゚)+ (゚Д゚)[゚ε゚]+(゚Θ゚)+ (゚ー゚)+ (゚Θ゚)+ (゚Д゚)[゚ε゚]+(゚Θ゚)+ (゚ー゚)+ ((゚ー゚) + (o^_^o))+ (゚Д゚)[゚ε゚]+(゚Θ゚)+ ((゚ー゚) + (o^_^o))+ (o^_^o)+ (゚Д゚)[゚ε゚]+(゚Θ゚)+ (゚ー゚)+ ((゚ー゚) + (o^_^o))+ (゚Д゚)[゚ε゚]+(゚Θ゚)+ ((゚ー゚) + (゚Θ゚))+ ((゚ー゚) + (o^_^o))+ (゚Д゚)[゚ε゚]+(゚Θ゚)+ ((゚ー゚) + (゚Θ゚))+ ((゚ー゚) + (o^_^o))+ (゚Д゚)[゚ε゚]+(゚Θ゚)+ (゚ー゚)+ (゚ー゚)+ (゚Д゚)[゚ε゚]+(゚Θ゚)+ (゚ー゚)+ ((゚ー゚) + (o^_^o))+ (゚Д゚)[゚ε゚]+(゚Θ゚)+ ((゚ー゚) + (゚Θ゚))+ ((゚ー゚) + (o^_^o))+ (゚Д゚)[゚ε゚]+(゚Θ゚)+ ((゚ー゚) + (゚Θ゚))+ ((゚ー゚) + (o^_^o))+ (゚Д゚)[゚ε゚]+(゚Θ゚)+ (゚ー゚)+ (゚ー゚)+ (゚Д゚)[゚ε゚]+(゚Θ゚)+ ((゚ー゚) + (o^_^o))+ ((゚ー゚) + (゚Θ゚))+ (゚Д゚)[゚ε゚]+(゚ー゚)+ ((o^_^o) - (゚Θ゚))+ (゚Д゚)[゚ε゚]+((゚ー゚) + (゚Θ゚))+ (゚Θ゚)+ (゚Д゚)[゚o゚]) (゚Θ゚)) ('_');



image-20211023104348191

贝斯

直接base64解码就可以。