---
# System prepended metadata

title: myfirstCTF writeup

---

myfirstCTF writeup
===
我只會寫水題qq 
by.ニオ
因為code部分應該會被擋到所以以下是原文(hackmd)網址
https://hackmd.io/@NeoDoggy/mfctf2021

---
### welcome
猜數字通靈，把這串輸入到那ㄍ東西裡面
```=1
2025830455298
```
```=1
flag=忘惹
```

---
### copy&paste
在html中會看到一個叫做f14g.php的檔案
再加上截圖
![](https://i.imgur.com/AWqxJ1O.png)
大致上可以推出flag
然後這題我一直送F1aG結果是f1aG
哭啊我的first blood
```=1
flag=AIS3{Re33Ee3E33e3eEEe3eE3El11I1l1i11y_lo0O0oo00o00oOC0OOoo00o0Oo0O0o0Ooo0Oo0oo0Oo0OOOO000OO0ng_f1aG}
```

---
### covid-19
CSY orz
用以下這兩個code可以print出flag
```cpp=1
char target[26]{0x41, 0x48, 0x51, 0x30, 0x7f, 0x30, 0x31, 0x33, 0x71, 0x56, 0x62, 0x3b, 0x61, 0x3e, 0x72, 0x78, 0x23, 0x25, 0x60, 0x4c, 0x79, 0x21, 0x23, 0x7c, 0x65, 0x00};
```
```cpp=1
void check(char *flag) {
    long long b = 1;
    for(int i = 0; i < 25; i++){
        b = b & (((flag[i] ^ i)) == target[i]);
    }
}
```
```=1
flag=AIS3{574y_h0m3|w34r_m45k}
```

---
### yuki
OS:108新課綱w這題時事題
總之我是foremost flag.png後裡面的zip檔打開還就有了
flag:
![](https://i.imgur.com/OTDvdQS.png)
到底為什麼會有中文ㄉflag www

---
### Judgment
總之他在玩undertell的梗
寫這題時我比較無腦
直接建表
但是建表會有碰撞
所以要手動修正

```python=1
from hashlib import sha256
import string
flag = ''

cand = string.ascii_letters + string.digits + '_{}'
charset = string.printable[:93]

enc = ''
for c in flag:
	assert(c in cand)
	enc  += charset[int(sha256(c.encode()).hexdigest(), 16) % len(charset)]

print(enc)
```
```python=1
flag= ')g;Fk@>2g;2V2J?d5G3_8V2<dR2i5GZ@<?2)g\j_2V&?2;@[F@ek2_3"=k&;2)\F2J9LL4g[W2"[2<)RZ23@<?2elFZ?2=@jZ23@=F2Yi52;lL5Vj2J?2J8\e@eW23e2lF330'
main= 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890_{}'
table=')J%jk_F_g(<VV[L7=&;>8Xy>Y5dq<<?}rl@T=94e"*_\ZG5F=kRt3GFV_We)ki2k0'
ans=''
for i in flag:
    t=0
    for x in table:
        if i==x:
            ans+=main[t]
            break
        t+=1
print(ans)
```
只有這樣會print出
```=1
AISGEiT_IS_L_BeaZt1FUL_Kay_0ZtsiKe_AIrDF_LRe_SiNGinE_F1oQERS_ArG_BlOOmIN6_oN_KAys_1iKe_nhGse_QiDs_1iQG_Y0Z_ShOZLD_Be_BUrnin6_1n_hG11}
```
顯然他不是flag，所以我叫出undertale來看看
```=1
it's a beautiful day outside,
birds are singing, flowers are blooming...
on days like these, kids like you...
should be burning in hell.
```
手動修正一下
```=1
AIS3{iT_IS_4_BeaZt1FUL_Kay_0ZtsiKe_AIrDF_LRe_SiNGinE_F1oQERS_ArG_BlOOmIN6_oN_KAys_1iKe_nhGse_QiDs_1iQG_Y0Z_ShOZLD_Be_BUrnin6_1n_hG11}
```
完成

---
### piano
應該是反組譯
但是我沒完成就結束了ww

###### tags: ais3,mfctf,ctf