| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 | 29 | 30 |
Tags
- androidhacking
- sql injection
- Bandit
- androGoat
- msfconsole #heartbleed #247ctf #misc #webhacking
- error-based
- pentest
- 밴딧
- Linux
- time-based
- 쿠키변조
- 취약점 진단
- 리눅스
- 안드로이드 모의해킹
- bandit #밴딧 #웹해킹 #해킹 #화이트해커 #공부 #스터디 #IT #hacking #linux #openssl #nmap
- 모의해킹
Archives
- Today
- Total
d0r1
[dreamhack] pathtraversal 본문
@app.route('/get_info', methods=['GET', 'POST'])
def get_info():
if request.method == 'GET':
return render_template('get_info.html')
elif request.method == 'POST':
userid = request.form.get('userid', '')
info = requests.get(f'{API_HOST}/api/user/{userid}').text
return render_template('get_info.html', info=info)
@app.route('/api')
@internal_api
def api():
return '/user/<uid>, /flag'
@app.route('/api/user/<uid>')
@internal_api
def get_flag(uid):
try:
info = users[uid]
except:
info = {}
return json.dumps(info)
@app.route('/api/flag')
@internal_api
def flag():
return FLAG
중요한 부분만 간추리면 다음과 같다.
flag는 /api/flag 에 존재한다고 한다
코드를 확인해보면, get_info를 수행할 때, {HOST}/api/user/{user_id} 를 통해 user_id에 해당 하는 파일을 불러오는 거 같다
그렇다면, user_id에 경로를 강제로 주입함으로써, 문제를 풀 수 있다.

'dreamhack > misc' 카테고리의 다른 글
| [dreamhack] robocaptcha (0) | 2025.07.08 |
|---|---|
| [dreamhack] Batch Checker (1) | 2024.01.09 |
| [dreamhack] 산타 할아버지도 힘들어요 (0) | 2024.01.09 |
| [dreamhack] password in the box (0) | 2024.01.09 |
| [dreamhack] set-int (1) | 2023.10.19 |