웹 해킹57 [Webhacking.kr] old-03 문제에 접속하면 nonogram이라는 문제를 풀어야한다. 규칙은 구글에 검색하면 자세하게 나온다. 위와 같이 nonogram을 풀면 아래와 같이 입력창이 하나 출력된다. 문자열을 입력하면 위와 같이 하나씩 추가된다. 버프스위트로 패킷을 보면 answer과 id 값이 넘어간다. answer에 ' or 1=1 -- 으로 수정하고 패킷을 보내면 pwnable하다. -- 뒤에 띄어쓰기를 하지 않으면 오류가 발생하니 주의하자. 2021. 8. 26. [Webhacking.kr] old-02 문제 서버에 접속하면 위와 문구가 출력된다. F12를 눌러 소스코드를 확인하면 주석이 두가지있는데 첫번째는 시간을 출력하고 두번째는 admin.php에 접속하라는 힌트가 기록되어있습니다. admin.php에 접속하면 위와 같이 패스워드를 입력하는 창이 나오지만 패스워드는 알 수 없습니다. 다시 이전 페이지로 돌아가서 F12를 눌러서 Application의 쿠키값을 확인하면 time이라는 변수가 있습니다. 첫번째 주석에 시간이 적혀있었는데 관련이 있어보입니다. time 값에 false를 입력하고 새로고침하면 주석에 기록된 시간이 위와 같이 09:00:00로 변경됩니다. time 값에 true를 입력하면 09:00:01으로 변경됩니다. 이를 통해 우리가 입력한 데이터베이스 언어에 따른 결과값이 출력됨을 추측.. 2021. 8. 25. [Webhacking.kr] old-01 문제 서버에 접속하면 위와 같은 페이지가 출력된다. veiw-source를 클릭해서 소스를 보면 아래와 같다. --------------------- 2021. 8. 25. [Square CTF] Password checker Name password-checker - See if your password is secure! Or whether this portal is secure! Points 50 points Type Web Description After the announcement of a catastrophic breach of PICI (Personally Identifiable Cat Information) by Evil Robot Corp, we used Shodan to see if there were any interesting new attack vectors in their IP space and found this weird password checker portal. It looks totally .. 2021. 8. 11. [Dreamhack] simple-ssti #!/usr/bin/python3 from flask import Flask, request, render_template, render_template_string, make_response, redirect, url_for import socket app = Flask(__name__) try: FLAG = open('./flag.txt', 'r').read() except: FLAG = '[**FLAG**]' app.secret_key = FLAG @app.route('/') def index(): return render_template('index.html') @app.errorhandler(404) def Error404(e): template = ''' Page Not Found. %s ''.. 2021. 7. 20. [Dreamhack] Mango const express = require('express'); const app = express(); const mongoose = require('mongoose'); mongoose.connect('mongodb://localhost/main', { useNewUrlParser: true, useUnifiedTopology: true }); const db = mongoose.connection; // flag is in db, {'uid': 'admin', 'upw': 'DH{32alphanumeric}'} const BAN = ['admin', 'dh', 'admi']; filter = function(data){ const dump = JSON.stringify(data).toLowerCas.. 2021. 7. 18. [Dreamhack] php-1 문제에서 주어진 코드는 php로 아래와 같이 4개의 파일이 존재한다. index.php PHP Back Office Home List View list.php List list 페이지에 들어가면 위 그림과 같이 2개의 목록이 있다. flag.php는 권한이 막혀있고 hello.json은 view 페이지로 이동하면서 출력된다. flag가 출력되지 않는 이유는 file=../uploads/flag.php에서 파일을 가져오는데 view 페이지에서 file에 flag라는 값이 있으면 Permission denied 문자열을 출력하고 종료되도록 설계되었다. 따라서 file이 아닌 page를 통해서 flag.php를 출력하면 되지 않을까? 라는 생각을 할 수 있다. flag.php 위치는 file=../upload.. 2021. 7. 16. [Dreamhack] pathtraversal 이번 문제는 pathtraversal 기법을 사용해야 한다. pathtraversal 기법이란 ../ 같은 문자를 사용하여 권한이 주어지지 않은 상위 디렉토리로 이동하는 기법을 말합니다. 문제는 아주 간단합니다. app.py #!/usr/bin/python3 from flask import Flask, request, render_template, abort from functools import wraps import requests import os, json users = { '0': { 'userid': 'guest', 'level': 1, 'password': 'guest' }, '1': { 'userid': 'admin', 'level': 9999, 'password': 'admin' } } .. 2021. 7. 16. [Dreamhack] proxy-1 app.py #!/usr/bin/python3 from flask import Flask, request, render_template, make_response, redirect, url_for import socket app = Flask(__name__) try: FLAG = open('./flag.txt', 'r').read() except: FLAG = '[**FLAG**]' @app.route('/') def index(): return render_template('index.html') @app.route('/socket', methods=['GET', 'POST']) def login(): if request.method == 'GET': return render_template('soc.. 2021. 7. 16. 이전 1 2 3 4 5 6 7 다음