본문 바로가기

hacking sorcerer

(372)
대나무숲 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 ..
User After free 취약점 User After free 취약점 : 쉽게 말해서 이전에 메모리를 활용한 포인터가 메모리 해제 후 적절한 초기화를 하지 않아 발생하는 취약점이다. ​ 예제 코드 #include #include #include s ​ truct NameTag { char team_name[16]; char name[32]; void (*func)();}; ​ struct Secret { char secret_name[16]; char secret_info[32]; long code;}; ​ int main() { int idx; struct NameTag *nametag; struct Secret *secret; ​ secret = malloc(sizeof(struct Secret)); ​ strcpy(secret->s..
dreamhack rev-basic-9 흠냐 흠냐 주어진 문제의 함수를 분석해보면 간단하다 . 일단 입력한 값으로 xor연산 그 다음 바이트 가져와서 rax에 더한 후 eax로 옮기고 입력값에 대해서 ror 연산 5 수행 수행 조금 더 정제된 형식으로 표현하면 이전 바이트 값을 가져온 다음 이를 해당 위치의 key 배열 문자와 xor연산 나오는 값을 index로 하는 mem 값을 가져오고 이 값을 buf의 다음 바이트와 더한다 오른쪽으로 5번 rotation 하는 연산을 반복적으로 수행하고 있댜 ​ 수식적으로 표현하면 이렇게 된다 temp = rotl(buf[i * 8 + (8 - k) % 8], 5); temp -= mem[(unsigned char)(buf[i * 8 + 7 - k] ^ keyArray[7 - k])]; ​ buf[i * ..