Shang
Blog 👨‍💻
  • 🌸Introduction
  • 💻WEB SECURITY
    • Research Vulnerability
      • 📲Server-side topics
        • 🔏API Testing
        • 🔏Race conditions
        • 🔏XML external entity (XXE) injection
        • 🔏Server-side request forgery (SSRF)
        • 🔏File upload vulnerabilities
        • 🔏Access control vulnerabilities and privilege escalation
        • 🔏Business logic vulnerabilities
        • 🔏OS Command injection
        • 🔏Directory traversal
        • 🔏Authentication vulnerabilities
        • 🔏SQL injection
      • 📱Client-side topics
        • 🔏DOM-based vulnerabilities
        • 🔏Cross-origin resource sharing (CORS)
        • 🔏WebSockets
        • 🔏Clickjacking (UI redressing)
        • 🔏Cross-site request forgery (CSRF)
        • 🔏Cross-site scripting(XSS)
      • 🌀Advanced topics
        • 🔐Web cache poisoning
        • 🔐HTTP request smuggling
        • 🔐Prototype pollution
        • 🔐Server-side template injection(SSTI)
        • 🔐Insucure deserialization
    • Learn Java Vulnerability
      • Intro & Setup
      • Java Reflection Part 1
      • Java Reflection Part 2
    • Research Documents
      • 🎯DNS Rebinding
      • 🍪Remote Code Execution - Insecure Deserialization
      • 🍪Remote Code Execution on Jinja - SSTI Lab
      • 🍪Exploit cross-site request forgery (CSRF) - Lab
      • 🍪Exploit a misconfigured CORS - Lab
      • 🍪Same Origin Policy (SOP) - Lab
  • 📝WRITE-UP CTF
    • CTF Competitions
      • 🔰[WolvCTF 2023] Writeup Web
      • 🔰[M☆CTF Training 2023] Writeup Web
      • 🔰[HackTM CTF 2023] Writeup Web
      • 🔰[Incognito 4.0 2023] Writeup Web
      • 🔰[LA CTF 2023] Re-writeup Web
      • 🔰[Dice CTF 2023] Writeup Web
      • 🔰[ByteBandits CTF 2023] Writeup Web
      • 🔰[Knight CTF 2023] Writeup Web
      • 🔰[Sekai CTF 2022] Writeup Web
      • 🔰[WRECK CTF 2022] Writeup Web
      • 🔰[Maple CTF 2022] Writeup Web
    • CTF WarGame
      • ✏️[Root me] Writeup Sever Side
      • ✏️Websec.fr
      • ✏️[Root me] Writeup XSS Challenge
    • [tsug0d]-MAWC
      • 💉TSULOTT
      • 💉IQTEST
      • 🧬TooManyCrypto
      • 🧬NumberMakeup
    • Pwnable.vn
Powered by GitBook
On this page
  • Improper Error Handling
  • Hi-Score
  • Hash Browns
  1. WRITE-UP CTF
  2. CTF Competitions

[ByteBandits CTF 2023] Writeup Web

Previous[Dice CTF 2023] Writeup WebNext[Knight CTF 2023] Writeup Web

Last updated 2 years ago

Improper Error Handling

Mở đầu bài chúng ta sẽ có bài giao diện như này:

Cần nhập password, khi nhập pass thì mình thử nhập một pass bất kỳ nhưng nó ghi là pass quá ngắn và mình nghĩ tới SQL Injection nhưng không đúng nhưng sau khi check một lúc thì challenge này chỉ cần nhập pass đủ dài thì có pass

Ví dụ như: asdfghjklzxcvvbnnmmkjhgfdsasdfgh -> đủ 32 ký tự là được

Hi-Score

Bài này cần một lần 100 click mỗi giây thì sẽ lấy ra flag, lúc đầu mình nghĩ sẽ viết lại một đoạn JS up lên console để overwrite lại hàm Click() nhưng sau một lúc mở source thì có một link tới JS của web. Mình dùng console để console.log ra và flag nằm ở đây:

Flag: flag{THAtS_15_A_SM4rT_m0ve}

Hash Browns

Vào trang web này chả có gì, xem một lúc thì có cookie với key là garlic

garlic:cmztpaurxxnoqz3p2on73msbohg5sk74l2fxnxp27gky6cdjqzqq6nad

Với các cookie này mình chả biết làm gì cả , một lúc research lâu cũng không nghĩ vấn đề nằm ở đâu một điều nữa mình check garlic lên thì nó chỉ hiện hình ảnh củ tỏi, một lúc lâu không có team nào solve được bài này thì admin tung hint ra:

Nhìn hình mình nhớ tới trình duyệt Tor, rồi cũng k biết cho Tor để làm gì. Sau khi tải Tor về mình chạy challenges trên trình duyệt này cũng không có gì bất thường. Chợt nhận ra cookie là garlic có giá trị một mã không xác định, một lúc sau từ sự gợi ý của một người bạn thì mình nhận ra ở Tor có cách chạy ẩn mà không bị theo dõi qua .onion(the onion router):

http://http://3g2upl4pq6kufc4m.onion

Mình dùng value của garlic nối thêm .onion nữa để chạy:

Xem source để xem flag:

Có một cách khác nếu không dùng Tor Browser thì có thể code tool gửi tới Tor như sau:

import requests

def get_tor_session():
    session = requests.session()
    # Tor uses the 9050 port as the default socks port
    session.proxies = {'http':  'socks5://127.0.0.1:9050',
                       'https': 'socks5://127.0.0.1:9050'}
    return session

# Following prints your normal public IP
print(requests.get("http://web.bbctf.fluxus.co.in:1004").headers)

# Make a request through the Tor connection
# IP visible through Tor
session = get_tor_session()
print(session.get("http://cmztpaurxxnoqz3p2on73msbohg5sk74l2fxnxp27gky6cdjqzqq6nad.onion/").content)
# Above should print an IP different than your public IP

Cảm ơn mọi người đã đọc bài, hẹn mọi người wu các giải tiếp theo!!

📝
🔰
Page cover image