random gallery image
random tutorial
preview

..we are going to create a new app for the hacksuite. We're not going to do anything fancy here, we will make a simple app to get familiar how to write compatible scripts for the..

read more

random generators
THC xMap

Creates a blueprint/map of a server folder

more about this module
more of this category
more modules

HackSuite File Library
File Library
Here you can find the latest files and structure of the THC HackSuite, note that if you have an earlier version of the suite it's not recommended to update files manually. Instead you should overwrite your existing HackSuite environment.
<?php
/* Determines whether log files contain proper data and find interesting log entries

Author: Remco Kouw
Site: http://www.hacksuite.com
Last Edit: 05-02-2015
*/
if(!defined('IN_SCRIPT')){
    exit;
}
if(
$_CONTEXT['allow_logfileanalyze']){
    
$_CONTEXT['scanlabel']['log_analyze'] = "logfile analyze";
    
$_CONTEXT['log_analyze'] = "";
    
// load the data directory file that contains all core functions or throw a fatal error
    
$aRequire = array($_PATHS['data_root']."/logsdata.php",$_PATHS['functions_root']."/raw_to_array.php");
    for(
$x=0;$x<count($aRequire);$x++){
        (!
IsThere($aRequire[$x]) ? include_once($_PATHS['end']) : include_once($aRequire[$x]));
    }
    for(
$x=0;$x<count($_CONTEXT['l_formats']);$x++){
        
// create log file location
        
$sDest $_PATHS['log_root']."/".ExploitFilter($_CONTEXT['l_formats'][$x]['file'],1,1);
        if(!
file_exists($sDest)){
            
$_CONTEXT['log_analyze'] .= "                    <div>missing ".$sDest."</div>\n";
        }
        else{
            
// some logs need to have content
            
$iSize filesize($sDest);
            if(isset(
$_CONTEXT['l_formats'][$x]['format']['notempty'])){
                if(!
$iSize){
                    
$_CONTEXT['log_analyze'] .= "                    <div>expecting content in ".$sDest."</div>\n";
                    continue;
                }
            }
            
// if we have content in the logfile make sure that we have a valid structure
            
if($iSize>0){
                if(
$_CONTEXT['l_formats'][$x]['format']['type']=="plain"){
                    
// plain text file like bla[separate_character]bla\n
                    
$aFile RawToArray($sDest,$_CONTEXT['l_formats'][$x]['format']['separate']);
                    for(
$y=0;$y<count($aFile);$y++){
                        
// make sure the structure is ok
                        
if(count($aFile[$y])!=$_CONTEXT['l_formats'][$x]['format']['items']){
                            
$_CONTEXT['log_analyze'] .= "                    <div>expecting ".$_CONTEXT['l_formats'][$x]['format']['items']." items on line ".$y." in ".$sDest."</div>\n";
                        }
                    }
                }
                else{
                    
// array based file
                    
include_once($sDest);
                    if(isset(
$_CONTEXT[$_CONTEXT['l_formats'][$x]['format']['root']])){
                        
// check all keys on existence
                        
for($y=0;$y<count($_CONTEXT['l_formats'][$x]['format']['keys']);$y++){
                            if(!isset(
$_CONTEXT[$_CONTEXT['l_formats'][$x]['format']['root']][$_CONTEXT['l_formats'][$x]['format']['keys'][$y][0]])){
                                
$_CONTEXT['log_analyze'] .= "                    <div>expecting variable \$_CONTEXT['".$_CONTEXT['l_formats'][$x]['format']['root']."']['".$_CONTEXT['l_formats'][$x]['format']['keys'][$y][0]."'] in ".$sDest."</div>\n";
                            }
                            else{
                                
$sType $_CONTEXT['l_formats'][$x]['format']['keys'][$y][1];
                                
// simple type check
                                
switch($sType){
                                    case
"string":
                                    if(!
is_string($_CONTEXT[$_CONTEXT['l_formats'][$x]['format']['root']][$_CONTEXT['l_formats'][$x]['format']['keys'][$y][0]])){
                                        
$_CONTEXT['log_analyze'] .= "                    <div>expecting string value for variable \$_CONTEXT['".$_CONTEXT['l_formats'][$x]['format']['root']."']['".$_CONTEXT['l_formats'][$x]['format']['keys'][$y][0]."'] in ".$sDest."</div>\n";
                                    }
                                    break;
                                    case
"integer":
                                    if(!
is_int($_CONTEXT[$_CONTEXT['l_formats'][$x]['format']['root']][$_CONTEXT['l_formats'][$x]['format']['keys'][$y][0]])){
                                        
$_CONTEXT['log_analyze'] .= "                    <div>expecting integer value for variable \$_CONTEXT['".$_CONTEXT['l_formats'][$x]['format']['root']."']['".$_CONTEXT['l_formats'][$x]['format']['keys'][$y][0]."'] in ".$sDest."</div>\n";
                                    }
                                    break;
                                    case
"array":
                                    if(!
is_array($_CONTEXT[$_CONTEXT['l_formats'][$x]['format']['root']][$_CONTEXT['l_formats'][$x]['format']['keys'][$y][0]])){
                                        
$_CONTEXT['log_analyze'] .= "                    <div>expecting array value for variable \$_CONTEXT['".$_CONTEXT['l_formats'][$x]['format']['root']."']['".$_CONTEXT['l_formats'][$x]['format']['keys'][$y][0]."'] in ".$sDest."</div>\n";
                                    }
                                    break;
                                }
                            }
                        }
                    }
                    else{
                        
$_CONTEXT['log_analyze'] .= "                    <div>expecting variable \$_CONTEXT['".$_CONTEXT['l_formats'][$x]['format']['root']."'] in ".$sDest."</div>\n";
                    }
                }
            }
        }
    }
    
$_CONTEXT['scandata']['log_analyze'] = $_CONTEXT['log_analyze'];
}
?>
powered by
site stats
cms statistics:
version: 0.6.0
downloads: 4380
native: 26
modules: 21
apps: 2
support development
It takes lots of calories in order to create new things for the hacksuite, so it would be grand if you could buy me a protein shake or extra energy to keep me going. Thanks!
disclaimer
We are not responsible for any direct or indirect damage caused by abusing the tools provided on hacksuite.com. The suite is developed for educational purposes, use at your own risk!
Created by Remco Kouw. Powered by protein shakes and a high calorie diet.