UPS expedition!
Friday, 15. August 2008, 08:20:41
I found in my spam a message of UPS expedition, an executable with the icon of WORD document!
But I think that developer of malware wrote the program with a little bug..
On Windows XP SP2 the malware crash.. why?
This is the entry point:
The initial values of registers on my machine are:
EAX = 00000000 ECX = 0013FFB0 EDX = 7C90EB94 EBX = 7FFD6000
ESP = 0013FFC4 EBP = 0013FFF0 ESI = FFFFFFFF EDI = 7C910738
EDX it's a pointer to latest instruction of ntdll.KiFastSystemCallRet and EDI point to
What's the problem?
.004010A7 and edx, ecx
EDX = 0010EB90
.004010A9 mov ecx, 0AFFC5C82h
ECX = AFFC5C82
.004010AE ror ecx, 3
ECX = 55FF8B90
.004010B1 rol esi, 13h
ESI = FFFFFFFF
.004010B4 mov edx, 7FFFFFC8h
EDX = 7FFFFFC8
.004010B9 rol edx, 1
EDX = FFFFFF90
.004010BC not eax
EAX = FFFFFFFF
.004010BE mov esi, esp
ESI = 0013FFC4
.004010C0 mov eax, 0E000001Fh
EAX = E000001F
.004010C5 rol eax, 3
EAX = 000000FF
.004010C8 add di, 2Ah
EDI = 7C910762
.004010CC and esi, eax
ESI = 000000C4
.004010CE mov eax, 4BFCh
EAX = 00004BFC
.004010D3 rol eax, 6
EAX = 0012FF00
.004010D6 add eax, esi
ESI = 0012FFC4
.004010D8 xor ecx, 41AEE935h
ECX = 145162A5
.004010DE mov edi, [eax]
Crash! without exception handler...
The reason was that stack it's only 2000h on this executable .. and the value 4BFC ROL 6 will be 12FF00h and not 13FF00h
Now.. why 12FF00 ?? What's the o.s. to run the malware? Because, if we change EAX to ESP value.. the program begin to look in kernel memory the EDX pattern... and the pattern will be found at kernel32.BaseCheckAppcompatCache
... the code continue calling ntdll.ZwSetLdtEntries, finding GlobalAlloc, LoadLibrary, VirtualProtect..
I continue to debug this malware..
But I think that developer of malware wrote the program with a little bug..
On Windows XP SP2 the malware crash.. why?
This is the entry point:
.004010A7 and edx, ecx .004010A9 mov ecx, 0AFFC5C82h .004010AE ror ecx, 3 .004010B1 rol esi, 13h .004010B4 mov edx, 7FFFFFC8h .004010B9 rol edx, 1 .004010BC not eax .004010BE mov esi, esp .004010C0 mov eax, 0E000001Fh .004010C5 rol eax, 3 .004010C8 add di, 2Ah .004010CC and esi, eax .004010CE mov eax, 4BFCh .004010D3 rol eax, 6 .004010D6 add eax, esi .004010D8 xor ecx, 41AEE935h .004010DE mov edi, [eax]
The initial values of registers on my machine are:
EAX = 00000000 ECX = 0013FFB0 EDX = 7C90EB94 EBX = 7FFD6000
ESP = 0013FFC4 EBP = 0013FFF0 ESI = FFFFFFFF EDI = 7C910738
EDX it's a pointer to latest instruction of ntdll.KiFastSystemCallRet and EDI point to
.7C910735 align 4 .7C910738 dd 0FFFFFFFFh ; < EDI .7C91073C dd offset loc_7C94E05D .7C910740 dd offset loc_7C94E066
What's the problem?
.004010A7 and edx, ecx
EDX = 0010EB90
.004010A9 mov ecx, 0AFFC5C82h
ECX = AFFC5C82
.004010AE ror ecx, 3
ECX = 55FF8B90
.004010B1 rol esi, 13h
ESI = FFFFFFFF
.004010B4 mov edx, 7FFFFFC8h
EDX = 7FFFFFC8
.004010B9 rol edx, 1
EDX = FFFFFF90
.004010BC not eax
EAX = FFFFFFFF
.004010BE mov esi, esp
ESI = 0013FFC4
.004010C0 mov eax, 0E000001Fh
EAX = E000001F
.004010C5 rol eax, 3
EAX = 000000FF
.004010C8 add di, 2Ah
EDI = 7C910762
.004010CC and esi, eax
ESI = 000000C4
.004010CE mov eax, 4BFCh
EAX = 00004BFC
.004010D3 rol eax, 6
EAX = 0012FF00
.004010D6 add eax, esi
ESI = 0012FFC4
.004010D8 xor ecx, 41AEE935h
ECX = 145162A5
.004010DE mov edi, [eax]
Crash! without exception handler...
The reason was that stack it's only 2000h on this executable .. and the value 4BFC ROL 6 will be 12FF00h and not 13FF00h
Now.. why 12FF00 ?? What's the o.s. to run the malware? Because, if we change EAX to ESP value.. the program begin to look in kernel memory the EDX pattern... and the pattern will be found at kernel32.BaseCheckAppcompatCache
... the code continue calling ntdll.ZwSetLdtEntries, finding GlobalAlloc, LoadLibrary, VirtualProtect..
I continue to debug this malware..