James Harold Japp

mhsctf2022 Web 문제입니다.

 

Description :

I need to be able to log in to this website. Can you tell me how to do it? mhsctf-jamesharoldjapp.0xmmalik.repl.co (you may need to wait for the site to wake up)

 

웹사이트에 로그인 하는 문제입니다.

정보가 너무 부족하니 페이지를 살펴보도록 하겠습니다.

 

문제 분석

index-page

Password를 입력하여 로그인 하는 문제로 보입니다.

소스 코드를 살펴보도록하겠습니다.

 

<head>
  <link rel="preconnect" href="https://fonts.googleapis.com">
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  <link href="https://fonts.googleapis.com/css2?family=Lato:wght@300&family=Exo+2&display=swap" rel="stylesheet">
  <link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
  <link rel="stylesheet" href="https://mhsctf-webexploitdata.0xmmalik.repl.co/style.css">
</head>
<body>
  <div class="w3-content">
    <label for="pwd">Password:</label>
    <input type="password" id="pwd" name="pwd">
    <button onclick="validatepwd()" type="button">Submit</button>

    <script>
      function validatepwd() {
        var x = document.getElementById("pwd").value;
        if (x == "this_is_a_really_secure_password") {
          window.open("/weirdpage.php?pwd=doublepassword")
        }
      }
    </script>
  </div>
</body>

소스코드중 script 부분에 기능이 적혀있습니다.

Password 값이 this_is_a_really_secure_password일 경우 로그인에 성공하는 것으로 보이며 특정 페이지로 이동하는 것으로 보입니다.

 

문제 풀이

login success

Password 입력결과 weirdpage.php?pwd=doublepassword로 이동하였습니다.

다시 한번 소스코드를 살펴보겠습니다.

 

<!doctype html><html><head><!--lol gottem here's the flag: flag{1n$p3ct0r_g3n3r@l}--><title>404 Not Found</title><style>
body { background-color: #fcfcfc; color: #333333; margin: 0; padding:0; }
h1 { font-size: 1.5em; font-weight: normal; background-color: #9999cc; min-height:2em; line-height:2em; border-bottom: 1px inset black; margin: 0; }
h1, p { padding-left: 10px; }
code.url { background-color: #eeeeee; font-family:monospace; padding:0 2px;}
</style>
</head><body><h1>Not Found</h1><p>The requested resource <code class="url">/weirdpage.php?pwd=doublepassword</code> was not found on this server.</p></body></html>

코드내에 flag값이 적혀있는것을 확인할 수 있습니다.

'Challenge > CTF' 카테고리의 다른 글

[MHSCTF] Erlenmeyer Biscuits (Cuppa Joe 2)  (0) 2022.02.23
[MHSCTF] Cuppa Joe  (0) 2022.02.20
[MHSCTF] Crash Hacker (Em Dee 2)  (0) 2022.02.20
[MHSCTF] Peanuts  (0) 2022.02.20
[MHSCTF] Em Dee  (0) 2022.02.20

+ Recent posts