TCM
June 1st, 2007, 22:15
Hello,
I was told that I might find more help here than at reverse-engineering.net
Where to begin:
Firstly, I do not have much experience in reversing malware. I have completed about 30 crackme's in my lifetime and have a fairly decent knowledge of windows internals (or so I thought).
Recently, I decided to attempt the disassembly of a random piece of malware downloaded from a website.
I first ran the program through PEiD. It detected it as packed with PECompact 2.xx, yet the program was not packed and could be disassembled with ease.
During execution, the malware loaded kernel32.dll and some choice functions. It then extracted a resource and wrote it to a file called "malware_filename.dat". It then called LoadLibrary on the .dat file.
When this was being disassembled with IDA Pro I received an access violation exception. Upon examination of the code I witnessed:
Code:
I didn't understand what I was seeing until I read an article about how packers can execute their code in the SEH. I tried to trace where the SEH was by looking for the TIB, but it pointed to some location in ntdll.dll which did not seem correct.
I did trace the code a couple times and notice that it is polymorphic in the sense that it seems to write to memory and then call it.
I can't seem to figure out how to dump a clean version of the dll.
UnPE2 and unpecompact both do not work on dlls.
Furthermore there are some interesting anti-debugging techniques used such as placing me in an infinite loop inside of ntdll_DbgUIRemoteBreakin.
The only reason I think it uses PEcompact2 is because you can physically see an ascii string "pecompact2" inside of it, which may have been placed there to trick me.
PEiD does not detect anything, IDA and Olly beg to differ.
Does anyone have any ideas? Has anyone seen anything similar before? Any tutorials to point me in the right direction?
If you would like the file, I could upload it. But I will only need help defeating the packer/polymorphic code.
Thanks,
-TCM
I was told that I might find more help here than at reverse-engineering.net
Where to begin:
Firstly, I do not have much experience in reversing malware. I have completed about 30 crackme's in my lifetime and have a fairly decent knowledge of windows internals (or so I thought).
Recently, I decided to attempt the disassembly of a random piece of malware downloaded from a website.
I first ran the program through PEiD. It detected it as packed with PECompact 2.xx, yet the program was not packed and could be disassembled with ease.
During execution, the malware loaded kernel32.dll and some choice functions. It then extracted a resource and wrote it to a file called "malware_filename.dat". It then called LoadLibrary on the .dat file.
When this was being disassembled with IDA Pro I received an access violation exception. Upon examination of the code I witnessed:
Code:
Code:
xor eax, eax
move [eax], ecx
I didn't understand what I was seeing until I read an article about how packers can execute their code in the SEH. I tried to trace where the SEH was by looking for the TIB, but it pointed to some location in ntdll.dll which did not seem correct.
I did trace the code a couple times and notice that it is polymorphic in the sense that it seems to write to memory and then call it.
I can't seem to figure out how to dump a clean version of the dll.
UnPE2 and unpecompact both do not work on dlls.
Furthermore there are some interesting anti-debugging techniques used such as placing me in an infinite loop inside of ntdll_DbgUIRemoteBreakin.
The only reason I think it uses PEcompact2 is because you can physically see an ascii string "pecompact2" inside of it, which may have been placed there to trick me.
PEiD does not detect anything, IDA and Olly beg to differ.
Does anyone have any ideas? Has anyone seen anything similar before? Any tutorials to point me in the right direction?
If you would like the file, I could upload it. But I will only need help defeating the packer/polymorphic code.
Thanks,
-TCM