dreamhack(60)
-
xss-2 풀이
#!/usr/bin/python3 from flask import Flask, request, render_template from selenium import webdriver import urllib import os app = Flask(__name__) app.secret_key = os.urandom(32) try: FLAG = open("./flag.txt", "r").read() except: FLAG = "[**FLAG**]" def read_url(url, cookie={"name": "name", "value": "value"}): cookie.update({"domain": "127.0.0.1"}) try: options = webdriver.ChromeOptions() for _ i..
2021.08.17 -
proxy-1 풀이
우선 웹페이지에서 Raw Socket Sender (Done)이라는 부분에 들어가 보겠습니다. host, port를 지정하고 거기에 원하는 Data를 보낼 수 있도록 구현해놓은 것 같습니다. 소스코드를 보면, /admin이라는 형식으로 POST에 접속했을 때 admin() 함수가 실행됩니다. 그리고 if문이 5개 보이는데, 이 조건들을 모두 불만족했을 때 FLAG를 획득할 수 있습니다. 조건 1. 로컬 호스트에서 접속하기 조건 2. user-Agent의 값이 'Admin Browser'이어야 함 조건 3. Dreamhackuser 헤더 값이 'admin'이어야 함 조건 4. 'admin'의 쿠키 값이 true여야 함 조건 5. userid의 값이 'admin'이여야 함 host는 127.0.0.1, po..
2021.08.11 -
basic_exploitation_003 풀이
#include #include #include #include void alarm_handler() { puts("TIME OUT"); exit(-1); } void initialize() { setvbuf(stdin, NULL, _IONBF, 0); setvbuf(stdout, NULL, _IONBF, 0); signal(SIGALRM, alarm_handler); alarm(30); } void get_shell() { system("/bin/sh"); } int main(int argc, char *argv[]) { char *heap_buf = (char *)malloc(0x80); char stack_buf[0x90] = {}; initialize(); read(0, heap_buf, 0x80..
2021.08.04 -
basic_heap_overflow 풀이
#include #include #include #include #include struct over { void (*table)(); }; void alarm_handler() { puts("TIME OUT"); exit(-1); } void initialize() { setvbuf(stdin, NULL, _IONBF, 0); setvbuf(stdout, NULL, _IONBF, 0); signal(SIGALRM, alarm_handler); alarm(30); } void get_shell() { system("/bin/sh"); } void table_func() { printf("overwrite_me!"); } int main() { char *ptr = malloc(0x20); struct o..
2021.08.03 -
basic_exploitation_002 풀이
#include #include #include #include void alarm_handler() { puts("TIME OUT"); exit(-1); } void initialize() { setvbuf(stdin, NULL, _IONBF, 0); setvbuf(stdout, NULL, _IONBF, 0); signal(SIGALRM, alarm_handler); alarm(30); } void get_shell() { system("/bin/sh"); } int main(int argc, char *argv[]) { char buf[0x80]; initialize(); read(0, buf, 0x80); printf(buf); exit(0); } https://dreamhack.io/learn/2..
2021.08.02 -
welcome 풀이
흠...? 코드를 보니 그냥 서버만 접속하면 FLAG를 딸 수 있을 것 같습니다. natcat으로 주어진 접속 정보에 접속해보겠습니다. ???? natcat 사용법만 알면 점수 꽁으로 먹는 문제네요? 이번 글은 풀이라고 해도 될지 의심이 가는 수준이네요..ㅋㅋ
2021.07.22