..create a different index page for the suite. It's very easy because the only thing you need to do is change the content of default.php. I don't want to create something like hello..
THC Sscan is a very versatile tool for scanning (html) files
<?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']==1 && $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']==-1 ? 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']==0 ? "" : "&start=".$_CONTEXT['google']['query']['start']);
$ch = @curl_init();
@curl_setopt($ch, CURLOPT_URL, $_CONTEXT['google']['searchurldyn']);
@curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
@curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
@curl_setopt($ch, CURLOPT_USERAGENT, $_CONTEXT['google']['agent']);
@curl_setopt($ch, CURLOPT_TIMEOUT, $_CONTEXT['google']['timeout']);
@curl_setopt($ch, CURLOPT_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],"&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!=1 ? "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)>0 ? "\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;
?>