Page 1 of 1

Изучаем ProtectionID v0.6.4.0

Posted: Mon Sep 13, 2010 11:30 am
by Admin
По заявлению авторов программа определяет наличие VMProtect в защищенных файлах что в целом подтверждается результатами скана:

Code: Select all

-=[ ProtectionID v0.6.4.0 JULY]=-
(c) 2003-2010 CDKiLLER & TippeX
Build 07/08/10-17:57:05
Ready...
Scanning -> C:\Program Files\VMProtect Ultimate\VMProtect.exe
File Type : 32-Bit Exe (Subsystem : Win GUI / 2), Size : 4072448 (03E2400h) Byte(s)
[File Heuristics] -> Flag : 00000000000001001100001100000011 (0x0004C303)
[!] VM Protect v1.60 - v2.05 (or newer) detected !
- Scan Took : 0.641 Second(s)
Упоминание "File Heuristics" впечатляет :)) Ну что-ж приступим к изучению этого дела. Открываем protection_id.exe в FAR и ищем строку "VM Protect". В результате находим очень интересный блок:

Code: Select all

000985B0:  00 56 4D 20 50 72 6F 74 │ 65 63 74 20 53 63 61 6E    VM Protect Scan
000985C0:  2E 2E 2E 00 0D 0A 5B 21 │ 5D 20 56 4D 20 50 72 6F   ... 
[!] VM Pro
000985D0:  74 65 63 74 20 25 73 20 │ 64 65 74 65 63 74 65 64   tect %s detected
000985E0:  20 21 00 0D 0A 56 4D 20 │ 50 72 6F 74 65 63 74 20    ! 
VM Protect
000985F0:  25 73 00 76 31 2E 30 30 │ 20 2D 20 76 31 2E 35 30   %s v1.00 - v1.50
00098600:  00 76 31 2E 36 30 20 2D │ 20 76 32 2E 30 35 20 28    v1.60 - v2.05 (
00098610:  6F 72 20 6E 65 77 65 72 │ 29 00 41 20 64 65 62 75   or newer) A debu
00098620:  67 67 65 72 20 68 61 73 │ 20 62 65 65 6E 20 66 6F   gger has been fo
00098630:  75 6E 64 20 72 75 6E 6E │ 69 6E 67 20 69 6E 20 79   und running in y
00098640:  6F 75 72 20 73 79 73 74 │ 65 6D 2E 0D 50 6C 65 61   our system.
Plea
00098650:  73 65 2C 20 75 6E 6C 6F │ 61 64 20 69 74 20 66 72   se, unload it fr
00098660:  6F 6D 20 6D 65 6D 6F 72 │ 79 20 61 6E 64 20 72 65   om memory and re
00098670:  73 74 61 72 74 20 79 6F │ 75 72 20 70 72 6F 67 72   start your progr
00098680:  61 6D 46 69 6C 65 20 63 │ 6F 72 72 75 70 74 65 64   amFile corrupted
00098690:  21 2E 20 54 68 69 73 20 │ 70 72 6F 67 72 61 6D 20   !. This program
000986A0:  68 61 73 20 62 65 65 6E │ 20 6D 61 6E 69 70 75 6C   has been manipul
000986B0:  61 74 65 64 20 61 6E 64 │ 20 6D 61 79 62 65 0D 69   ated and maybe
i
000986C0:  74 27 73 20 69 6E 66 65 │ 63 74 65 64 20 62 79 20   t's infected by
000986D0:  61 20 56 69 72 75 73 20 │ 6F 72 20 63 72 61 63 6B   a Virus or crack
000986E0:  65 64 2E 20 54 68 69 73 │ 20 66 69 6C 65 20 77 6F   ed. This file wo
000986F0:  6E 27 74 20 77 6F 72 6B │ 20 61 6E 79 6D 6F 72 65   n't work anymore
00098700:  2E 00 54 68 65 20 70 72 │ 6F 63 65 64 75 72 65 20   . The procedure
00098710:  65 6E 74 72 79 20 70 6F │ 69 6E 74 20 25 63 20 63   entry point %c c
00098720:  6F 75 6C 64 20 6E 6F 74 │ 20 62 65 20 6C 6F 63 61   ould not be loca
00098730:  74 65 64 20 69 6E 20 74 │ 68 65 20 64 79 6E 61 6D   ted in the dynam
00098740:  69 63 20 6C 69 6E 6B 20 │ 6C 69 62 72 61 72 79 20   ic link library
00098750:  25 73 00 2E 76 6D 70 30 │ 00 00 00 2E 76 6D 74 30   %s .vmp0   .vmt0
00098760:  00 00 00 2E 76 64 74 30 │ 00 00 00 53 D7 49 00 5B      .vdt0   S╫I [
И что же мы здесь видим? А здесь мы видим стандартные строки загрузчика VMProtect, который прилепляется к защищаемой программе и делает различную работу по распаковке/настройке импорта/отпределнию отладчика и многое другое. Но как же быть с "File Heuristics"? :)) Обнаружение строк (ака сигнатур) нивкоем случае не относится к эвристике - на практике имеем обычный сигнатурный поиск. Но может быть все-таки эвристика там есть???
Проверяем - грузим protection_id.exe в OllyDBG, переходим к адресу 0049D5B0 (определили по файловому смещению 000985B0) и патчим все строки загрузчика (просто меняя одну букву в каждой строке). Проверяем результат:

