decription

 

CODEGATE2022 문제입니다.

 

Description :

You can enjoy this cafe :)

upload text, youtube, ...

 

본 사이트에서 텍스트 업로드 유튜브 등 사용하여 보세요 :) 라고 설명하고 있습니다.

이때만 해도 업로드란 단어에 포커싱이 되어 파일 업로드로 푸는 문제인줄 알고 착각하였습니다.

 

문제 분석

index

login, search, write 등 많은 기능들이 존재합니다.

write에서 파일 업로드를 수행하는 줄 알고 접근하였으나 실패하여 코드를 살펴보았습니다.

 

 

code

그 중 bot.py가 존재하는 것을 보고 이를 살펴보았습니다.

코드는 다음과 같았습니다.

 

#!/usr/bin/python3
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from webdriver_manager.chrome import ChromeDriverManager
import time
import sys

options = webdriver.ChromeOptions()

options.add_argument('--headless')
options.add_argument('--disable-logging')
options.add_argument('--disable-dev-shm-usage')
options.add_argument('--no-sandbox')
#options.add_argument("user-agent=Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36")

driver = webdriver.Chrome(ChromeDriverManager().install(),options=options)
driver.implicitly_wait(3)

driver.get('http://3.39.55.38:1929/login')
driver.find_element_by_id('id').send_keys('admin')
driver.find_element_by_id('pw').send_keys('$MiLEYEN4')
driver.find_element_by_id('submit').click()
time.sleep(2)

driver.get('http://3.39.55.38:1929/read?no=' + str(sys.argv[1]))
time.sleep(2)

driver.quit()

의도치 않게 표기되어 있는 admin 계정의 id와 pw를 확인하게 되었습니다.

 

driver.find_element_by_id('id').send_keys('admin')
driver.find_element_by_id('pw').send_keys('$MiLEYEN4')

 

 

flag

이를 사용하여 로그인을 진행하였더니 flag를 확인할수 있었습니다.

 

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

[dvCTF] RSA  (0) 2022.03.14
[Codegate2022] PrimeGenerator  (0) 2022.03.07
[MHSCTF] Erlenmeyer Biscuits (Cuppa Joe 2)  (0) 2022.02.23
[MHSCTF] Cuppa Joe  (0) 2022.02.20
[MHSCTF] James Harold Japp  (0) 2022.02.20

Erlenmeyer Biscuits (Cuppa Joe 2)

mhsctf2022 Web 문제입니다.

 

Description :

You remember that coffee shop that just opened up, Cuppa Joe? Well there's now a competitor shop that's opening up across from them! It's called Erlenmeyer Biscuits, and here is their website. I really don't want Cuppa Joe to go out of business, so do you think you could dig up some dirt on Erlenmeyer Biscuits to stop them from opening? mhsctf-erlenmeyer-biscuits.0xmmalik.repl.co (you may need to wait for the site to wake up)

 

경쟁 카페의 웹사이트가 생겼습니다. 경쟁 카페로부터 flag를 획득해야됩니다.

 

 

문제 분석

index-page

웹 페이지 첫화면입니다.

이 페이지의 화면과 소스코드 말고는 다른 정보가 없었기에 우선 cookie 부터 확인해보았습니다.

 

cookie

cookie에 session으로 설정되어 있는 값을 확인하였고 형식을 토대로 짐작했을때 JWT로 짐작하였습니다.

 

 

문제 풀이

확인된 JWT token을 decode 하였습니다.

flag 값이 확인되었습니다.

 

더보기

flag{fl45k_s35510n_c00k13s_4r3_1n53cure}

 

 

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

[Codegate2022] PrimeGenerator  (0) 2022.03.07
[CODEGATE2022] CAFE  (0) 2022.03.05
[MHSCTF] Cuppa Joe  (0) 2022.02.20
[MHSCTF] James Harold Japp  (0) 2022.02.20
[MHSCTF] Crash Hacker (Em Dee 2)  (0) 2022.02.20

Cuppa Joe

