waliedassar Posted November 24, 2012 Posted November 24, 2012 (edited) My lastest blog post where i discuss in detail the topic of hiding threads from debuggers.http://waleedassar.b...-debuggers.htmlHave fun. Edited November 24, 2012 by waliedassar 5
haggar Posted November 25, 2012 Posted November 25, 2012 Very nice. I must admit that I didn't know for this trick.
Aguila Posted November 25, 2012 Posted November 25, 2012 This is a really interesting article, thank you.Do you have some more information about ZwCreateThreadEx?Scylla is using this function already for dll injection: #define THREAD_ALL_ACCESS_VISTA_7 (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0xFFFF) //for windows vista/7 ntStatus = NativeWinApi::NtCreateThreadEx(&hThread, THREAD_ALL_ACCESS_VISTA_7, 0, hProcess, (LPTHREAD_START_ROUTINE)lpStartAddress, (LPVOID)lpParameter, TRUE, 0, 0, 0, 0);I guess the public known prototyp is wrong:typedef NTSTATUS (WINAPI *def_NtCreateThreadEx)(PHANDLE hThread,ACCESS_MASK DesiredAccess,LPVOID ObjectAttributes,HANDLE ProcessHandle,LPTHREAD_START_ROUTINE lpStartAddress,LPVOID lpParameter,BOOL CreateSuspended,ULONG StackZeroBits,LPVOID SizeOfStackCommit,LPVOID SizeOfStackReserve,LPVOID lpBytesBuffer);BOOL CreateSuspended -> Scylla is using TRUE (1) to create a suspended thread. But I guess it can be combined with 0x4, so the name is wrong. Are there any other tricks with this api?
waliedassar Posted November 26, 2012 Author Posted November 26, 2012 (edited) The prototype you have mentioned is fine except that the 7th parameter should be "long Flags" instead of "BOOL CreateSuspended". As i can see in disassembly, there are only four allowed flags.0x1 --> CreateSuspended0x2 --> SuppressDllMains (Don't call DllMain's and TLS callbacks for DLL_THREAD_ATTACH/DETACH)0x4 --> HideFromDebugger0x8--> ???Bit 0x8 causes some bit at the thread's TEB to be set (at offset 0xFCA from the start of 32-bit TEB). Still under study. Edited December 7, 2012 by waliedassar
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now