▸ WTCTT 2022 Qualifying Round
Web Security
1. The Cyberspace Hotel welcomes you to visit our brand new website. To keep our website secure, we keep them up-to-date and securely configured. For example, a secret value in a web page is hidden from search engines
โรงแรม Cyberspace เพิ่งติดตั้งเว็บไซต์ใหม่เป็น Wordpress CMS ที่ URL https://cyberspace-hotel.ctf.p7z.pw/ และมีการป้องกัน Search Engine ในการเข้าถึงหน้าเว็บหนึ่งเอาไว้ โดยเก็บไว้ให้ผู้บริหารที่ใช้โทรศัพท์บางรุ่นที่เข้าได้เท่านั้น คุณในฐานะแฮกเกอร์มือดี ลองหาว่า
The Cyberspace hotel just installed a new Wordpress CMS website at https://cyberspace-hotel.ctf.p7z.pw/. They block Search Engines from accessing one page, reserved only for executives using certain phone models. As a skilled hacker, try to:

- หาไฟล์ชื่อ robots.txt ในเว็บซึ่ง Search Engine ใช้ในการตรวจสอบ
- Find the robots.txt file on the site, which Search Engines check.

/wp-login.php
- ตรวจสอบดูว่ามีการใช้ค่า User-Agent อะไร?
- Check which User-Agent value is required.
User-agent: Mozilla/5.0 (Nokia 3310; 64; rv:88.0) Gecko/20200101 Firefox/62.0
- ลองเข้าถึงไฟล์ของผู้บริหารนั้นให้หน่อย (เนื้อหาข้างในไฟล์มีค่า FLAG)
- Access that executive’s file (the FLAG is inside).
Solution
เปลี่ยน parameter url : https://cyberspace-hotel.ctf.p7z.pw/lndex.php โดยให้เปลี่ยน
User-agent : Mozilla/5.0 (Nokia 3310; 64; rv:88.0) Gecko/20200101 Firefox/62.0
Change the URL parameter: https://cyberspace-hotel.ctf.p7z.pw/lndex.php Swap the User-Agent:
User-agent : Mozilla/5.0 (Nokia 3310; 64; rv:88.0) Gecko/20200101 Firefox/62.0

- คลิกขวาแล้วทำการ Do intercept > Response to this request
- Right-click then Do intercept > Response to this request


FLAG_WTCTT_01{62a7185d7d841367ca49e58fc6385731}
2. Everyone said my boss has a secret. Please help me find it. I will give you TrueMoney 20 Baht. Ok?
โรงแรม Cyberspace เพิ่งติดตั้งเว็บไซต์ใหม่เป็น Wordpress CMS ที่ URL https://cyberspace-hotel.ctf.p7z.pw/ มีผู้ใช้งาน 2 คนในเว็บ เหมือนว่าผู้ใช้งานชื่อ longcat จะตั้งรหัสผ่านไม่ปลอดภัย เป็นค่าเดียวกับข้อมูลที่เปิดเผยเป็นสาธารณะ ให้ลองหารหัสผ่านของ longcat และใช้เข้าสู่ระบบที่ /wp-login.php
Cyberspace hotel’s new Wordpress CMS site at https://cyberspace-hotel.ctf.p7z.pw/ has 2 users. The user longcat seems to have set an insecure password matching publicly visible info. Find longcat’s password and log in at /wp-login.php.
Solution
สามารถลองหาเองด้วยการอ่านเนื้อหา หรือใช้โปรแกรม cewl หรือ dirsearch ก็ได้
You can find it by reading the content yourself, or by using cewl or dirsearch.






FLAG_WTCTT_02{a8f269009632aac589a68452495fb027}
Crypto
3. Crypto != Cryptocurrency
Prerequisite: Challenge #2
พบว่ามีผู้ใช้งานใน เว็บไซต์โรงแรม Cyberspace มีการใส่ข้อความคอมเมนต์ เป็นข้อความเข้ารหัสซ่อนเอาไว้อยู่ ให้ลองถอดรหัสด้วยเว็บ https://gchq.github.io/CyberChef/ ดูจะพบความลับที่ซ่อนอยู่
- ต้องผ่านโจทย์ข้อ 2 ก่อนถึงจะทำข้อ 3 ได้
A user on the Cyberspace hotel site left a comment that is actually an encrypted message. Try decoding it with https://gchq.github.io/CyberChef/ to reveal the secret.
- You need to clear challenge #2 first before doing #3.

Cipher: efcd2298cafafe00dc97b407b68d879e86587656807b708174a0915da82752c0fd323d8368c64081af3cd8bccab2c9a7b80bf605dd46d9af24407d1b6c0898c22771650c1cf8f325418028c6eba232d9a4ffbab844361338629bef0866
Encryption: AES-OFB
KEY: 5e05c29fb196c0ddbba9f7f37189fd90
IV: 00000000000000000000600000000000
FLAG_WTCTT_03{43c5010e2aeca5bcade827171d6a2775}
OSINT
4. Shh.. there is no link to our file server. So, it should be secured, right?
Prerequisite: Challenge #3 Hint: Credential from Chall 3
มีไฟล์เซิร์ฟเวอร์ของโรงแรม อยู่ที่ Domain ชื่อ ftp.ctf.p7z.pw แต่ไม่แน่ใจว่าอยู่ที่ Port หมายเลขอะไร ให้ลองหาและใช้รหัสผ่านจาก โจทย์ข้อ 3 ในการเข้าถึง ดูจะพบข้อความลับซ่อนอยู่ · ต้องผ่านโจทย์ข้อ 3 ก่อนถึงจะทำข้อ 4 ได้
The hotel’s file server is at the domain ftp.ctf.p7z.pw, but the port is unknown. Find it and use the credentials from challenge #3 to access it. You’ll find a hidden message. You need to clear challenge #3 first.




