VishwaCTF 2024 writeup
Team: CakeisTheFake(單人)
Rank: 31/1039
Author: Naup堇姬
Misc
Who am I?
Web
Save The City
1 | DESCRIPTION |
當我嘗試nc他時,他會回應SSH-2.0-libssh_0.8.1
以及會回應bye bye
我嘗試根據他給的去搜尋,發現了。
CVE-2018-10993 libSSH authentication bypass exploit
利用這資訊我找到了一份POC,RCE!!!
https://gist.github.com/mgeeky/a7271536b1d815acfb8060fd8b65bd5d
flag在 /location.txt
FLAG: flag:VishwaCTF{elrow-club-pune}
Trip To Us
進來你會看到一個頁面
例行的先用dirsearch
來掃看看有沒有隱藏路徑
可以找到一些路徑
1 | /backups/ |
可以先去/db/
可以找到資料庫,裡面有admin的username和password(admin/unbre@k@BLE_24)
去到該路徑/auth-iit-user.php
可以找到login入口
They Are Coming
1 | DESCRIPTION |
首先根據提示應該可以想到要去robots.txt,有Decryption key
L3NlY3JldC1sb2NhdGlvbg== 可以base64 -> /secret-location
去/secret-location可以找到local storage
有東西
1 | Cipher : Gkul0oJKhNZ1E8nxwnMY8Ljn1KNEW9G9l+w243EQt0M4si+fhPQdxoaKkHVTGjmA |
CBC-128-hint
CBC解密
https://tool.lmeee.com/jiami/aes
第一個改掉就行
FLAG: VishwaCTF{g0_Su88m1t_1t_Qu14kl7}
MediCare Pharma
看到這個可以懷疑SQL injection
username=tst&password=tst' or 'a'='a'#
可以炸出幾隻帳號
登入後可以看到一個頁面,然後可以找到他會leak source code
1 |
|
可以很明顯看到這裡有command injection
1 | shell_exec($enteredInput); |
flag在家目錄
Payload
1 | ls ~ |
FLAG: VishwaCTF{d1g1t4l_p41n_di5p4tch3d_th4nk5_f0r_sh0pp1ng_with_M3diC4re_Ph4rm4}
Recipe Archival Workshop:
這題我也不知道為啥,直接上傳一個.jpg
後,把它改成.tiff
就可以拿到flag了
貌似跟fuzz extension name相關(?
https://github.com/danielmiessler/SecLists/blob/master/Discovery/Web-Content/raft-large-extensions.txt
VishwaCTF{today_i_wanted_to_eat_a_croissant_QUASO}
H34D3RS
簡單觀察了一下,你可以發現他其實是個要你偽造header來bypass各種驗證的題目(跟之前pico某題很像)
直接附上payload跟過程
加入了
1 | User-Agent: lorbrowser |
Downlink參考資料:
https://docs.w3cub.com/http/headers/downlink
Payload
1 | GET / HTTP/2 |
FLAG: VishwaCTF{s3cret_sit3_http_head3rs_r_c0o1}
Prompt Injection(本場最難也最有趣的web)
一開始進到該頁面可以快速找到一個LFI
可以嘗試去讀source code
1 | /show?id=../../../app/app.py |
source code
1 | from bottle import route, run, template, request, response, error |
是個用bottle寫的後端
另外看到了
1 | from config.secret import Vishwa |
可知道他把cookie金鑰存在哪裡,用LFI去把他找出來,可以用來偽造cookie
Cookie Key
1 | Vishwa = "trrrrrrrrrrrrryyyyyyyyyyyharddddddddd" |
原本我嘗試去偽造admin cookie但只顯示了這個
後來我去看了一下這個頁面,真的甚麼都沒有,這樣的話,感覺要RCE才能夠找到flag
先後嘗試了SSTI但都沒成果
後來看了一陣子
我先去看了get_cookie()
的底層,他去調用了cookie_decode()
嘗試去找了cookie_decode()
的底層,發現有pickle可以用來RCE!!!
1 | def cookie_decode(data, key): |
透過偽造cookie的方式,在cookie列中塞入payload來達成反序列化的RCE
使用pickle來RCE可以使用__reduce__
(傳回一個元組,第一個值是一個函數,第二個值是傳遞給函數的參數)
pickle.loads被呼叫時,它將使用參數來呼叫該函數
1 | import hashlib |
將payload修改到cookie裡面,就可以彈回reverse shell到port 9999
原本以為要提權但發現他可以執行,執行就可以拿到flag了
簡單來說,他需要你從 LFI -> 底層 -> pickle -> 偽造cookie -> RCE -> reverse shell -> Get flag
相當有趣的一題
FLAG: VishwaCTF{W3lcome_t0_p03m_p0ck3t}
Crypto
Happy Valentine’s Day
他把自己圖片的前8位跟自己做了xor,所以該圖片前8位都變成了0,
source code
1 | from PIL import Image |
我只要能找出key,在做一次xor就可以還原圖片,我嘗試去研究了.jpg的特性。發現了:
- png檔案固定開頭
[0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A]
Script
1 | from PIL import Image |
FLAG: VishwaCTF{h3ad3r5_f0r_w1nn3r5}
Teyvat Tales
要解密的
可以找到他的js
1 | const submitBtn1 = document.getElementById("submit-btn-1"); |
看起來很像Enigma machine
直接將他給的丟進去
https://cryptii.com/
FLAG: VishwaCTF{beware_of_tone-deaf_bard}
Poly Fun
題目:
1 | import numpy as np |
題目也有給我key跟enc
1 | key_enc: ☞➭⥄⫣Ⲋ⸹⿰ㆯ㍶☞⒗☞☞☞➭☞⥄☞⫣☞Ⲋ☞⸹☞⿰☞ㆯ☞㍶➭⒗➭ |
先分析那陀又臭又長的transform(num)
然後你就可以直接知道他只是在唬爛你
實際上
1 | transform(num)=num |
所以可以把題目化簡成這樣
1 | import numpy as np |
再來可以想到,他會把key的每一位丟進polyc來算出一個奇怪的東西,所以我就想到我可以建個表,把ASCII的字丟進去算出對應的。之後再把key_enc根據表對應出來來還原key
Script
1 | from itertools import product |
1 | key:b'12345678910111213141516171819202' |
最後直接解密就好了
FLAG: VishwaCTF{s33_1_t0ld_y0u_1t_w45_345y}
Intellectual Heir
題目
1 | # my secret to hide the combination of my safe in fornt of all without anyone getting a clue what it is ;) |
只是把p,q經過三角函數後寫入檔案,把他轉回來就可以解密了,另外這邊猜測e=65537
1 | def ass_to_str(input_string): |
Flag: VishwaCTF{Y0U_@R3_T#3_W0RT#Y_OF_3}
OSINT
The end is beginning
1 | DESCRIPTION |
根據他給的歌詞我找到了
https://www.youtube.com/watch?v=ybRYNRcIuA4
FLAG: VishwaCTF{Paradox_5000}
TRY HACK ME
1 | DESCRIPTION |
要找一個他的成員是tryhackme 前3%的人所以我就先去他們官網看他們的成員
https://vishwactf.com/team/team.html
找到了一個人,有tryhackme的相關文章
https://www.linkedin.com/in/ankushkaudi/?originalSubdomain=in
順著去找tryhackme,就可以找到該帳號
https://tryhackme.com/p/ankushkaudi
FLAG: VishwaCTF{Pr0f1l3_1dent1fi3d_v0uch3r5_cr3d1t3d_5ucc355fully}
ifconfig_inet
1 | DESCRIPTION |
keyword:Terry Colby
https://www.reddit.com/r/MrRobot/comments/ehhs2c/im_sure_many_of_you_noticed_terry_colbys_ip/
https://github.com/GabrielCrackPro/mr-robot-api
FLAG: VishwaCTF{fsociety00.dat_218.108.149.373}
Sagar Sangram
他給你了一個bot,問妳很多印度教問題,直接用gemini,他會給你總共十一題的答案
- gemini
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
29Q1 of 10 : So it was decided, to obtain the divine potion of immortality, churning of the ocean is to be performed. For that purpose a huge mountain was used. Tell me what is the name of the mountain and also which ocean was churned to obtain the potion of immortality?
Ans fromat : name of ocean without space_name of mountain
kshirasagara_mandara
Q2 of 10 :Let's get step back. Mount Mandara was used in churning. But it was not just around the ocean. It was brought there by someone. So, who brought Mount Mandara to Kshirasagara?
Garuda
Q3 of 10 : Now the stage is set but to churn the ocean, something was required which both the groups would hold and churn. Who was used like a rope to churn the ocean Kshirasagara?
Vasuki
Q4 of 10 : The process starts and the outcomes begin to appear. One such outcome was a very threatening substance, which had the power to destroy the whole universe. But 'The Ultimate Destroyer' comes to rescue and consumed it, which results in his throat turning blue hence he is also called 'Neelakantha'. What is the substance called?
Halahala
Q5 of 10 : Let's talk about few more outcomes. One such divine outcome was a tree. It was taken to the abode of Indra in swarga. It is often referred to as 'Wish Fulfilling Tree' as it possess the power to bring one's imagination into reality. Tell me the name of this tree?
Kalpavrikshaa
Q6 of 10 : Another creature appeared was a very powerful elephant which was taken by Lord Indra as his medium of transportation. It was very powerful elephant and also referred sometimes as 'King of Elephants'. What is the name of that elephant?
Airavata
Q7 of 10 : After a while during the process, a bow appeared during the churning. It was given to Lord Vishnu as a weapon. What is the name of that divine bow?
Sharanga
Q8 of 10 : In ancient times as mentioned in the scriptures, conch was used as a sign to initiate a war between two groups (also used for other purposes as well). Different persons from both the sides would blow the conch which will mark the start of the war. During the churning, one such conch was obtained and it was given to Lord Vishnu. It's sound symbolizes the 'Sound of Creation'. What is the name of the conch?
Panchajanya
Q9 of 10 : The fortunes turned as the goddess of fortune herself appeared. Every wanted the goddess of fortune to be at their side, but the destiny has it's own plan. She chose Lord Vishnu as her eternal consort.. Who is the goddess of fortune?
Lakshmi
Q10 of 10 : Ok, let's end this thing. After all the struggle from both the sides, the long wait comes to an end. The divine potion is here and it is brought by none other than the physician of the devas. He is also referred to as 'God of Ayurveda'. Tell me his name and also the name of divine potion?
Ans format : name of the physicianname of divine potion
Dhanvantari_Amrita
Impressive. A perfect 10/10. You are one the who deserves the flag. Just one last thing. All the event which is I asked you about is very popular and is mentioned in various scriptures like Vishnu Purana, Mahabharata, etc. Can you tell me what this event is popularly known as?
Use in place of any space
Samudra_Manthana
Perfect. That's all about this challenge. Hope you enjoyed it.
Thank you for playing VishwaCTF'24. Here you go with the flag for the challenge 'Sagar Sangram'
VishwaCTF{karmany-evadhikaras te ma phaleshu kadachana ma karma-phala-hetur bhur ma te sango stvakarmani}
Flag: VishwaCTF{karmany-evadhikaras te ma phaleshu kadachana ma karma-phala-hetur bhur ma te sango stvakarmani}
Steganography
Secret Code
binwalk 來解出兩份檔案.
為helper.txt
和5ecr3t_c0de.zip
然後發現.zip需要密碼所以炸看看他
1 | crunch 6 6 0123456789 -o pass.txt |
找到後解壓縮出 5ecr3t_c0de.txt
和 info.txt
看起來是一群座標點,把他點出來
1 | from PIL import Image, ImageDraw |
We Are Valorant
給了你一張圖片跟影片
先修復圖片成.jpg | JPEG | ff d8 ff |
接下來看影片逐偵找會找到金鑰
1 | key:Tenz |
下steghide解出來
1 | naup96321@DESKTOP-T2ED0OK:~/vish$ steghide info g.jpg |
Flag: VishwaCTF{you_are_invited_to_the_biggest_valorant_event}