åå ã¯ãpicoCTF ã® picoCTF 2024 ã®ãã¡ãBinary Exploitation ããã£ã¦ã¿ã¾ãããå
¨10åã®ãã¡ãHard ã® 1åç®ã¯è§£ããã2åç®ã¯å¾åãã«ãªãã¾ãããHard åé¡ã¯ããããªãã¬ãã«ãä¸ãã£ãæ°ããã¾ãã
ä»åã¯ãå¼ãç¶ããpicoCTF ã® picoCTF 2024 ã®ãã¡ãReverse Engineering ã¨ããã«ãã´ãªã®å
¨7åããã£ã¦ããããã¨æãã¾ããMedium ã 7åã§ãã
ããã§ã¯ããã£ã¦ããã¾ãã
ã¯ããã«
ãã»ãã¥ãªãã£ãã®è¨äºä¸è¦§ã§ããè¯ãã£ããåèã«ãã¦ãã ããã
ã»ãã¥ãªãã£ã®è¨äºä¸è¦§
picoCTF ã®å
¬å¼ãµã¤ãã¯ä»¥ä¸ã§ããè±èªã®ãµã¤ãã§ãããã·ã³ãã«ã§åãããããã®ã§å°ããã«é²ãããã¨ãã§ãã¾ãã
picoctf.com
ããã§ã¯ããã£ã¦ããã¾ãã
picoCTF 2024ï¼Reverse Engineering
ãã¤ã³ãã®ä½ãé ã«ãã£ã¦ããã¾ãã
packerï¼100ãã¤ã³ãï¼
Medium ã®åé¡ã§ãããã¤ããªãã¡ã¤ã«ï¼outï¼ã 1ã¤ãã¦ã³ãã¼ãã§ãã¾ãã
packeråé¡
packer ã¨ããååã®åé¡ã§ãããããããã°ã以ä¸ã®è¨äºã§èªãã ä»é²ã® 1 ã«ãããã«ã¼ã¨ãããã¤ããªãããã¨åºã¦ãã¦ã¾ããã
daisuke20240310.hatenablog.com
ã¾ãã¯ãç°¡åã«è¡¨å±¤è§£æãè¡ãã¾ããstrip ã®è¡¨ç¤ºãããã¾ããããNo Symbols ãªã®ã§ãstripããã¦ããã§ãããããããã®ã¯åãã¦ã§ããRELRO ãç¡å¹ï¼PLTãGOT ã®ä¸¡æ¹ãæ¸ãè¾¼ã¿å¯è½ï¼ãã¹ã¿ãã¯å®è¡å¯è½ãããã°ã©ã ã®ã¢ãã¬ã¹ã®ã©ã³ãã åãç¡å¹ã§ãã
$ file out
out: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, no section header
$ checksec --file=out
RELRO STACK CANARY NX PIE RPATH RUNPATH Symbols FORTIFY Fortified Fortifiable FILE
No RELRO No canary found NX enabled No PIE N/A N/A No Symbols N/A 0 0 out
ãªããå¤ãªã®ã§ã試ãã«ãupxã³ãã³ããå®è¡ãã¦ã¿ã¾ãããã¯ã解åã§ãã¾ããã
$ upx -d out
Ultimate Packer for eXecutables
Copyright (C) 1996 - 2024
UPX 4.2.2 Markus Oberhumer, Laszlo Molnar & John Reiser Jan 3rd 2024
File size Ratio Format Name
-------------------- ------ ----------- -----------
877724 <- 336520 38.34% linux/amd64 out
Unpacked 1 file.
ããä¸åº¦ã表層解æãè¡ãã¾ããæ®éã®è¦ãæ¹ã«ãªãã¾ãããRELRO ã Partial RELRO ã«å¤åãã¾ããã
$ file out
out: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, BuildID[sha1]=36bf0fdfd791fee2c1cc45dff9ddb2a4f48f6d53, for GNU/Linux 3.2.0, not stripped
$ checksec --file=out
RELRO STACK CANARY NX PIE RPATH RUNPATH Symbols FORTIFY Fortified Fortifiable FILE
Partial RELRO No canary found NX enabled No PIE N/A N/A 1879 Symbols N/A 0 22 out
å®è¡ã§ãããã©ããããã£ã¦ã¿ã¾ãããªãã»ã©ãæ£ãããã¹ã¯ã¼ããå
¥åããã°ãã©ã°ãå¾ãããã¨ãããã¨ã§ãããããã§ãããµã¼ãæ¥ç¶ãç¡ãã®ã§ãéã³ã³ãã¤ã«ããã¨åãã£ã¦ãã¾ãã®ã§ããããå¤ã§ãããã
$ ./out
Enter the password to unlock this file: AAA
You entered: AAA
Access denied
ç¶ãã¦ãéç解æã¨ãã¦ãGhidra ã§ã½ã¼ã¹ã³ã¼ããçºãã¦ã¿ã¾ããã¹ã¿ãã£ãã¯ãªã³ã¯ãªã®ã§ãµã¤ãºã大ããã§ãã
mainé¢æ°ã§ããã¨ããããmainé¢æ°ã ãã®ããã§ãã
0x66ï¼fï¼ãè¦ããã¨ããããï¼ï¼ã¨è¦ã¦ãã¾ãã¾ãããä»å㯠picoCTF ãªã®ã§ã以ä¸ã®æ°å¤ãæ°ã«ããå¿
è¦ãããã¾ãããç´æ¥ã®å¤ã¯ç¡ãããã§ãã
$ python -c 'print("picoCTF".encode("utf-8").hex())'
7069636f435446`
ã§ã¯ãæ®éã«è¦ã¦ããã¾ãã
æåã® foræãããã®ã¢ã»ã³ãã©ãè¦ã¦ããã§ãããéã³ã³ãã¤ã«ã«ãªãå
容ãçµæ§ããã¾ããæåã® divå½ä»¤ï¼div rsi
ï¼ã¯ãRDX:RAX / ESIï¼115 / 16ï¼
ã§ãåã RAXï¼7ããã¾ãã RDXï¼3 ã«ãªãã¾ãããä½ã«ä½¿ã£ã¦ãã®ãåããã¾ããã次ã®å½ä»¤ã®ä¹ç®ï¼imul rax, rax, 0x10
ï¼ã¯ã第2ãªãã©ã³ãã® RAX ã¨å®æ°ãä¹ç®ãã¦ãä¸ä½32bitã RDXãä¸ä½32bitã第1ãªãã©ã³ãã® RAX ã«æ ¼ç´ãã¾ãã
ã¨ãçé¢ç®ã«èªããã¨ãã¾ããããç²ãã¦ãã¦ãä¸ã®æ¹ãè¦ãã¨çããããã®ã«æ°ã¥ãã¾ããï¼ç¬ï¼ãPassword correct, please see flag: 7069636f4354467b5539585f556e5034636b314e365f42316e345269 33535f39343130343638327d
ã¨ãããã¤ã§ããéä¸ã«ã¹ãã¼ã¹ãããã®ã§æ³¨æãå¿
è¦ã§ãããããã ASCIIã³ã¼ã ã«ããã ãã§ãããå
¨ä½åãè¦ã¦ããåãæããå¿
è¦ãããã¾ããã
undefined8 main(void)
{
size_t sVar1;
char *pcVar2;
int iVar3;
undefined *puVar4;
long in_FS_OFFSET;
undefined auStack_a8 [8];
size_t local_a0;
undefined8 local_98;
char *local_90;
undefined8 local_88;
undefined8 local_80;
undefined8 local_78;
undefined8 local_70;
undefined8 local_68;
undefined8 local_60;
undefined8 local_58;
undefined8 local_50;
undefined8 local_48;
undefined8 local_40;
undefined8 local_38;
undefined8 local_30;
undefined4 local_28;
long local_20;
local_20 = *(long *)(in_FS_OFFSET + 0x28);
local_a0 = 100;
local_98 = 99;
for (puVar4 = auStack_a8; puVar4 != auStack_a8; puVar4 = puVar4 + -0x1000) {
*(undefined8 *)(puVar4 + -8) = *(undefined8 *)(puVar4 + -8);
}
*(undefined8 *)(puVar4 + -8) = *(undefined8 *)(puVar4 + -8);
local_88 = 0x6636333639363037;
local_80 = 0x6237363434353334;
local_78 = 0x6635383539333535;
local_70 = 0x3433303565363535;
local_68 = 0x6534313362363336;
local_60 = 0x3133323466353633;
local_58 = 0x3936323534336536;
local_50 = 0x3933663533353333;
local_48 = 0x3433303331333433;
local_40 = 0x6437323338333633;
local_38 = 0;
local_30 = 0;
local_28 = 0;
local_90 = puVar4 + -0x70;
*(undefined8 *)(puVar4 + -0x78) = 0x401eee;
printf("Enter the password to unlock this file: ");
pcVar2 = local_90;
sVar1 = local_a0;
*(undefined8 *)(puVar4 + -0x78) = 0x401f0f;
fgets(pcVar2,(int)sVar1,(FILE *)stdin);
pcVar2 = local_90;
*(undefined8 *)(puVar4 + -0x78) = 0x401f2a;
printf("You entered: %s\n",pcVar2);
pcVar2 = local_90;
sVar1 = local_a0;
*(undefined8 *)(puVar4 + -0x78) = 0x401f47;
iVar3 = strncmp(pcVar2,(char *)&local_88,sVar1);
if (iVar3 == 0) {
*(undefined8 *)(puVar4 + -0x78) = 0x401f57;
puts(
"Password correct, please see flag: 7069636f4354467b5539585f556e5034636b314e365f42316e345269 33535f39343130343638327d"
);
*(undefined8 *)(puVar4 + -0x78) = 0x401f63;
puts((char *)&local_88);
}
else {
*(undefined8 *)(puVar4 + -0x78) = 0x401f71;
puts("Access denied");
}
if (local_20 == *(long *)(in_FS_OFFSET + 0x28)) {
return 0;
}
__stack_chk_fail();
}
FactCheckï¼200ãã¤ã³ãï¼
å
ã»ã©ã¨åã Medium ã®åé¡ã§ãããå
ã»ã©ã¯ 100ãã¤ã³ãã§ã200ãã¤ã³ãã§ãããã¤ããªãã¡ã¤ã«ï¼binï¼ã 1ã¤ãã¦ã³ãã¼ãã§ãã¾ããä½ãä¸é½åããã£ã¦ããã¤ããªã¨ãã©ã°ãå¤æ´ãããããã§ãããæ°ãããã¤ããªã§ãåé¡ãªã解決ã§ããã¨ãããã¨ãªã®ã§é²ãã¦ããã¾ãã
FactCheckåé¡
表層解æãè¡ãã¾ããä½ã¨ãªã strings ãå®è¡ãã¦ã¿ã¾ãããããã©ã°ãå°ãè¦ãã¦ãã¾ãããã¤ããªã¨ãã£ã¿ã§è¦ã¦ã¿ã¾ãããã¼ããã¢ã³ãã¼ã¹ã³ã¢ã®å¾ã¯ 0ï¼NULLæåï¼ãªã®ã§ãéä¸ã¾ã§ãããªãããã§ãã
$ file bin
bin: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=9bb8d1ca536f0b458a00221fc6bada49da9e9e3b, for GNU/Linux 3.2.0, not stripped
$ checksec --file=bin
RELRO STACK CANARY NX PIE RPATH RUNPATH Symbols FORTIFY Fortified Fortifiable FILE
Full RELRO Canary found NX enabled PIE enabled No RPATH No RUNPATH 83 Symbols N/A 0 0 bin
$ strings bin | grep pico
picoCTF{wELF_d0N3_mate_
Ghidra ã§è¦ã¦ã¿ã¾ããC++ ã£ã½ãã§ããé·ã mainé¢æ°ã ãã§ãããããã«èªãæ°ã«ãªããªãã®ã§ãGDB ã§åããã¾ããæå¾ã®æ¹ã«ãã¬ã¼ã¯ãã¤ã³ããè¨å®ãã¦ãã£ã¦ã¿ãã¨ãã¾ãããã¾ãããã
ä»æ¹ãªãã®ã§ãni ã§ããããé²ãã¾ããéä¸ã¾ã§ã¯ãã¹ã¿ãã¯ä¸ã«ãã©ã°ãå°ããã¤åºæ¥ä¸ãã£ã¦ããæãã§ããããæå¾ã®æ¹ã§ãçªç¶ãã¹ã¿ãã¯ä¸ã«è¦ãã¦ãããã©ã°ãè¦ããªããªãã¾ãããGDB ãªã®ã§ç»é¢ãã¹ã¯ãã¼ã«ãã¦ãè¦ããªããªãç´åã®ãã©ã°ãæåºããã¨ã¯ãªã¢ã§ããã
undefined8 main(void)
{
char cVar1;
char *pcVar2;
long in_FS_OFFSET;
allocator<char> local_249;
basic_string<> local_248 [32];
basic_string local_228 [32];
basic_string<> local_208 [32];
basic_string local_1e8 [32];
basic_string local_1c8 [32];
basic_string local_1a8 [32];
basic_string local_188 [32];
basic_string local_168 [32];
basic_string<> local_148 [32];
basic_string local_128 [32];
basic_string<> local_108 [32];
basic_string<> local_e8 [32];
basic_string local_c8 [32];
basic_string<> local_a8 [32];
basic_string local_88 [32];
basic_string local_68 [32];
basic_string<> local_48 [40];
long local_20;
local_20 = *(long *)(in_FS_OFFSET + 0x28);
std::allocator<char>::allocator();
std::__cxx11::basic_string<>::basic_string
((char *)local_248,(allocator *)"picoCTF{wELF_d0N3_mate_");
std::allocator<char>::~allocator(&local_249);
std::allocator<char>::allocator();
std::__cxx11::basic_string<>::basic_string((char *)local_228,(allocator *)&DAT_0010201d);
std::allocator<char>::~allocator(&local_249);
std::allocator<char>::allocator();
std::__cxx11::basic_string<>::basic_string((char *)local_208,(allocator *)&DAT_0010201f);
std::allocator<char>::~allocator(&local_249);
std::allocator<char>::allocator();
std::__cxx11::basic_string<>::basic_string((char *)local_1e8,(allocator *)&DAT_00102021);
std::allocator<char>::~allocator(&local_249);
std::allocator<char>::allocator();
std::__cxx11::basic_string<>::basic_string((char *)local_1c8,(allocator *)&DAT_00102023);
std::allocator<char>::~allocator(&local_249);
std::allocator<char>::allocator();
std::__cxx11::basic_string<>::basic_string((char *)local_1a8,(allocator *)&DAT_00102025);
std::allocator<char>::~allocator(&local_249);
std::allocator<char>::allocator();
std::__cxx11::basic_string<>::basic_string((char *)local_188,(allocator *)&DAT_00102027);
std::allocator<char>::~allocator(&local_249);
std::allocator<char>::allocator();
std::__cxx11::basic_string<>::basic_string((char *)local_168,(allocator *)&DAT_00102029);
std::allocator<char>::~allocator(&local_249);
std::allocator<char>::allocator();
std::__cxx11::basic_string<>::basic_string((char *)local_148,(allocator *)&DAT_0010202b);
std::allocator<char>::~allocator(&local_249);
std::allocator<char>::allocator();
std::__cxx11::basic_string<>::basic_string((char *)local_128,(allocator *)&DAT_00102029);
std::allocator<char>::~allocator(&local_249);
std::allocator<char>::allocator();
std::__cxx11::basic_string<>::basic_string((char *)local_108,(allocator *)&DAT_0010202d);
std::allocator<char>::~allocator(&local_249);
std::allocator<char>::allocator();
std::__cxx11::basic_string<>::basic_string((char *)local_e8,(allocator *)&DAT_0010202f);
std::allocator<char>::~allocator(&local_249);
std::allocator<char>::allocator();
std::__cxx11::basic_string<>::basic_string((char *)local_c8,(allocator *)&DAT_00102031);
std::allocator<char>::~allocator(&local_249);
std::allocator<char>::allocator();
std::__cxx11::basic_string<>::basic_string((char *)local_a8,(allocator *)&DAT_00102033);
std::allocator<char>::~allocator(&local_249);
std::allocator<char>::allocator();
std::__cxx11::basic_string<>::basic_string((char *)local_88,(allocator *)&DAT_00102027);
std::allocator<char>::~allocator(&local_249);
std::allocator<char>::allocator();
std::__cxx11::basic_string<>::basic_string((char *)local_68,(allocator *)&DAT_00102023);
std::allocator<char>::~allocator(&local_249);
std::allocator<char>::allocator();
std::__cxx11::basic_string<>::basic_string((char *)local_48,(allocator *)&DAT_00102035);
std::allocator<char>::~allocator(&local_249);
pcVar2 = (char *)std::__cxx11::basic_string<>::operator[]((ulong)local_208);
if (*pcVar2 < 'B') {
std::__cxx11::basic_string<>::operator+=(local_248,local_c8);
}
pcVar2 = (char *)std::__cxx11::basic_string<>::operator[]((ulong)local_a8);
if (*pcVar2 != 'A') {
std::__cxx11::basic_string<>::operator+=(local_248,local_68);
}
pcVar2 = (char *)std::__cxx11::basic_string<>::operator[]((ulong)local_1c8);
cVar1 = *pcVar2;
pcVar2 = (char *)std::__cxx11::basic_string<>::operator[]((ulong)local_148);
if ((int)cVar1 - (int)*pcVar2 == 3) {
std::__cxx11::basic_string<>::operator+=(local_248,local_1c8);
}
std::__cxx11::basic_string<>::operator+=(local_248,local_1e8);
std::__cxx11::basic_string<>::operator+=(local_248,local_188);
pcVar2 = (char *)std::__cxx11::basic_string<>::operator[]((ulong)local_168);
if (*pcVar2 == 'G') {
std::__cxx11::basic_string<>::operator+=(local_248,local_168);
}
std::__cxx11::basic_string<>::operator+=(local_248,local_1a8);
std::__cxx11::basic_string<>::operator+=(local_248,local_88);
std::__cxx11::basic_string<>::operator+=(local_248,local_228);
std::__cxx11::basic_string<>::operator+=(local_248,local_128);
std::__cxx11::basic_string<>::operator+=(local_248,'}');
std::__cxx11::basic_string<>::~basic_string(local_48);
std::__cxx11::basic_string<>::~basic_string((basic_string<> *)local_68);
std::__cxx11::basic_string<>::~basic_string((basic_string<> *)local_88);
std::__cxx11::basic_string<>::~basic_string(local_a8);
std::__cxx11::basic_string<>::~basic_string((basic_string<> *)local_c8);
std::__cxx11::basic_string<>::~basic_string(local_e8);
std::__cxx11::basic_string<>::~basic_string(local_108);
std::__cxx11::basic_string<>::~basic_string((basic_string<> *)local_128);
std::__cxx11::basic_string<>::~basic_string(local_148);
std::__cxx11::basic_string<>::~basic_string((basic_string<> *)local_168);
std::__cxx11::basic_string<>::~basic_string((basic_string<> *)local_188);
std::__cxx11::basic_string<>::~basic_string((basic_string<> *)local_1a8);
std::__cxx11::basic_string<>::~basic_string((basic_string<> *)local_1c8);
std::__cxx11::basic_string<>::~basic_string((basic_string<> *)local_1e8);
std::__cxx11::basic_string<>::~basic_string(local_208);
std::__cxx11::basic_string<>::~basic_string((basic_string<> *)local_228);
std::__cxx11::basic_string<>::~basic_string(local_248);
if (local_20 == *(long *)(in_FS_OFFSET + 0x28)) {
return 0;
}
__stack_chk_fail();
}
WinAntiDbg0x100ï¼200ãã¤ã³ãï¼
Medium ã® 200ãã¤ã³ãã®åé¡ã§ãããã¤ããªãã¡ã¤ã«ï¼WinAntiDbg0x100.zipï¼ã 1ã¤ãã¦ã³ãã¼ãã§ãã¾ãããã¹ã¯ã¼ãä»ãã® ZIPãã¡ã¤ã«ã§ããã¹ã¯ã¼ããå
¥åããã¨è§£åã§ãã¾ããWindows ã® CUIããã°ã©ã ã®ããã§ããconfig.bin ã¨ãããã¡ã¤ã«ãå«ã¾ãã¦ãã¾ããã
WinAntiDbg0x100åé¡
表層解æãè¡ãã¾ããWindowsããã°ã©ã ã§ããã
$ file WinAntiDbg0x100.exe
WinAntiDbg0x100.exe: PE32 executable (console) Intel 80386, for MS Windows, 5 sections
$ checksec --file=WinAntiDbg0x100.exe
Error: Not an ELF file: WinAntiDbg0x100.exe: PE32 executable (console) Intel 80386, for MS Windows, 5 sections
$ strings WinAntiDbg0x100.exe | grep pico
ã¨ãããããå®è¡ãã¦ã¿ã¾ããã¾ãæåã«ãããã¬ãèµ·åããå¿
è¦ãããã¨è¨ã£ã¦ãã§ããããã
$ ./WinAntiDbg0x100.exe
_ _____ _______ ______
(_) / ____|__ __| ____|
_ __ _ ___ ___ | | | | | |__
| '_ \| |/ __/ _ \| | | | | __|
| |_) | | (_| (_) | |____ | | | |
| .__/|_|\___\___/ \_____| |_| |_|
| |
|_|
Welcome to the Anti-Debug challenge!
### To start the challenge, you'll need to first launch this program using a debugger!
Windowsããã°ã©ã ã¯å
¨ç¶åãããªãã®ã§ãå¾åãã«ãã¾ãã
Classic Crackme 0x100ï¼300ãã¤ã³ãï¼
Medium ã®åé¡ã§ããæ´æ°ããããã¤ããªãã¡ã¤ã«ï¼crackme100ï¼ã 1ã¤ãã¦ã³ãã¼ãã§ãã¾ããã¾ããæå¾ã¯ãµã¼ããèµ·åãã¦å®è¡ããå¿
è¦ãããããã§ãã
Classic Crackme 0x100åé¡
表層解æãè¡ãã¾ããstringsã³ãã³ãã§ãã©ã°ãè¦ãã¦ã¾ããããã¼ã«ã«ãã¡ã¤ã«ç¨ã®ãã©ã°ã¨ãããã¨ã§ããããã
$ file crackme100
crackme100: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=f680c44f890f619e9d88949f9048709d008b18f1, for GNU/Linux 3.2.0, with debug_info, not stripped
$ checksec --file=crackme100
RELRO STACK CANARY NX PIE RPATH RUNPATH Symbols FORTIFY Fortified Fortifiable FILE
Partial RELRO No canary found NX enabled No PIE No RPATH No RUNPATH 40 Symbols No 0 1 crackme100
$ strings crackme100 | grep pico
picoCTF{sample_flag}
ã¾ããå®è¡ãã¦ã¿ã¾ããæ£ãããã¹ã¯ã¼ããå
¥åããå¿
è¦ãããããã§ãã
$ ./crackme100
Enter the secret password: aaa
FAILED!
Ghidra ã使ã£ã¦ãã½ã¼ã¹ãè¦ã¦ããã¾ãããªããæ£çµ±æ´¾ãªåé¡ã£ã¦æãã§ãã
äºéã«ã¼ãã®ã¨ãããèªã¿è§£ãã¦ã¿ã¾ããå¤å´ã¯ 3åãå
å´ã¯ é
åå¤æ°ã® output ã®æåæ°ãªã®ã§ 50åå®è¡ããããã§ãã
æ¤è¨ãé·ããªããããªã®ã§ãã½ã¼ã¹ã³ã¼ãã®ä¸ã«æ¸ãã¦ããã¾ãã
int main(void)
{
uint uVar1;
int iVar2;
size_t sVar3;
char input [51];
char output [51];
int random2;
int random1;
char fix;
int secret3;
int secret2;
int secret1;
int len;
int i_1;
int i;
output[0] = 'k';
output[1] = 'g';
output[2] = 'x';
output[3] = 'm';
output[4] = 'w';
output[5] = 'p';
output[6] = 'b';
output[7] = 'p';
output[8] = 'u';
output[9] = 'q';
output[10] = 't';
output[0xb] = 'o';
output[0xc] = 'r';
output[0xd] = 'z';
output[0xe] = 'a';
output[0xf] = 'p';
output[0x10] = 'j';
output[0x11] = 'h';
output[0x12] = 'f';
output[0x13] = 'm';
output[0x14] = 'e';
output[0x15] = 'b';
output[0x16] = 'm';
output[0x17] = 'c';
output[0x18] = 'c';
output[0x19] = 'v';
output[0x1a] = 'w';
output[0x1b] = 'y';
output[0x1c] = 'c';
output[0x1d] = 'y';
output[0x1e] = 'v';
output[0x1f] = 'e';
output[0x20] = 'w';
output[0x21] = 'p';
output[0x22] = 'x';
output[0x23] = 'i';
output[0x24] = 'h';
output[0x25] = 'e';
output[0x26] = 'i';
output[0x27] = 'f';
output[0x28] = 'v';
output[0x29] = 'n';
output[0x2a] = 'u';
output[0x2b] = 'q';
output[0x2c] = 's';
output[0x2d] = 'r';
output[0x2e] = 'g';
output[0x2f] = 'e';
output[0x30] = 'x';
output[0x31] = 'l';
output[0x32] = '\0';
setvbuf(stdout,(char *)0x0,2,0);
printf("Enter the secret password: ");
__isoc99_scanf(&DAT_00402024,input);
i = 0;
sVar3 = strlen(output);
for (; i < 3; i = i + 1) {
for (i_1 = 0; i_1 < (int)sVar3; i_1 = i_1 + 1) {
uVar1 = (i_1 % 0xff >> 1 & 0x55U) + (i_1 % 0xff & 0x55U);
uVar1 = ((int)uVar1 >> 2 & 0x33U) + (uVar1 & 0x33);
iVar2 = ((int)uVar1 >> 4) + input[i_1] + -0x61 + (uVar1 & 0xf);
input[i_1] = (char)iVar2 + (char)(iVar2 / 0x1a) * -0x1a + 'a';
}
}
iVar2 = memcmp(input,output,(long)(int)sVar3);
if (iVar2 == 0) {
printf("SUCCESS! Here is your flag: %s\n","picoCTF{sample_flag}");
}
else {
puts("FAILED!");
}
return 0;
}
ã«ã¼ãã®å
å´ã® 4è¡ã詳ããè¦ã¾ãã
1è¡ç®ã¯ãæ¼ç®åã®åªå
é ä½ãæ£ããè¦ãå¿
è¦ãããã®ã§æ¬å¼§ãä»ãã¾ããã¾ããi_1
㯠0 ãã 49 ãã¨ãã®ã§ã% 0xff
ã¯ç¡è¦ã§ãã¾ãã
uVar1 = (((i_1 % 0xff) >> 1) & 0x55U) + ((i_1 % 0xff) & 0x55U);
ãã£ã¦ã以ä¸ã®ããã«ç°¡åã«ã§ãã¾ãã
uVar1 = ((i_1 >> 1) & 0x55U) + (i_1 & 0x55U);
ãã¼ãããã®ããæ¹ã¯ç¡è¬ã§ãããããã¾ãã
4è¡ã®ãã¡ãinput 以å¤ã¯å¤ã決ã¾ã£ã¦ãããã¨ã¨ãi 㯠4è¡ã«åºã¦ããªããã¨ããã input ã®è¨ç®ã«ãä»ã® input ãé¢ä¿ããªããã¨ãåããã¾ããã¤ã¾ãããã input ã®å ´åã«ããã® 4è¡ã 3åé£ç¶ã§ãã£ãçµæã¨åãã§ããããã°ã©ã 㧠ASCIIã³ã¼ããç·å½ããã§è¨ç®ããã®ãããããããã¾ãããè±å°æåã ãã§ããããã§ããã
Pythonã¹ã¯ãªãããå®è£
ãã¾ãã
Cè¨èªãããPython ã«å¤æããã ãã§ããããããå®è¡ããã¨ãæ£ãããã¹ã¯ã¼ãã表示ããã¾ãããµã¼ãã§åããã¹ã¯ã¼ããå
¥åããã¨ããã©ã°ã表示ããã¾ããã
import os, sys
output = "kgxmwpbpuqtorzapjhfmebmccvwycyvewpxiheifvnuqsrgexl"
ret = []
for i_1, out in enumerate(output):
tmps = [ aa for aa in range(0x21, 0x7f) ]
flag = False
for tmp in tmps:
input = tmp
for ii in range(3):
uVar1 = ((((i_1 % 0xff) >> 1)) & 0x55) + ((i_1 % 0xff) & 0x55)
uVar1 = ((uVar1 >> 2) & 0x33) + (uVar1 & 0x33)
iVar2 = (uVar1 >> 4) + input - 0x61 + (uVar1 & 0xf)
input = (iVar2 & 0xff) - ((iVar2 // 0x1a) & 0xff) * (0x1a) + 0x61
if input == ord( out ):
ret.append( chr(tmp) )
flag = True
break
assert flag, f"fail, ret={ret}"
print( f"ret={''.join(ret)}" )
ãã£ã¦ã¿ã¾ãã
$ python crackme100.py
ret=kdugtjvgrknflqrdgb`d_sdqwmnmtmjptjr`bv`tpelejfuprc
$ ./crackme100
Enter the secret password: kdugtjvgrknflqrdgb`d_sdqwmnmtmjptjr`bv`tpelejfuprc
SUCCESS! Here is your flag: picoCTF{sample_flag}
ãµã¼ãã«å¯¾ãã¦å®æ½ããã¨ãã©ã°ã表示ããã¾ãã
weirdSnakeï¼300ãã¤ã³ãï¼
Medium ã®åé¡ã§ããæ´æ°ããããã¤ããªãã¡ã¤ã«ï¼snakeï¼ã 1ã¤ãã¦ã³ãã¼ãã§ãã¾ãã
weirdSnakeåé¡
表層解æãè¡ãã¾ããããã¹ããã¡ã¤ã«ã§ããã
$ file snake
snake: ASCII text
ã¨ãã£ã¿ã§éãã¦ã¿ã¾ããããã¼ãããªãã§ãããããç¹å¾´çãªååï¼UNPACK_SEQUENCEï¼ã§ãWebæ¤ç´¢ãã¦ã¿ãã¨ãããPython ã®å
¬å¼ãµã¤ããããããã¾ãããPython ã®ãã¤ãã³ã¼ãã®éã¢ã»ã³ãã©ãããã§ãããã®ã¢ã»ã³ãã©ãã Pythonã¹ã¯ãªãããæ§ç¯ããæãã§ãããããé çªã«è¦ã¦ããã¾ãã
解æãé·ããªããããªã®ã§ãã½ã¼ã¹ã³ã¼ãã®ä¸ã«æ¸ãã¦ããã¾ãã
1 0 LOAD_CONST 0 (4)
2 LOAD_CONST 1 (54)
4 LOAD_CONST 2 (41)
6 LOAD_CONST 3 (0)
8 LOAD_CONST 4 (112)
10 LOAD_CONST 5 (32)
12 LOAD_CONST 6 (25)
14 LOAD_CONST 7 (49)
16 LOAD_CONST 8 (33)
18 LOAD_CONST 9 (3)
20 LOAD_CONST 3 (0)
22 LOAD_CONST 3 (0)
24 LOAD_CONST 10 (57)
26 LOAD_CONST 5 (32)
28 LOAD_CONST 11 (108)
30 LOAD_CONST 12 (23)
32 LOAD_CONST 13 (48)
34 LOAD_CONST 0 (4)
36 LOAD_CONST 14 (9)
38 LOAD_CONST 15 (70)
40 LOAD_CONST 16 (7)
42 LOAD_CONST 17 (110)
44 LOAD_CONST 18 (36)
46 LOAD_CONST 19 (8)
48 LOAD_CONST 11 (108)
50 LOAD_CONST 16 (7)
52 LOAD_CONST 7 (49)
54 LOAD_CONST 20 (10)
56 LOAD_CONST 0 (4)
58 LOAD_CONST 21 (86)
60 LOAD_CONST 22 (43)
62 LOAD_CONST 17 (110)
64 LOAD_CONST 22 (43)
66 LOAD_CONST 23 (88)
68 LOAD_CONST 3 (0)
70 LOAD_CONST 24 (67)
72 LOAD_CONST 25 (104)
74 LOAD_CONST 26 (125)
76 LOAD_CONST 14 (9)
78 LOAD_CONST 27 (78)
80 BUILD_LIST 40
82 STORE_NAME 0 (input_list)
2 84 LOAD_CONST 28 ('J')
86 STORE_NAME 1 (key_str)
3 88 LOAD_CONST 29 ('_')
90 LOAD_NAME 1 (key_str)
92 BINARY_ADD
94 STORE_NAME 1 (key_str)
4 96 LOAD_NAME 1 (key_str)
98 LOAD_CONST 30 ('o')
100 BINARY_ADD
102 STORE_NAME 1 (key_str)
5 104 LOAD_NAME 1 (key_str)
106 LOAD_CONST 31 ('3')
108 BINARY_ADD
110 STORE_NAME 1 (key_str)
6 112 LOAD_CONST 32 ('t')
114 LOAD_NAME 1 (key_str)
116 BINARY_ADD
118 STORE_NAME 1 (key_str)
9 120 LOAD_CONST 33 (<code object <listcomp> at 0x7ffb38066d40, file "snake.py", line 9>)
122 LOAD_CONST 34 ('<listcomp>')
124 MAKE_FUNCTION 0
126 LOAD_NAME 1 (key_str)
128 GET_ITER
130 CALL_FUNCTION 1
132 STORE_NAME 2 (key_list)
11 >> 134 LOAD_NAME 3 (len)
136 LOAD_NAME 2 (key_list)
138 CALL_FUNCTION 1
140 LOAD_NAME 3 (len)
142 LOAD_NAME 0 (input_list)
144 CALL_FUNCTION 1
146 COMPARE_OP 0 (<)
148 POP_JUMP_IF_FALSE 162
12 150 LOAD_NAME 2 (key_list)
152 LOAD_METHOD 4 (extend)
154 LOAD_NAME 2 (key_list)
156 CALL_METHOD 1
158 POP_TOP
160 JUMP_ABSOLUTE 134
15 >> 162 LOAD_CONST 35 (<code object <listcomp> at 0x7ffb38066df0, file "snake.py", line 15>)
164 LOAD_CONST 34 ('<listcomp>')
166 MAKE_FUNCTION 0
168 LOAD_NAME 5 (zip)
170 LOAD_NAME 0 (input_list)
172 LOAD_NAME 2 (key_list)
174 CALL_FUNCTION 2
176 GET_ITER
178 CALL_FUNCTION 1
180 STORE_NAME 6 (result)
18 182 LOAD_CONST 36 ('')
184 LOAD_METHOD 7 (join)
186 LOAD_NAME 8 (map)
188 LOAD_NAME 9 (chr)
190 LOAD_NAME 6 (result)
192 CALL_FUNCTION 2
194 CALL_METHOD 1
196 STORE_NAME 10 (result_text)
198 LOAD_CONST 37 (None)
200 RETURN_VALUE
Disassembly of <code object <listcomp> at 0x7ffb38066d40, file "snake.py", line 9>:
9 0 BUILD_LIST 0
2 LOAD_FAST 0 (.0)
>> 4 FOR_ITER 12 (to 18)
6 STORE_FAST 1 (char)
8 LOAD_GLOBAL 0 (ord)
10 LOAD_FAST 1 (char)
12 CALL_FUNCTION 1
14 LIST_APPEND 2
16 JUMP_ABSOLUTE 4
>> 18 RETURN_VALUE
Disassembly of <code object <listcomp> at 0x7ffb38066df0, file "snake.py", line 15>:
15 0 BUILD_LIST 0
2 LOAD_FAST 0 (.0)
>> 4 FOR_ITER 16 (to 22)
6 UNPACK_SEQUENCE 2
8 STORE_FAST 1 (a)
10 STORE_FAST 2 (b)
12 LOAD_FAST 1 (a)
14 LOAD_FAST 2 (b)
16 BINARY_XOR
18 LIST_APPEND 2
20 JUMP_ABSOLUTE 4
>> 22 RETURN_VALUE
1è¡ç®ï¼å·¦ç«¯ã®åã®çªå·ã Pythonã¹ã¯ãªããã®è¡çªå·ï¼ã¯ã40åã®è¦ç´ ãæã¤ãinput_list ã¨ããååã®ãªã¹ããä½ã£ã¦ããããã§ããæ¬å¼§å
ãå¤ã§ãã
2è¡ç®ãã 6è¡ç®ã¾ã§ã¯ãããããã»ããã§èããæ¹ãããããã§ãã以ä¸ã§ããããã
key_str = 'J'
key_str += '_'
key_str += 'o'
key_str += '3'
key_str += 't'
試ãã«ããªã¹ãã®ä½æã¨ãä¸ã®ã³ã¼ãã®éã¢ã»ã³ãã©ãæ±ãã¦ã¿ã¾ãã以ä¸ã®ããã«ãªãã¾ããããã¼ããè¿ããã©ãã¡ãã£ã¨éãã¾ãããã¾ããã§ãããã§ä»®æ±ºããã¾ãã
$ python -m dis hello_world.py
0 0 RESUME 0
3 2 BUILD_LIST 0
4 LOAD_CONST 0 ((4, 54, 41, 0, 112, 32, 25, 49, 33, 3, 0, 0, 57, 32, 108, 23, 48, 4, 9, 70, 7, 110, 36, 8, 108, 7, 49, 10, 4, 86, 43, 110, 43, 88, 0, 67, 104, 125, 9, 78))
6 LIST_EXTEND 1
8 STORE_NAME 0 (input_list)
5 10 LOAD_CONST 1 ('J')
12 STORE_NAME 1 (key_str)
6 14 LOAD_NAME 1 (key_str)
16 LOAD_CONST 2 ('_')
18 BINARY_OP 13 (+=)
22 STORE_NAME 1 (key_str)
7 24 LOAD_NAME 1 (key_str)
26 LOAD_CONST 3 ('o')
28 BINARY_OP 13 (+=)
32 STORE_NAME 1 (key_str)
8 34 LOAD_NAME 1 (key_str)
36 LOAD_CONST 4 ('3')
38 BINARY_OP 13 (+=)
42 STORE_NAME 1 (key_str)
9 44 LOAD_NAME 1 (key_str)
46 LOAD_CONST 5 ('t')
48 BINARY_OP 13 (+=)
52 STORE_NAME 1 (key_str)
54 LOAD_CONST 6 (None)
56 RETURN_VALUE
9è¡ç®ã¯é¢æ°ã®çæã§é¢æ°ã®å®ä½ã¯ãä¸ã®æ¹ã«ãã Disassembly ããå§ã¾ãã¨ããã ã¨æãã¾ããåããã15è¡ç®ãé¢æ°ã®çæã ã¨æãã¾ãã
é¢æ°ã¨ãããããªã¹ãå
å
表è¨ã§ãããããçµæã key_list ã«å
¥ããå¼æ°ã key_str ã§ããé¢æ°ã®å®ä½ãè¸ã¾ããã¨ãkey_list = [ord(char) for char in key_str]
ã®ããã«ãªãããã§ãã
11è¡ç®ã¯ãif len(key_list) < len(input_list):
ã ã¨æãã¾ãã
12è¡ç®ã¯ãkey_list.extend(key_list)
ã§ããããï¼
15è¡ç®ããªã¹ãå
å
表è¨ã¨èããã¨ãçµæã result ã«å
¥ããzip(input_list, key_list) ã®å½¢ã§ãé¢æ°ã®å®ä½ãè¸ã¾ããã¨ãresult = [a ^ b for a, b in zip(input_list, key_list)]
æå¾ã® 18è¡ç®ã¯ãçµæã result_text ã«å
¥ããjoiné¢æ°ã使ã£ã¦ãresult_text = ''.join(map(chr, result))
ã§ããããã
以ä¸ã®ããã«ãªãã¾ããã
input_list = [4, 54, 41, 0, 112, 32, 25, 49, 33, 3, 0, 0, 57, 32, 108, 23, 48, 4, 9, 70, 7, 110, 36, 8, 108, 7, 49, 10, 4, 86, 43, 110, 43, 88, 0, 67, 104, 125, 9, 78]
key_str = 'J'
key_str += '_'
key_str += 'o'
key_str += '3'
key_str += 't'
key_list = [ord(char) for char in key_str]
if len(key_list) < len(input_list):
key_list.extend(key_list)
result = [a ^ b for a, b in zip(input_list, key_list)]
result_text = ''.join(map(chr, result))
print(result_text)
ãããéã¢ã»ã³ãã«ãã¾ãã
$ python -m dis hello_world.py
0 0 RESUME 0
1 2 BUILD_LIST 0
4 LOAD_CONST 0 ((4, 54, 41, 0, 112, 32, 25, 49, 33, 3, 0, 0, 57, 32, 108, 23, 48, 4, 9, 70, 7, 110, 36, 8, 108, 7, 49, 10, 4, 86, 43, 110, 43, 88, 0, 67, 104, 125, 9, 78))
6 LIST_EXTEND 1
8 STORE_NAME 0 (input_list)
2 10 LOAD_CONST 1 ('J')
12 STORE_NAME 1 (key_str)
3 14 LOAD_NAME 1 (key_str)
16 LOAD_CONST 2 ('_')
18 BINARY_OP 13 (+=)
22 STORE_NAME 1 (key_str)
4 24 LOAD_NAME 1 (key_str)
26 LOAD_CONST 3 ('o')
28 BINARY_OP 13 (+=)
32 STORE_NAME 1 (key_str)
5 34 LOAD_NAME 1 (key_str)
36 LOAD_CONST 4 ('3')
38 BINARY_OP 13 (+=)
42 STORE_NAME 1 (key_str)
6 44 LOAD_NAME 1 (key_str)
46 LOAD_CONST 5 ('t')
48 BINARY_OP 13 (+=)
52 STORE_NAME 1 (key_str)
9 54 LOAD_CONST 6 (<code object <listcomp> at 0x7fba221673c0, file "hello_world.py", line 9>)
56 MAKE_FUNCTION 0
58 LOAD_NAME 1 (key_str)
60 GET_ITER
62 PRECALL 0
66 CALL 0
76 STORE_NAME 2 (key_list)
11 78 PUSH_NULL
80 LOAD_NAME 3 (len)
82 LOAD_NAME 2 (key_list)
84 PRECALL 1
88 CALL 1
98 PUSH_NULL
100 LOAD_NAME 3 (len)
102 LOAD_NAME 0 (input_list)
104 PRECALL 1
108 CALL 1
118 COMPARE_OP 0 (<)
124 POP_JUMP_FORWARD_IF_FALSE 21 (to 168)
12 126 LOAD_NAME 2 (key_list)
128 LOAD_METHOD 4 (extend)
150 LOAD_NAME 2 (key_list)
152 PRECALL 1
156 CALL 1
166 POP_TOP
15 >> 168 LOAD_CONST 7 (<code object <listcomp> at 0x7fba22177130, file "hello_world.py", line 15>)
170 MAKE_FUNCTION 0
172 PUSH_NULL
174 LOAD_NAME 5 (zip)
176 LOAD_NAME 0 (input_list)
178 LOAD_NAME 2 (key_list)
180 PRECALL 2
184 CALL 2
194 GET_ITER
196 PRECALL 0
200 CALL 0
210 STORE_NAME 6 (result)
18 212 LOAD_CONST 8 ('')
214 LOAD_METHOD 7 (join)
236 PUSH_NULL
238 LOAD_NAME 8 (map)
240 LOAD_NAME 9 (chr)
242 LOAD_NAME 6 (result)
244 PRECALL 2
248 CALL 2
258 PRECALL 1
262 CALL 1
272 STORE_NAME 10 (result_text)
20 274 PUSH_NULL
276 LOAD_NAME 11 (print)
278 LOAD_NAME 10 (result_text)
280 PRECALL 1
284 CALL 1
294 POP_TOP
296 LOAD_CONST 9 (None)
298 RETURN_VALUE
Disassembly of <code object <listcomp> at 0x7fba221673c0, file "hello_world.py", line 9>:
9 0 RESUME 0
2 BUILD_LIST 0
4 LOAD_FAST 0 (.0)
>> 6 FOR_ITER 17 (to 42)
8 STORE_FAST 1 (char)
10 LOAD_GLOBAL 1 (NULL + ord)
22 LOAD_FAST 1 (char)
24 PRECALL 1
28 CALL 1
38 LIST_APPEND 2
40 JUMP_BACKWARD 18 (to 6)
>> 42 RETURN_VALUE
Disassembly of <code object <listcomp> at 0x7fba22177130, file "hello_world.py", line 15>:
15 0 RESUME 0
2 BUILD_LIST 0
4 LOAD_FAST 0 (.0)
>> 6 FOR_ITER 10 (to 28)
8 UNPACK_SEQUENCE 2
12 STORE_FAST 1 (a)
14 STORE_FAST 2 (b)
16 LOAD_FAST 1 (a)
18 LOAD_FAST 2 (b)
20 BINARY_OP 12 (^)
24 LIST_APPEND 2
26 JUMP_BACKWARD 11 (to 6)
>> 28 RETURN_VALUE
ãã¼ããif ã®ã¨ãããããããã§ããwhile ã«å¤ãã¦ã¿ãã¨ãããæãã«ãªã£ã¦ãã¾ããã
å®è¡ãã¦ã¿ã¾ããæããæãã§ããç´°ããã¨ããã§ééãã¦ããã§ãã
$ python hello_world.py
NiF3jF^wJ_V]ok:2M1K;Mne7"a1Dkt 7::
éç®ã§ããã¾ããp
ï¼0x70ï¼ã«ãªãããã«ã4 㨠J
ï¼0x4Aï¼ã使ã£ã¦ãã¾ãããçµæ㯠N
ï¼0x4Eï¼ã«ãªã£ã¦ãã¾ãã4 ã¯ããããæ£ããã¦ãJ
ã¯æªããã§ãã4 ã¨ä½ãã® XOR ã 0x70 ã«ãªãã«ã¯ã0x74ï¼t
ï¼ãå¿
è¦ã§ããkey_str ã®æå¾ã t
ã§ããkey_str ã®ä½ãæ¹ãééã£ã¦ãããã§ãã
key_str ã以ä¸ã«ä¿®æ£ãã¾ãããããã ã¨ãå
é ã« t
ããã¾ãã
key_str = 'J'
key_str = '_' + key_str
key_str = 'o' + key_str
key_str = '3' + key_str
key_str = 't' + key_str
å®è¡ãã¾ããp
ã ãåã£ã¦ã¾ãï¼ç¬ï¼ã
$ python hello_world.py
pF_:T*^~It3V&ckV
s]KW&se[_]DJ7[V
key_str ã®ã¨ããã¯ãä»ã¯ãBAINARY_OP (+)
ã¨ãªã£ã¦ã¾ãããåé¡æã§ã¯ãBAINARY_ADD
ãªãã§ãããããããéãããã§ãããããJ
㨠_
㨠t
ã¯ãå·¦ãªãã©ã³ãã§ããão
㨠3
ã¯å³ãªãã©ã³ãã«ãªã£ã¦ã¾ãï¼
ãããä¿®æ£ããã¨ããããã©ã°ã²ããã§ãï¼300ãã¤ã³ããªã®ã«ã ãã¶è¦å´ãã¾ããã
Pythonã¹ã¯ãªããã®æçµçã§ãã
input_list = [4, 54, 41, 0, 112, 32, 25, 49, 33, 3, 0, 0, 57, 32, 108, 23, 48, 4, 9, 70, 7, 110, 36, 8, 108, 7, 49, 10, 4, 86, 43, 110, 43, 88, 0, 67, 104, 125, 9, 78]
key_str = 'J'
key_str = '_' + key_str
key_str = key_str + 'o'
key_str = key_str + '3'
key_str = 't' + key_str
key_list = [ord(char) for char in key_str]
print(key_list)
while len(key_list) < len(input_list):
key_list.extend(key_list)
result = [a ^ b for a, b in zip(input_list, key_list)]
result_text = ''.join(map(chr, result))
print(result_text)
å®è¡ãã¾ãã
$ python snake.py
[116, 95, 74, 111, 51]
picoCTF{N0t_sO_coNfus1ng_sn@ke_1a73777f}
WinAntiDbg0x200ï¼300ãã¤ã³ãï¼
Medium ã® 300ãã¤ã³ãã®åé¡ã§ãããã¤ããªãã¡ã¤ã«ï¼WinAntiDbg0x200.zipï¼ã 1ã¤ãã¦ã³ãã¼ãã§ãã¾ãããã¹ã¯ã¼ãä»ãã® ZIPãã¡ã¤ã«ã§ããã¹ã¯ã¼ããå
¥åããã¨è§£åã§ãã¾ããWindows ã® CUIããã°ã©ã ã®ããã§ããconfig.binï¼ä¸ã® WinAntiDbg0x100 ã¨åããã¡ã¤ã«åãªã®ã§æ³¨æã§ãï¼ï¼ã¨ãããã¡ã¤ã«ãå«ã¾ãã¦ãã¾ããã
WinAntiDbg0x200åé¡
ä¸å¿ã表層解æãè¡ãã¾ãããã¯ããWindows ã® CUIããã°ã©ã ã®ããã§ãã
$ file WinAntiDbg0x200.exe
WinAntiDbg0x200.exe: PE32 executable (console) Intel 80386, for MS Windows, 5 sections
Windowsããã°ã©ã ã¯å¾åãã«ãã¾ãã
WinAntiDbg0x300ï¼400ãã¤ã³ãï¼
Medium ã® 400ãã¤ã³ãã®åé¡ã§ãããã¤ããªãã¡ã¤ã«ï¼WinAntiDbg0x300.zipï¼ã 1ã¤ãã¦ã³ãã¼ãã§ãã¾ãããã¹ã¯ã¼ãä»ãã® ZIPãã¡ã¤ã«ã§ããã¹ã¯ã¼ããå
¥åããã¨è§£åã§ãã¾ããWindowsããã°ã©ã ã®ããã§ããconfig.binï¼ä¸ã® WinAntiDbg0x100 ã WinAntiDbg0x200 ã¨åããã¡ã¤ã«åãªã®ã§æ³¨æã§ãï¼ï¼ã¨ãããã¡ã¤ã«ã¨ãWinAntiDbg0x300.pdb ãå«ã¾ãã¦ãã¾ããã
WinAntiDbg0x300åé¡
ä¸å¿ã表層解æãè¡ãã¾ããWindows ã® GUIããã°ã©ã ã®ããã§ãã
$ file WinAntiDbg0x300.exe
WinAntiDbg0x300.exe: PE32 executable (GUI) Intel 80386, for MS Windows, UPX compressed, 3 sections
$ file WinAntiDbg0x300.pdb
WinAntiDbg0x300.pdb: MSVC program database ver 7.00, 4096*215 bytes
Windowsããã°ã©ã ã¯å¾åãã«ãã¾ãã
ãããã«
ä»åã¯ãpicoCTF ã® picoCTF 2024 ã®ãã¡ãReverse Engineering ã¨ããã«ãã´ãªã®å
¨7åã®ãã¡ãWindowsããã°ã©ã ã® 3åãé¤ãã4åãããã¾ããã4åã¨ã解ããã®ã§è¯ãã£ãã§ãã
次ã¯ãpicoCTF 2024 ã® General Skills ããWeb Exploitation ã«ææ¦ãã¦ã¿ããã¨æãã¾ãã
æå¾ã«ãªãã¾ããããã¨ã³ã¸ãã¢ã°ã«ã¼ãã®ã©ã³ãã³ã°ã«åå ä¸ã§ãã
æ°æ¥½ã«ãããã¨ãããããé¡ããããã¾ãð
ä»åã¯ä»¥ä¸ã§ãï¼
æå¾ã¾ã§ãèªã¿ããã ãããããã¨ããããã¾ããã