Code: Select all

-=[ ProtectionID v0.6.4.0 JULY]=-
(c) 2003-2010 CDKiLLER & TippeX
Build 07/08/10-17:57:05
Ready...
Scanning -> C:\Program Files\VMProtect Ultimate\VMProtect.exe
File Type : 32-Bit Exe (Subsystem : Win GUI / 2), Size : 4072448 (03E2400h) Byte(s)
[File Heuristics] -> Flag : 00000000000001001100001100000011 (0x0004C303)
[!] File appears to have no protection or is using an unknown protection
- Scan Took : 0.641 Second(s)
Вуаля! Авторы этой программулины врут своим пользователям, что используется эвристика - на самом деле используется обычный сигнатурный поиск. Шифрование строк загрузчика будет добавлено в версию 2.06. Посмотрим какую еще "эвристику" прикрутят авторы :))

P.S. Также улыбнула "обфускация" против нахождения стринг референсов:

Code: Select all

0045224E     8BFF           MOV EDI,EDI
00452250   . 50             PUSH EAX
00452251   . 53             PUSH EBX
00452252   . 68 4F4AE6DE    PUSH DEE64A4F                            ; /Arg1 = DEE64A4F
00452257   . 810424 628B632>ADD DWORD PTR SS:[ESP],21638B62          ; |
0045225E   . E8 9998FBFF    CALL protecti.0040BAFC                   ; \protecti.0040BAFC
Передача одного аргумента "обфусцирована" с помощью команды ADD (DEE64A4F+21638B62 = 0049D5B1).

Re: Изучаем ProtectionID v0.6.4.0

Posted: Sat Nov 01, 2014 7:59 pm
by TippeX
actually we do use the heuristics to influence the scans...
sure pattern scans are used.. pretty much everything does that
but the heuristics are checked to reduce false positives..

the heuristics for example imply..

the entrypoint is not in the first section, entrypoint section is rwe, first section is zero physical size
size of code is invalid, initialised data size is invalid, header size is invalid

all of which are pretty good indicators...

only once some of those are matched, will the pattern / fingerprint scan happen

you also missed some other parts in your 'analysis'

Re: Изучаем ProtectionID v0.6.4.0

Posted: Sun Nov 02, 2014 6:32 am
by Admin
Are you an author of ProtectionID? I can check the latest version if you want. But I think that your "heuristics" is still very simple :wink:

Re: Изучаем ProtectionID v0.6.4.0

Posted: Sat Jan 10, 2015 12:48 pm
by TippeX
yup, im the author.. and i agree the heuristics are relatively simplistic, but as i mentioned they really are just 'hints' used to reduce false positives
and to avoid executing code that may not be needed (like some of the pattern scans)... we enter cat vs. mouse though with some protectors wanting to hide themselves from pe scanners (i dont really see a point in this to be honest) or some protectors being quite 'elusive' in scans with no real discernable patterns to look for

if you want to test the latest version thats cool too, its on the homepage, or if you want to test the beta i'd be more than happy to add you to the beta team (just email me at the address on the homepage and remind me who you are in the email), my main goal is just to try and keep the protectionid project alive after cdkiller disappeared and to try and make the tool better, as well as reducing false positives