random gallery image
random tutorial
preview

..will make a new module and not just some new module, nope let's make a fully automatic injection script! This tutorial is the first step into making this. Let's first explain what we're..

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
/* THC Dork GUI

Author: Remco Kouw
Site: http://www.hacksuite.com
Last Edit: 10-04-2015
*/
function WriteF($sDest,$sWrite,$sMode="a"){

    global 
$_CONTEXT;

    if(
$sMode!="a" && $sMode!="w"){
        
$sMode "a";
    }
    if(!
$rNew = @fopen($sDest,$sMode)){
        
// define the error
        
$_CONTEXT['errors'][] = "Failed to open file <b>".$sDest."</b> in <b>".$sMode."</b> mode";
        
$_CONTEXT['fatal'] = true;
        return(
false);
    }
    @
fputs($rNew,$sWrite);
    @
fclose($rNew);
    return(
true);
}
// set variable to be able to save a task
$_MODULE_C "thc_do";
include_once(
"../../Includes/screen_header.php");
include_once(
$_PATHS['style_root']."/screen.php");
include_once(
$_PATHS['functions_root']."/scrn.php");
// options
$sOptions "<b>logging:</b> ".($_CONTEXT['log']==true "on" "off")."<br>\n";
$sOptions .= "<b>silence:</b> ".($_CONTEXT['silent']==true "on" "off")."<br>\n";
$sOptions .= "<b>verbose:</b> ".($_CONTEXT['verbose']==true "on" "off")."\n";
// spit fire...
if(!isset($_POST['submit'])){
    echo 
$sOut;
    echo 
$sOptions;
    echo 
$sEnd;
    exit;
}
echo 
$sOut;
if(
$_POST['submit']!="Save" && $_POST['submit']!="View"){
    die(
Screen("<p><b>Invalid value for submission button</b><br>\n",$_CONTEXT['verbose'],$_CONTEXT['silent']));
}
// prepare the dork
$sDork = isset($_POST['sDork']) ? trim($_POST['sDork']) : "";
if(
$_POST['iMode']==&& $sDork==""){
    die(
Screen("<p><b>No search string specified</b><br>\n",$_CONTEXT['verbose'],$_CONTEXT['silent']));
}
elseif(
$sDork==""){
    
// ok we gotta have iDork
    
if(!isset($_POST['iDork']) || !is_numeric($_POST['iDork'])){
        die(
Screen("<p><b>No array index specified for dork data</b><br>\n",$_CONTEXT['verbose'],$_CONTEXT['silent']));
    }
    else{
        
$iDork intval($_POST['iDork']);
        include_once(
$_PATHS['includes_root']."/dorkssqlhandler.php");
        if(!isset(
$_CONTEXT['dorks'][$iDork])){
            die(
Screen("<p><b>Invalid array index for dork data</b><br>\n",$_CONTEXT['verbose'],$_CONTEXT['silent']));
        }
        
$sDork trim($_CONTEXT['dorks'][$iDork]);
    }
}
// get google dorking properties
include_once($_PATHS['module_default_root']."/gdork.php");
// dork formats
$_CONTEXT['google']['dorksafe'] = $sDork;
$_CONTEXT['google']['dorkout'] = htmlspecialchars($sDork);
$_CONTEXT['google']['dorkenc'] = urlencode($sDork);
$_CONTEXT['google']['query']['q'] = $_CONTEXT['google']['dorkenc'];
if(!isset(
$_CONTEXT['google'])){
    die(
Screen("<p><b>Properties for google dorking haven't been loaded</b><br>\n",$_CONTEXT['verbose'],$_CONTEXT['silent']));
}
$_CONTEXT['google']['harvest'] = array();
$_CONTEXT['google']['max'] = $_POST['iAmount']==-10 intval($_POST['iAmount']);
// construct rest of the search url
foreach($_CONTEXT['google']['query'] as $sParameter=>$sValue){
    
$_CONTEXT['google']['searchurl'] .= $sParameter."=".$sValue."&";
}
$_CONTEXT['google']['searchurl'] = substr($_CONTEXT['google']['searchurl'],0,-1);
// its part of the query but is dynamic
$_CONTEXT['google']['query']['start'] = 0;
include_once(
$_PATHS['includes_root']."/task_start.php");
echo 
Screen("<p><b><u>querying google for ".$_CONTEXT['google']['dorkout'].":</b></u><br>\n",$_CONTEXT['verbose'],$_CONTEXT['silent']);
flush();
ob_flush();
// we'll loop through pages till we extracted enough results or there are no (more) results
while(true){
    
// get results in google
    
$_CONTEXT['google']['searchurldyn'] = $_CONTEXT['google']['searchurl'].($_CONTEXT['google']['query']['start']=="" "&start=".$_CONTEXT['google']['query']['start']);
    
$ch = @curl_init();
    @
curl_setopt($chCURLOPT_URL$_CONTEXT['google']['searchurldyn']);
    @
curl_setopt($chCURLOPT_FOLLOWLOCATION1);
    @
curl_setopt($chCURLOPT_RETURNTRANSFER1);
    @
curl_setopt($chCURLOPT_USERAGENT$_CONTEXT['google']['agent']);
    @
curl_setopt($chCURLOPT_TIMEOUT$_CONTEXT['google']['timeout']);
    @
curl_setopt($chCURLOPT_REFERER$_CONTEXT['google']['referer']['dynamic']);
    
$sResult = @curl_exec($ch);
    
curl_close($ch);
    
// extract results...provided we have any..
    
preg_match_all($_CONTEXT['google']['regexes']['linkharvest'],$sResult,$aResults);
    if(
false==($iResults count($aResults[1]))){
        echo 
Screen("<p><b>aborting indexing, no results on page ".$_CONTEXT['google']['page']."</b><br>\n",$_CONTEXT['verbose'],$_CONTEXT['silent']);
        break;
    }
    
// importing results
    
$bAbort false;
    for(
$x=0;$x<$iResults;$x++){
        
$aResults[1][$x] = substr($aResults[1][$x],7,strpos($aResults[1][$x],"&amp;s")-7);
        
$_CONTEXT['google']['harvest'][] = $aResults[1][$x];
        echo 
Screen("<b>".$aResults[1][$x]."</b><br>\n",$_CONTEXT['verbose'],$_CONTEXT['silent']);
        if(
count($_CONTEXT['google']['harvest'])==$_CONTEXT['google']['max']){
            
$bAbort true;
            break;
        }
    }
    if(
$bAbort){
        echo 
Screen("<p><b>aborting indexing, found <b>".count($_CONTEXT['google']['harvest'])."</b> results in Google</b><br>\n",$_CONTEXT['verbose'],$_CONTEXT['silent']);
        break;
    }
    else{
        echo 
Screen("<p><u><b>result page ".$_CONTEXT['google']['page']." returned ".$iResults." url".($iResults!="s" "")."</b></u><br>\n",$_CONTEXT['verbose'],$_CONTEXT['silent']);
        
flush();
        
ob_flush();
    }
    
// so do we have a next page?
    
if(!preg_match($_CONTEXT['google']['regexes']['multipg'],$sResult,$aMatches)){
        
sleep(1);
        echo 
Screen("<p><b>aborting indexing, no more pages after page ".$_CONTEXT['google']['page']."</b><br>\n",$_CONTEXT['verbose'],$_CONTEXT['silent']);
        break;
    }
    
// onto the next page
    
$_CONTEXT['google']['page']++;
    
$_CONTEXT['google']['query']['start'] = count($_CONTEXT['google']['harvest']);
    
// ok so we'll use this current search page as referer for the next call
    
$_CONTEXT['google']['referer']['dynamic'] = $_CONTEXT['google']['searchurldyn'];
}
$sResults "";
if(
count($_CONTEXT['google']['harvest'])>1){
    
$sResults implode("<br />\n",$_CONTEXT['google']['harvest']);
}
elseif(isset(
$_CONTEXT['google']['harvest'][0])){
    
$sResults $_CONTEXT['google']['harvest'][0];
}
$sResults trim($sResults);
if(
$_POST['submit']=="View"){
    
// view results
    
echo $sResults;
}
elseif(
$_POST['submit']=="Save"){
    
// save results
    
$iSave intval($_POST['iSave']);
    
$iTime time();
    
$sSaveFile $_PATHS['module_default_root']."/RESULTS/".$iTime.".txt";
    if(
$iSave==1){
        
// save dork
        
$sDorkFile $_PATHS['data_root']."/googledorks.txt";
        
WriteF($sDorkFile,(filesize($sDorkFile)>"\n" "").$_CONTEXT['google']['dorksafe'],"a");
    }
    
// save results
    
WriteF($sSaveFile,strip_tags($sResults),"w");
}
// update entry in background task file
include_once($_PATHS['includes_root']."/task_end.php");
echo 
$sEnd;
?>
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.