HGAME2024 Week1 Writeup

Hakuya Want A Girl Friend

正向分离出压缩包,但是需要密码。打开010发现文件末尾是png的reverse后的数据

image-20250211141246990

reverse后分离出png图片,修复宽高,得到压缩包密码

image-20250211141318861

解压后得到flag,但是flag头存在错误,修改后得到flag

hgame{h4kyu4_w4nt_gir1f3nd_+q_931290928}

Level 314 线性走廊中的双生实体

将附件的entity.pt解压得到模型源码,拷问GPT得到脚本

import torch

def get_input_for_target_mean(model, target=0.31415000000000004):
    # 获取linear1层
    linear1 = model.linear1

    # 获取权重和偏置
    weight = linear1.weight.detach()
    bias = linear1.bias.detach()

    # 计算所需的输入x,使得linear1(x)的均值为target
    # x @ w.T + b = target
    # 求解x
    desired_output = torch.full((weight.size(0),), target)
    x = torch.linalg.lstsq(weight, desired_output - bias)[0]
    return x.reshape(1, -1)

# 加载模型
model = torch.jit.load('entity.pt')

# 获取经过计算的输入
x = get_input_for_target_mean(model)

print("Input tensor:")
print(x)
print(f"Shape: {x.shape}")

# 获取linear1的输出
with torch.no_grad():
    x0 = model.linear1(x)
    print("\nLinear1 output mean:", torch.mean(x0).item())
    print("Target:", 0.31415000000000004)
    print("Difference:", abs(torch.mean(x0).item() - 0.31415000000000004))

# 运行完整模型
output = model(x)
print("\nFinal output:", output)

Computer cleaner

直接查看bash_history文件

pwd
cd ~
ls
cd /
ls
cd var
ls
cd www
ls
cd html
ls
cd uploads
nano shell.php
ls
pwd
cat shell.php
cd ..
ls
cat upload_log.txt 
ls
cat upload.php
ls
cat upload.html
ls
cat index.html
nano index.html 
sudo rm index.html 
ls
nano index.html
ls
sudo nano index.html
ls
sudo nano upload_log.txt 
cat uploadload_
cat upload_log.txt_
ls
cat upload_log.txt
ls
cd uploads
ls
cat shell.php 
cd ..
cd /
ls
cd ~
ls
cd Documents/
ls
nano flag_part3
ls
cat flag_part3 
cd ..
ls
cd /var/www
ls
cd html
ls
sudo nano upload_log.txt 
cat upload_log.txt 
cd ~
ls
cd Documents/
ls

跟着指令查看访问的文件即可得到Flag,需要注意的是upload_log.txt 中的ip需要访问才能得到flag2

hgame{y0u_hav3_cleaned_th3_c0mput3r!}
暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