FLAG_WTCTT_04{c971f0a3e40893bd1453bcd4bfa3904c}
Forensics
5. Password Manager is as secure as its master password
Prerequisite: Challenge #5
พบว่าในไฟล์เซิร์ฟเวอร์มีไฟล์ของ Password Manager ชื่อ KeePass อยู่ ไฟล์นี้ใช้ในการเก็บรหัสผ่าน ให้ลองใช้โปรแกรม keepass2john ในการแปลงไฟล์เป็นข้อความสำหรับการนำไปแคร็ก และใช้โปรแกรม john หรือ hashcat แคร็กรหัสผ่านออกมา
รหัสผ่านอยู่ในไฟล์ rockyou.txt และมีคำว่า happy อยู่ในรหัสผ่าน สามารถใช้ grep หรือวิธีการอื่น ๆ เอาเฉพาะรหัสผ่านที่มีคำว่า happy มาถอดได้
หลังจากได้รหัสผ่านมาแล้วสามารถใช้ โปรแกรม KeePass เปิดไฟล์ดังกล่าวได้ จะพบ FLAG
In the file server there is a KeePass Password Manager file. KeePass stores passwords. Use keepass2john to convert it to a crackable hash, then use john or hashcat to crack the password.
The password is in rockyou.txt and contains the word “happy”. You can grep or otherwise filter rockyou.txt to only crack passwords containing “happy”.
Once you have the password, open the file with KeePass. The FLAG will be inside.
Solution


- สามารถใช้ โปรแกรม KeePass เปิดไฟล์ดังกล่าวได้ จะพบ FLAG
- Open the file with KeePass to find the FLAG.







- Crack KeePass Password : How to crack a KeePass Database file - The Dutch Hacker







- จากที่เห็น file format ไม่ถูกต้อง เหมือนว่าเราต้องเปลี่ยนไฟล์ format เป็น
- As shown, the file format is incorrect. We need to change the file format to:
keepass_db.kdb keepass_db.kdbx


FLAG_WTCTT_05{31ba8066d7b4fd0c49a195e8eb4d9963}
Web Security
6. Code repository is often misconfigured and misused by hackers. Find out how?
Prerequisite: Challenge #4
มีเว็บเซิร์ฟเวอร์หลังบ้านของโรงแรม Cyberspace อยู่ที่ http://backoffice.ctf.p7z.pw:8000/ พบว่าโปรแกรมเมอร์พลาด เผลออัปโหลดโฟลเดอร์ .git ขึ้นไปด้วย ให้ลองดาวน์โหลดมาและกู้โค้ดของเว็บคืนมา สามารถใช้โปรแกรม https://github.com/kost/dvcs-ripper.git หรือ https://github.com/allyshka/pwngitmanager ในการดาวน์โหลดโค้ดกลับมาได้
- ไม่ต้องทำโจทย์ข้ออื่นก่อน สามารถทำข้อนี้ได้เลย
There is a Cyberspace hotel back-office web server at http://backoffice.ctf.p7z.pw:8000/. The programmer made a mistake and accidentally uploaded the .git folder too. Download it and recover the web source code. You can use https://github.com/kost/dvcs-ripper.git or https://github.com/allyshka/pwngitmanager.
- You don’t need to clear other challenges first. You can do this one standalone.



- https://github.com/kost/dvcs-ripper.git เราจะใช้ Tool dvcs-ripper.git ในการกู้โค้ดของเว็บคืนมา
- We’ll use the
dvcs-ripper.gittool to recover the web source code from https://github.com/kost/dvcs-ripper.git.



FLAG_WTCTT_06{08bdc42fb1622a89a9858b31ab611c6c}
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣤⣤⣤⣤⣤⣤⣤⣤⣀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀
⢀⣤⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣤⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⢠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠛⠻⣿⣿⣿⣿⣿⣿⣿⣷⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿⣿⡿⠂⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⣸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⣤⣴⣿⣿⣿⣿⣿⡿⠛⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⢰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠛⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠋ ⢀⣀⠀⠀⠀⠀⠀⠀
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠋⠁⠀⠀ ⣴⣿⣿⣿⣦⠀⠀⠀
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣦⣀⠀⠀⠀ ⢿⣿⣿⣿⡟ Ar3mus @ WTCTT 2022 Qualifying Round
⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣦⣄ ⠉⠉⠁⠀⠀⠀⠀
⠸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⡄⠀⠀⠀⠀⠀
⠀⠀ ⠙⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋
⠀⠀⠀ ⠀⠛⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋⠁
⠀⠀ ⠀⠀⠀⠀⠉⠻⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠛⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠉⠙⠛⠛⠻⠿⠿⠟⠛⠛⠋⠉⠀⠀⠀⠀⠀