mhsctf2022 Web 문제입니다.

 

Description :

A new coffee shop is opening up in my neihborhood! It's called Cuppa Joe and I can't wait to check it out! It would ahem be a real shame if someone were to ahem hack their website and, hypothetically, get their secret flag. mhsctf-cuppajoe.0xmmalik.repl.co (you may need to wait for the site to wake up)

 

Cuppa Joe 카페 웹사이트에서 플래그를 획득하라고 합니다.

 

문제 분석

index-page

웹 페이지 첫화면입니다.

sitemap에 index, flag, message php가 있다고 알려주고 있습니다.

하지만 flag.php 파일에는 직접적인 접근이 안됩니다.

 

/message.php

때문에 다른 부분부터 살표보도록 하겠습니다.

하단에 message 칸에 값을 입력하면 message.php에서 입력값을 그대로 출력해줍니다.

이 기능에서 XSS가 가능하지 시도해보도록하겠습니다.

 

XSS

<script>alert(1);</script>

위 구문을 사용하여 XSS 가능 여부를 확인했습니다.

 

문제 풀이

<script>location.href = '/flag.php'</script>

페이지를 이동하는 구문을 사용하여 message 페이지를 경유하여 접근해보니 문제가 해결되었습니다.

더보기

flag{c0ff33_be4nz}

 

 

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

[CODEGATE2022] CAFE  (0) 2022.03.05
[MHSCTF] Erlenmeyer Biscuits (Cuppa Joe 2)  (0) 2022.02.23
[MHSCTF] James Harold Japp  (0) 2022.02.20
[MHSCTF] Crash Hacker (Em Dee 2)  (0) 2022.02.20
[MHSCTF] Peanuts  (0) 2022.02.20

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

Crash Hacker (Em Dee 2)

mhsctf2022 Cryptography 문제입니다.

 

Description :

Another super-secret message from Em! What does this one mean? b4b11af47f3086ce1293df4908d026d4 Remember to enter your answer in the "flag{...}" format! Hint: If at first you don't succeed, try, try again.

 

b4b11af47f3086ce1293df4908d026d4값을 분석하여 평문을 찾아내야 되는것으로 보입니다.

 

문제 분석

md5 crack

바로 평문이 나온것을 확인할수 있습니다.

 

문제 풀이

형식에 맞게 해시값을 넣어 작성해주면 문제가 풀립니다.

더보기

flag{mmm_p@$ta}

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

[MHSCTF] Cuppa Joe  (0) 2022.02.20
[MHSCTF] James Harold Japp  (0) 2022.02.20
[MHSCTF] Peanuts  (0) 2022.02.20
[MHSCTF] Em Dee  (0) 2022.02.20
[DefCamp CTF 21-22] casual-defence  (0) 2022.02.15

Peanuts

mhsctf2022 Cryptography 문제입니다.

 

Description :

Charlie Brown received this message from his good friend Pig-Pen, but it appears to be nonsense. What could it be? Remember to enter your answer in the "flag{...}" format; it's all lowercase.

 

Pig-Pen으로부터 받은 메시지인 첨부파일을 분석해야됩니다. 넌센스로 보입니다.

 

문제 분석

첨부 파일

pig-pen word로 보입니다.

구글링을 통해 확인한 표와 대칭시켜 해독하면 해결될것으로 보입니다.

 

문제 풀이

pig-pen word

해석하면 goodgriefchaliebrown이 나옵니다.

형식에 맞게 해시값을 넣어 작성해주면 문제가 풀립니다.

더보기

flag{goodgriefchaliebrown}

 

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

[MHSCTF] James Harold Japp  (0) 2022.02.20
[MHSCTF] Crash Hacker (Em Dee 2)  (0) 2022.02.20
[MHSCTF] Em Dee  (0) 2022.02.20
[DefCamp CTF 21-22] casual-defence  (0) 2022.02.15
[DefCamp CTF 21-22] para-code  (0) 2022.02.15

+ Recent posts