[Wargame.kr] CustomOS 풀이+후기 (564p)
Wargame/wargame.kr

[Wargame.kr] CustomOS 풀이+후기 (564p)

풀이

Run Disk.img at Virtual Machines
Disk.img is Floppy Disk
- thx to KSHMK

Flag is consist of 23 chars.


Disk.img는 DOS/MBR boot sector이다.

qemu-system-i386 -fda Disk.img -s -S로 부팅 되기전, stop을 걸고 gdb 원격 디버깅을 할 수 있다.

 

2일차.. 아직도 뭐가 flag인지 못찾았다.

0x7c00, 0x10200에 bp를 걸고 삽질을 하고 있지만, 이상한 텍스트는 발견되지 않았다.

혹시, 내가 입력한 값과 뭐를 비교하는건가?

n일차: 혹시, 내가 입력한 값과 뭐를 비교하는건가? 라고 생각한게 맞았다.

bp를 적당한 곳에 걸고, 입력 값에 대한 연산을 수행하는 로직을 발견했다.

이 로직을 이해하면 이 문제는 끝이다.

의외로 로직을 발견하고 문제를 해결하는 시간은 오래 걸리지 않았다.

처음부터 문제가 어렵다고 생각한게 문제였다.

#include <stdio.h>
int main() {
	int key[30] = { 0x12,0xd6,0x93,0xe3,0xf4,0xdd,0x86,0x33,0x60,0x56,0x25,0xda,0x9b,0x9f,0x9e,0xc9,0x9f,0xf0,0x4c,0xaF,0xc6,0xf5,0x49,0x00 };
	char ans[30] = { 0, };
	int temp;
	int t_temp;
	int c_temp;

	for (int i = 0x20; i <= 0x7e; i++) {
		temp = i << 3;
		t_temp = temp;
		temp = temp >> 8;

		c_temp = temp | t_temp;
		c_temp = c_temp & 0xff;

		ans[0] = i;
		for (int q = 0; q <= 22; q++) {
			c_temp = key[q] ^ c_temp;
			ans[q + 1] = c_temp;
			c_temp = c_temp ^ (q + 1);

			temp = c_temp << 3;
			t_temp = temp;
			temp = temp >> 8;

			c_temp = temp | t_temp;
			c_temp = c_temp & 0xff;
			printf("%s\n", ans);
		}
	}
}

 

'Wargame > wargame.kr' 카테고리의 다른 글

[Wargame.kr] 현재 상황  (0) 2020.08.06
[Wargame.kr] baskin game 풀이 (697p)  (0) 2020.08.05
[Wargame.kr] plz variable 풀이 (644p)  (0) 2020.08.05
[Wargame.kr] adm1nkyj 풀이 (479p)  (0) 2020.08.03
[Wargame.kr] pw_crack 풀이 (514p)  (0) 2020.08.03