ν‹°μŠ€ν† λ¦¬ λ·°

CHALLENGE

XSS-Game Level 1

🌧: 2020. 11. 26.
μ„€λͺ…(λ²ˆμ—­)

XSS ( κ΅μ°¨ μ‚¬μ΄νŠΈ μŠ€ν¬λ¦½νŒ… ) λ²„κ·ΈλŠ” μ›Ή μ‘μš© ν”„λ‘œκ·Έλž¨μ—μ„œ κ°€μž₯ 일반적이고 μœ„ν—˜ν•œ μœ ν˜•μ˜ 취약점 쀑 ν•˜λ‚˜μž…λ‹ˆλ‹€μ΄λŸ¬ν•œ μ„±κ°€μ‹  λ²„κ±°λŠ” 적이 μ•±μ—μ„œ μ‚¬μš©μž 데이터λ₯Ό ν›”μΉ˜κ±°λ‚˜ μˆ˜μ •ν•  수 μžˆλ„λ‘ ν—ˆμš©ν•  수 있으며, μ΄λŸ¬ν•œ μ•…μ˜μ μΈ 슀크립트λ₯Ό λ³΄λ‚΄λŠ” 법을 λ°°μ›Œμ•Ό ν•©λ‹ˆλ‹€

 

Googleμ—μ„œλŠ” μ΄λŸ¬ν•œ 버그가 μ–Όλ§ˆλ‚˜ μ€‘μš”ν•œμ§€ 잘 μ•Œκ³  μžˆμŠ΅λ‹ˆλ‹€μ‹€μ œλ‘œ Google은 XSS 문제λ₯Ό μ°Ύκ³  μˆ˜μ •ν•˜λŠ” 데 맀우 진지 ν•˜μ—¬ κ°€μž₯ λ―Όκ°ν•œ μ œν’ˆμ—μ„œ 발견된 μœ„ν—˜ν•œ XSS 버그에 λŒ€ν•΄ μ΅œλŒ€ 7,500 λ‹¬λŸ¬λ₯Ό μš©λ³‘μ—κ²Œ μ§€λΆˆν•˜κ³  μžˆμŠ΅λ‹ˆλ‹€.

 

ν•΄λ‹Ή κ²Œμž„μ„ 톡해 XSS 버그λ₯Ό μ°Ύκ³  ν™œμš©ν•˜λŠ” 방법을 λ°°μ›λ‹ˆλ‹€μ΄ 지식을 μ‚¬μš©ν•˜μ—¬ μ• ν”Œλ¦¬μΌ€μ΄μ…˜μ—μ„œ μ΄λŸ¬ν•œ 버그가 λ°œμƒν•˜λŠ” 것을 λ°©μ§€ν•˜μ—¬ 적을 ν˜Όλž€μŠ€λŸ½κ²Œ ν•˜κ³  λΆ„λ…Έν•˜κ²Œ ν•  κ²ƒμž…λ‹ˆλ‹€.

 

μ‹œν—˜μ΄ λλ‚˜λ©΄ 케이크가 λ‚˜μ˜΅λ‹ˆλ‹€.

 

page_header = """
<!doctype html>
<html>
  <head>
    <!-- Internal game scripts/styles, mostly boring stuff -->
    <script src="/static/game-frame.js"></script>
    <link rel="stylesheet" href="/static/game-frame-styles.css" />
  </head>
 
  <body id="level1">
    <img src="/static/logos/level1.png">
      <div>
"""
 
page_footer = """
    </div>
  </body>
</html>
"""
 
main_page_markup = """
<form action="" method="GET">
  <input id="query" name="query" value="Enter query here..."
    onfocus="this.value=''">
  <input id="button" type="submit" value="Search">
</form>
"""
 
class MainPage(webapp.RequestHandler):
 
  def render_string(self, s):
    self.response.out.write(s)
 
  def get(self):
    # Disable the reflected XSS filter for demonstration purposes
    self.response.headers.add_header("X-XSS-Protection", "0")
 
    if not self.request.get('query'):
      # Show main search page
      self.render_string(page_header + main_page_markup + page_footer)
    else:
      query = self.request.get('query', '[empty]')
       
      # Our search engine broke, we found no results :-(
      message = "Sorry, no results were found for <b>" + query + "</b>."
      message += " <a href='?'>Try again</a>."
 
      # Display the results page
      self.render_string(page_header + message + page_footer)
     
    return
 
application = webapp.WSGIApplication([ ('.*', MainPage), ], debug=False)

 

κΈ°λ³Έ ꡬ문으둜 μΆ©λΆ„νžˆ 클리어 κ°€λŠ₯ν•œ λ‹¨κ³„μž…λ‹ˆλ‹€.

 

힌트

1. μ‘μš© ν”„λ‘œκ·Έλž¨μ˜ μ†ŒμŠ€λ₯Ό 보렀면 ν”„λ ˆμž„μ„ 마우슀 였λ₯Έμͺ½ λ²„νŠΌμœΌλ‘œ ν΄λ¦­ν•˜κ³  μ»¨ν…μŠ€νŠΈ λ©”λ‰΄μ—μ„œ View Frame Sourceλ₯Ό λΈŒλΌμš°μ €μ˜ 개발자 도ꡬλ₯Ό μ‚¬μš©ν•˜μ—¬ λ„€νŠΈμ›Œν¬ νŠΈλž˜ν”½μ„ 검사할 수 μžˆμŠ΅λ‹ˆλ‹€.

2. <h1>κ³Ό 같은 프리젠 ν…Œμ΄μ…˜ νƒœκ·Έλ₯Ό μž…λ ₯ν•˜λ©΄ μ–΄λ–»κ²Œ λ©λ‹ˆκΉŒ?

3. μ’‹μŠ΅λ‹ˆλ‹€. λ§ˆμ§€λ§‰ 힌트 : <script>... alert...

'CHALLENGE' μΉ΄ν…Œκ³ λ¦¬μ˜ λ‹€λ₯Έ κΈ€

XSS-Game Level 6  (0) 2020.12.01
XSS-Game Level 5  (0) 2020.11.30
XSS-Game Level 4  (0) 2020.11.29
XSS-Game Level 3  (0) 2020.11.28
XSS-Game Level 2  (0) 2020.11.27
κ³΅μœ ν•˜κΈ° 링크
Comment