본문 바로가기
CTF

[shell ctf 2022] Keygen

by skyepodium 2022. 8. 16.

1. 개요

코드 분석 문제

 

2. 분석

main 함수에서 인증 성공하면 getString 함수를 호출합니다.

getString 함수를 c언어로 옮겨서 출력했습니다.

#include <stdio.h>
#include <stdlib.h>

int main() {
    char *puVar1;

    puVar1 = malloc(0x19);
    *puVar1 = 0x53;
    puVar1[1] = 0x48;
    puVar1[2] = 0x45;
    puVar1[3] = 0x4c;
    puVar1[4] = 0x4c;
    puVar1[5] = 0x43;
    puVar1[6] = 0x54;
    puVar1[7] = 0x46;
    puVar1[8] = 0x7b;
    puVar1[9] = 0x6b;
    puVar1[10] = 0x33;
    puVar1[0xb] = 0x79;
    puVar1[0xc] = 0x67;
    puVar1[0xd] = 0x65;
    puVar1[0xe] = 0x6e;
    puVar1[0xf] = 0x5f;
    puVar1[0x10] = 0x31;
    puVar1[0x11] = 0x73;
    puVar1[0x12] = 0x5f;
    puVar1[0x13] = 99;
    puVar1[0x14] = 0x30;
    puVar1[0x15] = 0x6f;
    puVar1[0x16] = 0x4c;
    puVar1[0x17] = 0x7d;
    puVar1[0x18] = 0;

    printf(puVar1);
}

'CTF' 카테고리의 다른 글

[CryptoBurst CTF] ook what am i looking at  (0) 2022.08.20
[shell ctf 2022] warmup  (0) 2022.08.16
[shell ctf 2022] Pulling the strings  (0) 2022.08.16
[shell ctf 2022] Heaven  (0) 2022.08.15
[shell ctf 2022] Secret Document  (0) 2022.08.15