WriteUp

    Root-me :  JSON Web Token (JWT) - Introduction

    Root-me : JSON Web Token (JWT) - Introduction

    admin 으로 로그인 하라고 씌여있다. (the objective is to login as admin) JWT 문제인 만큼 JWT값을 확인해 보도록 하자. (since it is a JWT problem, lets find JWT value) 먼저 guest로 로그인하면 어떤 값이든 줄것 같다. (login as guest would give us some values...) 쿠키값에 JWT 값이 들어있었다. (I could find JWT value inside the cookie) 한번 디코딩해 보자.(lets decode it) jwt.io/ 우리는 payload 값만 admin으로 변조하면 성공이다.(we have to change the username value into admin) 여기서..

    Dreamhack : csrf-1

    xss 문제랑 상당히 양식이 비슷하다. 해야하는 행동도 비슷할 것 같다. 먼저 코드를 보자. #!/usr/bin/python3 from flask import Flask, request, render_template, make_response, redirect, url_for, session, g 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': ..

    DreamHack : xss-1

    일단 3개의 페이지가 나오는데 돌아가면서 구경을 좀 했다. xss는 코드를 주입하는 부분이고, memo는 입력된 코드를 볼수 있는데 flag에서 입력을 하면 다 hello로 나온다. memo 에 가서 hello 대신 스크립트를 넣어주면 되겠다고 생각했다 ?memo = 이렇게 넣어주려고 했는데, 해당 문자열이 필터링 당하는 것 같다. "

    DreamHack : Basic ROP x64

    Ubuntu 16.04 Arch: amd64-64-little RELRO: Partial RELRO Stack: No canary found NX: NX enabled PIE: No PIE (0x400000)#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[0x40] = {}; initi..

    DreamHack : ssp_001

    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) { printf("Element of index %d is : %02x\n", idx, box[idx]); } void menu() { puts("[F]..

    DreamHack : ssp_000

    Ubuntu 16.04 Arch: amd64-64-little RELRO: Partial RELRO Stack: Canary found NX: NX enabled PIE: No PIE (0x400000)#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 ..

    DreamHack : Sint

    #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() { char buf[256]; int size; initialize(); signal(SIGSEGV, get_shell); printf("Size: "); scanf("%d", &size); if (size > 256 || s..

    DreamHack : Out_of_bound

    #include #include #include #include #include char name[16]; char *command[10] = { "cat", "ls", "id", "ps", "file ./oob" }; 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 idx; initialize(); printf("Admin name: "); read(0, name, sizeof(name)); p..

    DreamHack : off_by_one_001

    Ubuntu 16.04 Arch: i386-32-little RELRO: Partial RELRO Stack: No canary found NX: NX enabled PIE: No PIE (0x8048000) #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 read_str(char *ptr, int size) { int len; len = read(0, ..

    DreamHack : off_by_one_000

    Ubuntu 16.04 Arch: i386-32-little RELRO: Partial RELRO Stack: No canary found NX: NX enabled PIE: No PIE (0x8048000) #include #include #include #include #include char cp_name[256]; void get_shell() { system("/bin/sh"); } 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..