본문 바로가기

Wargame/Dreamhack

(20)
[Dreamhack] ssp-001 #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"); } void print_box(unsigned char *box, int idx) { //원하는 인덱스의 box 값을 출력 printf("Element of index %d is : %02x\n", idx, box[idx]);..
[Dreamhack] Return to shallcode Canary found. 카나리 방어 기법이 걸려있다. #include #include void init() { setvbuf(stdin, 0, 2, 0); setvbuf(stdout, 0, 2, 0); } int main() { char buf[0x50]; //80 bytes만큼 할당 init(); printf("Address of the buf: %p\n", buf); printf("Distance between buf and $rbp: %ld\n", (char*)__builtin_frame_address(0) - buf); //buf의 주소와 buf ~ $rbp 의 offset을 출력 printf("[1] Leak the canary\n"); printf("Input: "); fflush(stdou..
[Dreamhack] basic_exploitation_000 환경정보를 살펴보면, 보호기법이 아무것도 적용되지 않고 있다. #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); } int main(int argc, char *argv[]) { char buf[0x80]; initialize(); printf("buf = (%p)\n", buf); scanf("%141s", buf); return 0; } main 함수를 보면 buf..
[Dreamhack] XSS-1 #!/usr/bin/python3 from flask import Flask, request, render_template from selenium import webdriver from selenium.webdriver.chrome.service import Service 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..
[Dreamhack] FFFFAAAATTT 일단 문제 이름을 보니 FAT32 File System 부트 레코드 관련 문제인 것 같다. 다운받은 파일을 HxD로 열어서 위와 같이 [ 도구 -> 디스크 이미지 열기 -> 512 ]를 선택하면 시스템 이미지 파일이라는걸 알 수 있다. Fix the Disk!!!! 라는 문자열이 계속 나오다가 RRaA라는 글자 뒤로 보이지 않는 것을 확인할 수 있다. Fix the Disk란 말은 뭔가 손상된 것을 고치란 말이겠지. 지금 내 파일에서는 왜인지 안 보이는데... 섹터 0 부분에 Fix the Disk! 문자열이 들어가 있어서 정상적으로 인식이 안된다고 한다. RRaA 바로 윗줄까지는 섹터 0 이고 RRaA부터는 섹터 1 이다. Exterro - E-Discovery & Information Governan..
[Dreamhack] file-download-1 file-download-1 | 워게임 | Dreamhack file-download-1 File Download 취약점이 존재하는 웹 서비스입니다. flag.py를 다운로드 받으면 플래그를 획득할 수 있습니다. Reference Introduction of Webhacking dreamhack.io 우선 파일을 다운받고 압축을 풀어준다. 압축을 풀고 나온 파일의 압축을 또 풀어준다. 드디어 나온 파일과 폴더들을 열어보겠다. static templates requirements 뭔가 있을까 싶어 열어보았지만 전부 쓸데없는 애들이었다. 위에 있던 링크를 클릭해보았다. Upload My Memo 를 클릭하니 아래와 같은 창으로 이동한다. 일단 예시문에 나와있는대로 Filename과 Content를 입력하고 ..
[Dreamhack] sql injection bypass WAF sql injection bypass WAF | 워게임 | Dreamhack sql injection bypass WAF Description Exercise: SQL Injection Bypass WAF에서 실습하는 문제입니다. dreamhack.io 다운받은 파일의 압축을 풀고 하나씩 열어보도록 하자. users 데이터베이스에는 user라는 테이블이 있으며, 테이블 내부에는 idx, uid, upw 컬럼이 존재한다. 또한, “guest”, “admin” 등의 계정이 추가된 것을 확인할 수 있다. 코드를 보자. import os from flask import Flask, request from flask_mysqldb import MySQL app = Flask(__name__) app.config[..
[Dreamhack] blind sql injection advanced blind sql injection advanced | 워게임 | Dreamhack blind sql injection advanced Description Exercise: Blind SQL Injection Advanced에서 실습하는 문제입니다. 관리자의 비밀번호는 "아스키코드"와 "한글"로 구성되어 있습니다. dreamhack.io 비밀번호는 아스키코드와 한글로 구성되었다. 접속 정보에 나오는 링크를 타고 들어가보자. uid를 submit 하면, 그러니까 단어를 입력하면, 저게 쿼리의 조건절로 들어간다는 것 같다. 어라. 오버로드나 ap 오류라고 한다. 틀린 값을 입력하면 저렇게 되는건가. 쿠키는 필요없는가보다. 없다고 뜬다. 다운받은 파일의 압축을 푸니 파일이 세 개 있는데 우선 하나씩 열어보도..