random gallery image
random tutorial
preview

..one or more 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..

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
/* Recovers default values for test server configuration files

Author: Remco Kouw
Site: http://www.hacksuite.com
Last Edit: 08-03-2015
*/
if(!defined('IN_SCRIPT')){
    exit;
}
$_CONTEXT['subtitle'] = "Recover Configuration";
if(isset(
$_POST['sConfigFile'])){
    
// form submitted..
    
$sDest $_PATHS['properties_root']."/".trim($_POST['sConfigFile']);
    (!
IsThere($sDest) ? include_once($_PATHS['end']) : include_once($sDest));
    
// get the properties file
    
$sData "";
    foreach(
$_PROPERTIES as $sVar=>$aValues){
        
$sData .= $sVar."|".str_replace("|","&#166;",str_replace("\n"," ",$aValues['default_value']))."\n";
    }
    if(
$sData==""){
        
$_CONTEXT['errors'][] = "Unexpected or no data in properties file";
        include_once(
$PATHS['end']);
    }
    else{
        
$sDest $_PATHS['functions_root']."/fwrite.php";
        (!
IsThere($sDest) ? include_once($_PATHS['end']) : include_once($sDest));
        
// update the file's content or create a new file if it's not present
        
if(!WriteF($_PATHS['config_root']."/".$_POST['sConfigFile'],$sData,"w")){
            include_once(
$_PATHS['end']);
        }
        
$sCode .= "<div class=\"spacingmsg\">".$_CONTEXT['result_headers']['result']."Update succeeded, click <a href=\"javascript:history.back();\">here</a> to go back</div>\n";
    }
}
else{
    
/* ok let's get all files in the Properties directory */
    
$sDest $_PATHS['functions_root']."/getfilebydir.php";
    (!
IsThere($sDest) ? include_once($_PATHS['end']) : include_once($sDest));
    
$sSelect "";
    if(
false!==($aFiles GetFilesByDirectory($_PATHS['config_root']))){
        for(
$x=0;$x<count($aFiles);$x++){
            
// buffer the files we need
            
if($aFiles[$x]!="index.php"){
                
$sSelect .= "<option value=\"".$aFiles[$x]."\"".($sSelect!="" "" " selected").">".$aFiles[$x]."</option>\n";
            }
        }
        
// setup configuration file selection form
        
$sSelect "<select name=\"sConfigFile\">\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\">Recover test server configuration files</div>\n";
        
$sCode .= "                <div class=\"cc_record\">\n";
        
$sCode .= "                    <div class=\"flt pad3 w150\">select a 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=\"Recover File\" /></div>\n";
        
$sCode .= "                </div>\n";
        
$sCode .= "                <div class=\"clear\"></div>\n";
        
$sCode .= "            </div>\n";
        
$sCode .= "            </form>\n";
    }
    else{
        
$sCode .= "<div class=\"spacingmsg\">".$_CONTEXT['result_headers']['error']."No files in the properties directory</div>\n";
    }
}
?>
powered by
site stats
cms statistics:
version: 0.6.0
downloads: 3921
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.