Skip to content

Commit 800ee17

Browse files
committed
Update documentation PDF
- Remove all references to NtApiCollection.ini - Remove FAQ section since it only dealt with NtApiCollection.ini issues - Misc. spelling/grammar fixes
1 parent 6817d32 commit 800ee17

File tree

2 files changed

+44
-53
lines changed

2 files changed

+44
-53
lines changed

ConfigCollection/ScyllaHide.pdf

-132 KB
Binary file not shown.

Documentation/ScyllaHideDocumentation.tex

Lines changed: 44 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
\title{ScyllaHide v1.4 - Documentation}
3939
\author{}
40-
\date{2018-11-11}
40+
\date{2019-05-17}
4141

4242
\begin{document}
4343

@@ -54,7 +54,7 @@
5454

5555
\section{Description}
5656

57-
ScyllaHide is an advanced open-source x64/x86 usermode Anti-Anti-Debug library. It hooks various functions in usermode to hide debugging. This tool is intended to stay in usermode (ring3). If you need kernelmode (ring0) Anti-Anti-Debug please see \href{https://github.com/mrexodia/TitanHide}{TitanHide}. ScyllaHide hooks as stealth as possible in usermode and the goal is to not interfere any other functionality.
57+
ScyllaHide is an advanced open-source x64/x86 usermode Anti-Anti-Debug library. It hooks various functions in usermode to hide debugging. This tool is intended to stay in usermode (ring3). If you need kernelmode (ring0) Anti-Anti-Debug please see \href{https://github.com/mrexodia/TitanHide}{TitanHide}. ScyllaHide hooks as stealthily as possible in usermode and the goal is to not interfere with any other functionality.
5858

5959
ScyllaHide supports various debuggers with plugins:
6060
\begin{itemize}
@@ -69,10 +69,7 @@ \section{Description}
6969
Please note: ScyllaHide is not limited to these debuggers. You can use the standalone commandline version of ScyllaHide. You can inject ScyllaHide in any process debugged by any debugger.
7070

7171
\section{Usage Information}
72-
\subsubsection{NtApiTool}
73-
The NtApiCollection.ini can be generated for your operating system by using the appropriate NtApiTool.exe in the release folder. Copy the generated NtApiCollection.ini to your plugin directory.
74-
75-
\subsubsection{Standalone (debugger-independent)}
72+
\subsection{Standalone (debugger-independent)}
7673
InjectorCLI.exe "process name" "HookLibrary.dll path" [nowait]
7774

7875
InjectorCLI.exe pid:\textit{process ID} "HookLibrary.dll path" [nowait]
@@ -82,39 +79,39 @@ \subsubsection{Standalone (debugger-independent)}
8279

8380
The injector waits for a keystroke after injection by default. You can modify this behaviour by passing "nowait" (without quotes) as the last parameter.
8481

85-
\subsubsection{OllyDbg v1}
86-
Copy scylla\_hide.ini, NtApiCollection.ini, HookLibraryx86.dll and ScyllaHideOlly1.dll to your specific plugins directory.
82+
\subsection{OllyDbg v1}
83+
Copy scylla\_hide.ini, HookLibraryx86.dll and ScyllaHideOlly1.dll to your specific plugins directory.
8784

88-
\subsubsection{OllyDbg v2}
89-
Copy scylla\_hide.ini, NtApiCollection.ini, HookLibraryx86.dll and ScyllaHideOlly2.dll to your specific plugins directory.
85+
\subsection{OllyDbg v2}
86+
Copy scylla\_hide.ini, HookLibraryx86.dll and ScyllaHideOlly2.dll to your specific plugins directory.
9087

91-
\subsubsection{IDA v6}
88+
\subsection{IDA v6}
9289
\textbf{32-bit:}
93-
Copy scylla\_hide.ini, NtApiCollection.ini, HookLibraryx86.dll and ScyllaHideIDA.plw to your IDA plugins directory.
90+
Copy scylla\_hide.ini, HookLibraryx86.dll and ScyllaHideIDA.plw to your IDA plugins directory.
9491

9592
\textbf{64-bit:}
96-
Copy scylla\_hide.ini, NtApiCollection.ini, HookLibraryx64.dll, ScyllaHideIDASrvx64.exe and ScyllaHideIDA.p64 to your IDA plugins directory.
93+
Copy scylla\_hide.ini, HookLibraryx64.dll, ScyllaHideIDASrvx64.exe and ScyllaHideIDA.p64 to your IDA plugins directory.
9794

98-
Note: \\Start ScyllaHideIDASrvx64.exe to debug 64bit applications (remotely). \\Start ScyllaHideIDASrvx86.exe to debug 32bit applications remotely.
95+
Note: \\Start ScyllaHideIDASrvx64.exe to debug 64bit applications remotely. \\Start ScyllaHideIDASrvx86.exe to debug 32bit applications remotely.
9996

100-
Commandline: ScyllaHideIDASrvxXX.exe "port"\\
97+
Command line: ScyllaHideIDASrvxXX.exe <port>\\
10198
For example: ScyllaHideIDASrvxXX.exe 1345
10299

103-
ScyllaHideIDASrv needs HookLibraryxXX.dll and NtApiCollection.ini
100+
ScyllaHideIDASrv needs HookLibraryxXX.dll.
104101

105-
\subsubsection{x64dbg}
102+
\subsection{x64dbg}
106103
\textbf{32-bit:}
107-
Copy scylla\_hide.ini, NtApiCollection.ini, HookLibraryx86.dll and ScyllaHideX64DBGPlugin.dp32 to your \path{\x32\plugins\} directory.
104+
Copy scylla\_hide.ini, HookLibraryx86.dll and ScyllaHideX64DBGPlugin.dp32 to your \path{\x32\plugins\} directory.
108105

109106
\textbf{64-bit:}
110-
Copy scylla\_hide.ini, NtApiCollection.ini, HookLibraryx64.dll and ScyllaHideX64DBGPlugin.dp64 to your \path{\x64\plugins\} directory.
107+
Copy scylla\_hide.ini, HookLibraryx64.dll and ScyllaHideX64DBGPlugin.dp64 to your \path{\x64\plugins\} directory.
111108

112-
\subsubsection{TitanEngine}
109+
\subsection{TitanEngine}
113110
\textbf{32-bit:}
114-
Copy scylla\_hide.ini, NtApiCollection.ini, HookLibraryx86.dll and ScyllaHideTEx86.dll to your \path{\plugins\x86\} directory.
111+
Copy scylla\_hide.ini, HookLibraryx86.dll and ScyllaHideTEx86.dll to your \path{\plugins\x86\} directory.
115112

116113
\textbf{64-bit:}
117-
Copy scylla\_hide.ini, NtApiCollection.ini, HookLibraryx64.dll and ScyllaHideTEx64.dll to your \path{\plugins\x64\} directory.
114+
Copy scylla\_hide.ini, HookLibraryx64.dll and ScyllaHideTEx64.dll to your \path{\plugins\x64\} directory.
118115

119116
\section{Features}
120117

@@ -123,7 +120,7 @@ \subsection{Anti-Anti-Debug}
123120
\subsubsection{Process Environment Block (PEB)}
124121
The most important anti-anti-debug option. Almost every protector checks for PEB values. There are three important options and one minor option.
125122
\begin{itemize}
126-
\item BeingDebugged: Very important option, should be always enabled. \textit{IsDebuggerPresent} is using this value to check for debuggers.
123+
\item BeingDebugged: Very important option, should always be enabled. \textit{IsDebuggerPresent} uses this value to check for debuggers.
127124
\item NtGlobalFlag: Very important option, a lot of protectors check this value.
128125
\item HeapFlags: Very important option. E.g. Themida checks for heap artifacts and heap flags.
129126
\item StartupInfo: This is not really important, only a few protectors check for this. Maybe Enigma checks it.
@@ -143,14 +140,14 @@ \subsubsection{NtQuerySystemInformation}
143140
\subsubsection{NtQueryInformationProcess}
144141
A very important option. Various PROCESSINFOCLASS values can be used to detect a debugger:
145142
\begin{itemize}
146-
\item ProcessDebugFlags (31): Should return 1 in the supplied buffer.
143+
\item ProcessDebugFlags (31): Should return 1 in the supplied buffer, unless this value was previously set to PROCESS\_DEBUG\_INHERIT (0x1), then 0.
147144
\item ProcessDebugPort (7): Should return 0 in the supplied buffer.
148-
\item ProcessDebugObjectHandle (30): Should return 0 in the supplied buffer and the error STATUS\_PORT\_NOT\_SET (0xC0000353).
145+
\item ProcessDebugObjectHandle (30): Should write 0 to the supplied buffer, close the debug object handle, and return the error STATUS\_PORT\_NOT\_SET (0xC0000353).
149146
\item ProcessBasicInformation (0): Reveals the parent process ID.
150147
\item ProcessBreakOnTermination (29): Please see \textit{NtSetInformationProcess} in Section~\ref{sec:NtSetInformationProcess_section}.
151148
\item ProcessHandleTracing (32): Please see \textit{NtSetInformationProcess} in Section~\ref{sec:NtSetInformationProcess_section}.
152149
\end{itemize}
153-
A lot of protectors use this to detect debuggers. The windows API \textit{CheckRemoteDebuggerPresent} uses \textit{NtQueryInformationProcess} with ProcessDebugPort internally.
150+
A lot of protectors use this function to detect debuggers. The windows API \textit{CheckRemoteDebuggerPresent} uses \textit{NtQueryInformationProcess} with ProcessDebugPort internally.
154151

155152
\subsubsection{NtQueryObject}
156153
The OBJECT\_INFORMATION\_CLASS ObjectTypesInformation (3) and ObjectTypeInformation (2) can be used to detect debuggers. ScyllaHide filters DebugObject references.
@@ -182,24 +179,18 @@ \subsubsection{OutputDebugStringA (deprecated since v1.3)}
182179
}
183180
\end{lstlisting}
184181

185-
\subsubsection{BlockInput}
182+
\subsubsection{NtUserBlockInput}
186183
Very effective anti-debug method. This is used e.g. in Yoda's Protector. "Blocks keyboard and mouse input events from reaching applications."
187184

188185
\subsubsection{NtUserFindWindowEx}
189186
This is a system call function in user32.dll. The windows APIs \textit{FindWindowA/W} and \textit{FindWindowExA/W} call this internally. The debugger window will be hidden.
190187

191-
Note: Requires a valid relative virtual address in NtApiCollection.ini.
192-
193188
\subsubsection{NtUserBuildHwndList}
194189
This is a system call function in user32.dll. The windows APIs \textit{EnumWindows} and \textit{EnumThreadWindows} call this internally. The debugger window will be hidden.
195190

196-
Note: Requires a valid relative virtual address in NtApiCollection.ini.
197-
198191
\subsubsection{NtUserQueryWindow}
199192
This is a system call function in user32.dll. The windows API \textit{GetWindowThreadProcessId} calls this internally, see Listing for implementation. This is used to hide the debugger process.
200193

201-
Note: Requires a valid relative virtual address in NtApiCollection.ini.
202-
203194
\begin{lstlisting}[language=C, caption=GetWindowThreadProcessId Implementation]
204195
DWORD __stdcall GetWindowThreadProcessId(HWND hWnd, LPDWORD lpdwProcessId)
205196
{
@@ -210,19 +201,19 @@ \subsubsection{NtUserQueryWindow}
210201
\end{lstlisting}
211202

212203
\subsubsection{NtSetDebugFilterState}
213-
ScyllaHide returns always STATUS\_ACCESS\_DENIED. This anti-debug measurement isn't used very often. Probably you will never need this option in a real world target.
204+
ScyllaHide returns STATUS\_ACCESS\_DENIED unless the process has debug privileges enabled. If the process has debug privileges, ScyllaHide will take no action and return success. This anti-debug measurement isn't used very often. Probably you will never need this option in a real world target.
214205

215206
\subsubsection{NtClose}
216207
This is called with an invalid handle to detect a debugger. ScyllaHide calls \textit{NtQueryObject} to check the validity of the handle. A few protectors are using this method.
217208

218209
\subsubsection{Remove Debug Privileges}
219-
If a debugger creates the process of the target, the target will have debug privileges. This can be used to detect a debugger.
210+
If a debugger creates the process of the target, the target may have debug privileges. This is an unreliable way to detect a debugger.
220211

221212
\subsubsection{Hardware Breakpoint Protection (DRx)}
222213
Hardware breakpoints can be detected/cleared with exceptions or the windows APIs \textit{NtGetContextThread/NtSetContextThread}. Enable this option only if you need it!
223214

224215
\subsubsection{Timing}
225-
There are a few windows APIs to measure the time. Timing can be used to detect debuggers, because they slow down the execution. Enable with care and only if you need it!
216+
There are a few windows APIs to measure the time. Timing can be used to detect debuggers, because they slow down execution. Enable with care and only if you need it!
226217

227218
\subsubsection{Raise Exception}
228219
\label{sec:RaiseException_section}
@@ -271,18 +262,20 @@ \subsection{Special}
271262
\subsubsection{DLL Injection}
272263
Normal DLL injection or stealth dll injection. You better try the normal injection first...
273264

265+
\pagebreak
266+
274267
\subsubsection{Prevent Thread Creation}
275268
This option prevents the creation of new threads. This can be useful if a protector uses a lot of protection threads. This option can be useful for EXECryptor. Enable with care and only if you need it! You must know what you are doing here!
276269

277270
\subsubsection{RunPE Unpacker}
278-
This option hooks \textit{NtResumeThread}. If the malware creates a new process, ScyllaHide terminates and dumps any newly created process. If you are unpacking malware, enable and try it. Should be only used inside a Virtual Machine (VM).
271+
This option hooks \textit{NtResumeThread}. If the malware creates a new process, ScyllaHide terminates and dumps any newly created process. If you are unpacking malware, enable and try it. Should only be used inside a Virtual Machine.
279272

280273
A typical RunPE workflow:
281274

282275
\begin{enumerate}
283-
\item Create a new process of any target in suspended state (Process flag CREATE\_SUSPENDED: 0x00000004)
276+
\item Create a new process of any target in suspended state (process flag CREATE\_SUSPENDED: 0x00000004)
284277
\item Replace the original process PE image with a new (malicious) PE image. This can involve several steps and various windows API functions.
285-
\item Start the process with the windows API function \textit{ResumeThread} (or \textit{NtResumeThread})
278+
\item Start the process with the Windows API function \textit{ResumeThread} (or \textit{NtResumeThread}).
286279
\end{enumerate}
287280

288281
\subsubsection{Improved Attach Dialog}
@@ -303,6 +296,9 @@ \subsection{OllyDbg v1 Specific}
303296

304297
\subsubsection{Remove entry point breakpoint}
305298
Some protectors use Thread-Local-Storage (TLS) as entrypoint and check for breakpoints at the normal PE entrypoint address. You must remove the PE entrypoint to hide your debugger. This option is necessary for VMProtect.
299+
300+
\pagebreak
301+
306302
\subsubsection{Fix Olly Bugs}
307303
This option fixes various OllyDbg bugs:
308304
\begin{itemize}
@@ -326,7 +322,7 @@ \subsubsection{Skip compressed code warning}
326322
\subsubsection{Skip "load dll" warning}
327323
Annoying warning "Request to load DLL" can be skipped with a default behaviour.
328324
\subsubsection{Break on TLS}
329-
This option sets a breakpoint to any available Thread-Local-Storage (TLS) address. This is necessary for various protectors e.g. VMProtect.
325+
This option sets a breakpoint on any available Thread-Local-Storage (TLS) address. This is necessary for various protectors e.g. VMProtect.
330326
\subsubsection{Advanced CTRL+G}
331327
Replaces the default OllyDbg "Go to Address" dialog. Now you can enter RVA and offset values. Be sure to select the correct module.
332328

@@ -337,7 +333,7 @@ \subsubsection{Advanced CTRL+G}
337333
\end{figure}
338334

339335
\subsubsection{Change window caption}
340-
Change the OllyDbg window caption. This can be useful against e.g. FindWindow anti-debug tricks. You don't need to enable this, if you have the NtUser* hooks enabled! Hint: You can use it to make the currently used profile visible.
336+
Changes the OllyDbg window caption. This can be useful against e.g. FindWindow anti-debug tricks. You don't need to enable this, if you have the NtUser* hooks enabled! Hint: You can use it to make the currently used profile visible.
341337

342338
\subsubsection{Special Keyboard Shortcuts}
343339

@@ -373,7 +369,7 @@ \subsection{OllyDbg v2 Specific}
373369
\end{figure}
374370

375371
\subsubsection{Change window caption}
376-
Change the OllyDbg window caption. This can be useful against e.g. FindWindow anti-debug tricks. You don't need to enable this, if you have the NtUser* hooks enabled! Hint: You can use it to make the currently used profile visible.
372+
Changes the OllyDbg window caption. This can be useful against e.g. FindWindow anti-debug tricks. You don't need to enable this, if you have the NtUser* hooks enabled! Hint: You can use it to make the currently used profile visible.
377373

378374
\subsection{IDA Specific}
379375

@@ -398,6 +394,11 @@ \section{Advanced Information}
398394
\subsection{Nt* APIs from user32.dll}
399395

400396
\begin{lstlisting}[language=C, caption=Special Nt* APIs declaration]
397+
BOOL
398+
NTAPI
399+
NtUserBlockInput(
400+
IN BOOL fBlockIt);
401+
401402
HWND
402403
NTAPI
403404
NtUserFindWindowEx(
@@ -444,14 +445,7 @@ \subsection{Special PEB Fix Information}
444445
}
445446
}
446447
\end{lstlisting}
447-
But this code is correct and very important. This nice trick removes heap artifacts (You can read more about it here: \url{http://pferrie.tripod.com/papers/unpackers.pdf} "The heap"). Themida and other protectors are checking for heap artifacts. Instead of manually wiping the artifacts, the code prevents the heap artifact creation.
448-
449-
\section{Frequently Asked Questions}
450-
The error "NT APIs missing" appears, how to solve it?
451-
\begin{itemize}
452-
\item You need to put NtApiCollection.ini in the same directory as ScyllaHide.dll or the following hooks will not work: NtUserQueryWindow, NtUserBuildHwndList, NtUserFindWindowEx
453-
\item Some Nt* WINAPI functions are not exported by a DLL, so it is necessary to get the function addresses from another source. The other source is the PDB file. The adresses can be resolved with the NtApiTool packaged in the release. It will download the PDB file from the Microsoft server to resolve the missing function addresses.
454-
\end{itemize}
448+
But this code is correct and very important. This nice trick removes heap artifacts (You can read more about it here: \url{http://pferrie.tripod.com/papers/unpackers.pdf} "The heap"). Themida and other protectors check for heap artifacts. Instead of manually wiping the artifacts, the code prevents the heap artifact creation.
455449

456450
\section{Developer Contact Information}
457451

@@ -487,9 +481,6 @@ \section{Developer Contact Information}
487481
\end{itemize}
488482
\end{center}
489483

490-
% Matti: force page break here because the section title was on a different page than the rest
491-
\pagebreak
492-
493484
\section{Version History}
494485

495486
Version 1.4

0 commit comments

Comments
 (0)