blabberer
February 25th, 2016, 23:52
@kayaker
yeah the quoted approach from the dmitry's book sounds ok if the parent process is creating the child process
in that case the child can probably inherit the mapping handle as well
but how would it work for a non duplicated handle ? i mean passing 576 as a commandline and directly mapping 576 i think cannot be feasible at all
not sure how to emulate / simulate / the behavior
as to the sample it seems to be a standard bullshit creating a child process unmapping / get and set thread contexting and resuming thread that breaks free from the debugger
Code:
CPU Stack
Address Value ASCII Comments
0012EBAC /00000000 ; |ApplicationName = NULL
0012EBB0 |00020660 ` ; |CommandLine = ""C:\Documents and Settings\admin\Desktop\_sample_net\_sample_net.exe""
0012EBB4 |00000000 ; |pProcessSecurity = NULL
0012EBB8 |00000000 ; |pThreadSecurity = NULL
0012EBBC |00000000 ; |InheritHandles = FALSE
0012EBC0 |00000004 ; |CreationFlags = CREATE_SUSPENDED
0012EBC4 |00000000 ; |pEnvironment = NULL
0012EBC8 |00000000 ; |CurrentDirectory = NULL
0012EBCC |0012F040 @ð ; |pStartupInfo = 0012F040 -> STARTUPINFOW {Size=68., Reserved1=NULL, Desktop=NULL, Title=NULL, X=0, Y=0, Width=0, Height=0, XCountChars=0, YCountChars=0, FillAttribute=0, Flags=0, ShowWindow=SW_HIDE, Reserved2=0, Reserved3=NULL, hStdInput=NULL, hStdOutput=
0012EBD0 |0012F088 ˆð ; \pProcessInformation = 0012F088 -> PROCESS_INFORMATION {hProcess=NULL, hThread=NULL, ProcessID=0 (0.), ThreadID=0}
CPU Stack
Address Value ASCII Comments
0012EBC0 /00000140 @ ; |hProcess = 00000140
0012EBC4 |00400000 @ ; |BaseAddress = _sample_net.<STRUCT IMAGE_DOS_HEADER>
0012EBC8 |00D30000 Ó ; |Buffer = 00D30000
0012EBCC |00000400 ; |Size = 1024.
0012EBD0 |00000000 ; \pBytesWritten = NULL
CPU Stack
Address Value ASCII Comments
0012EBBC /00000140 @ ; |hProcess = 00000140
0012EBC0 |00401000 @ ; |BaseAddress = 401000
0012EBC4 |00D30400 Ó ; |Buffer = 00D30400
0012EBC8 |00000A00
; |Size = 2560.
0012EBCC |00000000 ; \pBytesWritten = NULL
CPU Stack
Address Value ASCII Comments
0012EBCC /00000144 D ; |hThread = 00000144
0012EBD0 |0012F0A0 *ð ; \pContext = 0012F0A0 -> CONTEXT {ContextFlags=CONTEXT_FULL, Dr0=7C927764, Dr1=7C927553, Dr2=150000, Dr3=40000060, Dr6=7C91003D, Dr7=12F2F8, Float_ControlWord=0, Float_StatusWord=0, Float_TagWord=79E74411, Float_ErrorOffset=87F3C019, Float_ErrorSelector=15
btw there is a payload security posting that probably analysed the same variant (i googled for a guid inside the sample.net.exe and google turns up three links outofwhich payload security appears to have some details exactly as shub posted
i dumped the decrypted ?? memory to a file and attached here didn't check what it is doing
password is infected