The Hacksuite has an easy way to log errors, which will be logged by default in
Logs/thc.txt.
There are two different log errors:
- fatal errors
- non fatal errors
Usually you will see errors being logged like this:
(!IsThere($sPage) ? include($_PATHS['end']) : include_once($sPage));
The code above means:
look for file \$sPage, if we can't find it include \$_PATHS['end'] and otherwise include \$sPage
\$_PATHS['end'] is the file that by default will be located in the templates folder, to be exact
index.php in the error folder.
This file decides whether to log the error and how to handle the output.
There are several ways to handle logging, for instance you can make the hacksuite sending no output to the browser but log the error.
These are the handlers that can manipulate errors/output:
$_CONTEXT['log']: if true log the error to $_PATHS['write_dest']
$_CONTEXT['silent']: if true it won't spit out any output, useful if you want eg the suite to be a remote shell
$_CONTEXT['fatal']: will immediately stop php parsing and show the error if the previous variable ($_CONTEXT['silent']) is false.
You can also change the error location easily, before you handle the error change the location of
$_PATHS['write_dest'].
The error handler file makes use of an include file called
Includes/log_error.php
If no errors are loaded in the numeric array
$_CONTEXT['errors'] parsing will continue, unless
$_CONTEXT['fatal'] is set.
As we speak (version 0.4) there's no way to change the error handler variables without using the development tools. In a later version I will code a native tool that can change the values of handlers in
vars.php. The reason for that is that the error handling system was coded in 2008 at the very start of the hacksuite development and hasn't been touched ever since.