티스토리 뷰
728x90
반응형



페이지로 이동하면 로그인 버튼이 나오게 된다.
로그인 버튼을 클릭하면 로그인을 할 수 있다.
제공된 파일에서는 login.php 파일이 눈에 띈다.
<?php
// Check if the request is a POST request
if ($_SERVER["REQUEST_METHOD"] == "POST") {
// Read and decode the JSON data from the request body
$json_data = file_get_contents('php://input');
$login_data = json_decode($json_data, true);
// Replace these values with your actual login credentials
$valid_password = 'dGhpcyBpcyBzb21lIGdpYmJlcmlzaCB0ZXh0IHBhc3N3b3Jk';
// Validate the login information
if ($login_data['password'] == $valid_password) {
// Login successful
echo json_encode(['status' => 'success', 'message' => 'LITCTF{redacted}']);
} else {
// Login failed
echo json_encode(['status' => 'error', 'message' => 'Invalid username or password']);
}
}
?>
코드를 확인해보면, valid_password를 주는데
이 valid_password와 사용자가 입력한 비밀번호가 동일하면
FLAG를 출력해주는 코드다!

username은 아무거나 입력해주고
password에 valid_password를 입력해주면
FLAG가 출력된다!
FLAG
LITCTF{oOps_sh0uld_h4v3_us3d_str1ct_c0mp4r1sons}
728x90
반응형
'CTF > Web' 카테고리의 다른 글
| [SSCTF 2023] SQLi 101 (0) | 2023.08.19 |
|---|---|
| [LIT CTF 2023] unsecure (0) | 2023.08.07 |
| [AmateuresCTF 2023] Factorial Calculator (0) | 2023.07.24 |
| [AmateuresCTF 2023] Waiting-an-eternity (0) | 2023.07.24 |
| [n00bzCTF 2023] Club N00b (0) | 2023.06.11 |
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- 스테가노그래피
- MISC
- md5
- 해킹
- SQLi
- web
- 인시큐어뱅크
- cheatengine
- dreamhack
- forensics
- 포렌식
- FTKImager
- sqlinjection
- networking
- 리버싱
- forensic
- CTF
- AssaultCube
- Android
- Fiesta
- mongodb
- rev
- 안드로이드
- Steganography
- 취약점
- Cookie
- reversing
- 드림핵
- 모바일
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 | 31 |
글 보관함