random gallery image
random tutorial
preview

..modules you must have seen the iframes used for realtime result display. In this tutorial I'm going to show you how to insert them into your module and how they function. what we..

read more

random debugging
xAnalyze

xAnalyze is a module that can search through corrupt data and configuration files in order to find the exact position of errors

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
/* Log viewer and cleaner

Author: Remco Kouw
Site: http://www.hacksuite.com
Last Edit: 10-03-2015
*/
if(!defined('IN_SCRIPT')){
    exit;
}
$_CONTEXT['subtitle'] = "Log Viewer";
// target files we need, so make sure they are present
$aFiles = array($_PATHS['functions_root']."/raw_to_array.php",$_PATHS['functions_root']."/getfilebydir.php",$_PATHS['functions_root']."/fwrite.php");
for(
$x=0;$x<count($aFiles);$x++){
    (!
IsThere($aFiles[$x]) ? include_once($_PATHS['end']) : include_once($aFiles[$x]));
}
// no need to go on if there are no files in the log directory
if(false==($aFiles GetFilesByDirectory($_PATHS['log_root'],0))){
    
$_CONTEXT['errors'][] = "No log files in <b>".$_PATHS['log_root']."</b>";
    include_once(
$_PATHS['end']);
}
include(
$_PATHS['data_root']."/logsdata.php");
// validate whether we have valid log files and data structures
if(count($_CONTEXT['l_formats'])==($iFiles = @count($aFiles))){
    if(isset(
$_POST['sErase'])){
        
$_POST['sLog'] = $_POST['sErase'];
    }
    
$_CONTEXT['logmatch'] = 0;
    for(
$x=0;$x<$iFiles;$x++){
        if(
in_array($_CONTEXT['l_formats'][$x]['file'],$aFiles)){
            
$_CONTEXT['logmatch']++;
            if(isset(
$_POST['sLog']) && $_POST['sLog']==$_CONTEXT['l_formats'][$x]['file']){
                
$_CONTEXT['arraykey'] = $x;
                if(
$_CONTEXT['l_formats'][$_CONTEXT['arraykey']]['format']['type']=="array"){
                    
$_CONTEXT['arraydata'] = true;
                }
            }
        }
    }
    if(
$_CONTEXT['logmatch']!=$iFiles){
        
$_CONTEXT['errors'][] = ($iFiles>$_CONTEXT['logmatch'] ? "One or more files aren't configured" "One or more log files missing, check data")." in <b>".$_PATHS['data_root']."/logsdata.php</b>";
        
$_CONTEXT['fatal'] = true;
        include_once(
$_PATHS['end']);
    }
}
else{
    
$_CONTEXT['errors'][] = "Log files don't correspond with content in <b>".$_PATHS['data_root']."/logsdata.php</b>";
    
$_CONTEXT['fatal'] = true;
    include_once(
$_PATHS['end']);
}
if(isset(
$_POST['sErase'])){
    
// erase data
    
$sDest ExploitFilter($_PATHS['log_root']."/".$_POST['sErase'],0,1);
    if(!
file_exists($sDest)){
        
$_CONTEXT['errors'][] = "Log file doesn't exist";
        include_once(
$_PATHS['end']);
    }
    if(isset(
$_CONTEXT['arraydata'])){
        
$sCode .= "<div class=\"spacingmsg\">".$_CONTEXT['result_headers']['error']."Only plain text files can be truncated</div>";
    }
    else{
        
$sCode .= "<div class=\"spacingmsg\">".$_CONTEXT['result_headers']['result'].(WriteF($sDest,"","w") ? "Removed log file data" "Failed to clear logfile")."</div>";
    }
}
if(isset(
$_POST['sLog'])){
    
// form submitted, let's see if the log exists and if so get it's content
    
$sDest ExploitFilter($_PATHS['log_root']."/".$_POST['sLog'],0,1);
    if(!
file_exists($sDest)){
        
$_CONTEXT['errors'][] = "Log file doesn't exist";
        include_once(
$_PATHS['end']);
    }
    if(isset(
$_CONTEXT['arraydata'])){
        
// treat output as a single dimension array
        
include(ExploitFilter($sDest,0,1));
        if(isset(
$_CONTEXT['l_formats'][$_CONTEXT['arraykey']]['format']['keys']) && is_array($_CONTEXT['l_formats'][$_CONTEXT['arraykey']]['format']['keys'])){
            
$sCode .= "            <div class=\"emboss borderr5 border1pxtrans pad5 edgeglow overflw\">\n";
            
$sCode .= "                <div class=\"embosshdrnocenter border1pxtrans pad10\">log view for ".$_POST['sLog']."</div>\n";
            for(
$x=0;$x<count($_CONTEXT['l_formats'][$_CONTEXT['arraykey']]['format']['keys']);$x++){
                
$sCode .= "                <div class=\"overflw blk\">\n";
                
$sCode .= "                    <div class=\"w150 pad5 flt\"><b>\n";
                
$sTemp "";
                
$sCode .= str_replace("_"," ",$_CONTEXT['l_formats'][$_CONTEXT['arraykey']]['format']['keys'][$x][0])."</b></div>\n";
                
$sCode .= "                    <div class=\"w200 pad5 flt\">\n";
                if(
$_CONTEXT['l_formats'][$_CONTEXT['arraykey']]['format']['keys'][$x][1]=="array"){
                    for(
$y=0;$y<count($_CONTEXT[$_CONTEXT['l_formats'][$_CONTEXT['arraykey']]['format']['root']][$_CONTEXT['l_formats'][$_CONTEXT['arraykey']]['format']['keys'][$x][0]]);$y++){
                        if(
$y!=0){
                            
$sTemp .= ",";
                        }
                        
$sTemp .= $_CONTEXT[$_CONTEXT['l_formats'][$_CONTEXT['arraykey']]['format']['root']][$_CONTEXT['l_formats'][$_CONTEXT['arraykey']]['format']['keys'][$x][0]][$y];
                    }
                    
$sCode .= "                ".$sTemp;
                }
                else{
                    
$sCode .= trim($_CONTEXT[$_CONTEXT['l_formats'][$_CONTEXT['arraykey']]['format']['root']][$_CONTEXT['l_formats'][$_CONTEXT['arraykey']]['format']['keys'][$x][0]]);
                }
                
$sCode .= "            </div>\n";
                
$sCode .= "        </div>\n";
                
$sCode .= "        <div class=\"clear\"></div>\n";
            }
            
$sCode .= "        </div>\n";
        }
    }
    else{
        
// plain text
        
$sDest $_PATHS['log_root']."/".$_POST['sLog'];
        if(@
filesize($sDest)>0){
            
$aData RawToArray($sDest);
            
$iData = @count($aData);
            
$sForm = ($iData>"<p><div><form method=\"post\"><input type=\"hidden\" name=\"iCFG\" value=\"".$_POST['iCFG']."\" /><input type=\"hidden\" name=\"sErase\" value=\"".$_POST['sLog']."\" /><input type=\"submit\" name=\"submit\" value=\"Clear\" /></form></p></div>" "");
            if(
$sForm!=""){
                
$sCode .= "            <div class=\"emboss borderr5 border1pxtrans pad5 edgeglow overflw\">\n";
                
$sCode .= "                <div class=\"embosshdrnocenter border1pxtrans pad10\">log view for ".$_POST['sLog']."</div>\n";
                
// html headers
                
for($x=0;$x<count($_CONTEXT['l_formats'][$_CONTEXT['arraykey']]['format']['labels']);$x++){
                    if(
$x==0){
                        
$sCode .= "                <div class=\"overflw blk\">\n";
                        
$sCode .= "                    <div class=\"pad5 flt w70\"><b>row</b></div>\n";
                    }
                    
$sCode .= "                    <div class=\"pad5 flt ".($_CONTEXT['l_formats'][$_CONTEXT['arraykey']]['format']['labels'][$x]=="error" "w150" "w125")."\"><b>".str_replace("_"," ",$_CONTEXT['l_formats'][$_CONTEXT['arraykey']]['format']['labels'][$x])."</b></div>\n";
                }
                
$sCode .= "                </div>\n";
                
$sCode .= "                <div class=\"clear\"></div>\n";
                
// dump each row
                
for($x=0;$x<$iData;$x++){
                    
$sCode .= "                <div class=\"overflw blk\">\n";
                    
$sCode .= "                    <div class=\"pad5 flt w70\">".($x+1)."</div>\n";
                    for(
$y=0;$y<count($aData[$x]);$y++){
                        
$sCode .= "                    <div class=\"pad5 flt ".($_CONTEXT['l_formats'][$_CONTEXT['arraykey']]['format']['labels'][$y]=="error" "w150" "w125")."\">".trim($aData[$x][$y])."</div>\n";
                    }
                    
$sCode .= "                </div>\n";
                    
$sCode .= "                <div class=\"clear\"></div>\n";
                }
                
$sCode .= "        </div>\n";
            }
            else{
                
$sCode .= "<div class=\"spacingmsg\">".$_CONTEXT['result_headers']['result']."No data in logfile ".$_POST['sLog']."</div>";
            }
        }
        else{
            
$sCode .= "<div class=\"spacingmsg\">".$_CONTEXT['result_headers']['result']."No data in logfile ".$_POST['sLog']."</div>";
        }
    }
}
else{
    
// output the templates that are available
    
$sSelect "<select name=\"sLog\">\n";
    for(
$x=0;$x<count($aFiles);$x++){
        
// let's make the file selection menu
        
$sSelect .= "<option value=\"".$aFiles[$x]."\">".$aFiles[$x]."</option>\n";
    }
    
$sSelect .= "</select>\n";
    
$sCode .= "            <form method=\"post\">\n";
    
$sCode .= "            <div class=\"emboss borderr5 border1pxtrans pad5 edgeglow overflw\">\n";
    
$sCode .= "                <div class=\"embosshdrnocenter border1pxtrans pad10\">Make a dump of your hacksuite log files</div>\n";
    
$sCode .= "                <div class=\"cc_record\">\n";
    
$sCode .= "                    <div class=\"flt pad3 w150\">log file:</div><div class=\"flt pad3\">".$sSelect."</div>\n";
    
$sCode .= "                </div>\n";
    
$sCode .= "                <div class=\"clear\"></div>\n";
    
$sCode .= "                <div class=\"cc_record\">\n";
    
$sCode .= "                    <div class=\"flt pad3\"><input type=\"hidden\" name=\"iCFG\" value=\"".$_POST['iCFG']."\" /><input type=\"submit\" name=\"send\" value=\"Check Log\" /></div>\n";
    
$sCode .= "                </div>\n";
    
$sCode .= "                <div class=\"clear\"></div>\n";
    
$sCode .= "            </div>\n";
    
$sCode .= "            </form>\n";
}
?>
powered by
site stats
cms statistics:
version: 0.6.0
downloads: 3840
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.