Subversion Repositories ALCASAR

Rev

Go to most recent revision | Blame | Last modification | View Log

<?php
/*
 * firewall Eyes
 * Copyright (C) 2004 Creabilis
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or (at
 * your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 */
include("configuration.php");
include("include.php");

// authentification check
authenticationCheck();

// Date in the past
header("Expires: Mon, 26 Jul 2009 00:00:00 GMT");

// always modified
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
 
// HTTP/1.1
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);

// HTTP/1.0
header("Pragma: no-cache");

set_time_limit (120);

// GET INPUT
$type=stripslashes($_GET["type"]);
$p1=stripslashes($_GET["p1"]);

$tool=stripslashes($_GET["tool"]);

$toolsArray=$tools[$type];


$maxWidth=0;
for($i=0; $i<count($logFields); $i++) {
        $maxWidth+=$logFields[$i][2];
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
        <head>
                <title>informations</title>
                <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
                <link href="log.css" rel="stylesheet" type="text/css"/>
        </head>

        <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" bgcolor="#FFFFFF">
<div align="left" style="padding-left:18px">
<table border="0" cellpadding="0" cellspacing="0" width="<?=$maxWidth?>">
<tr>
        <td class="toolBox">
                <form method="GET" action="info.php">
                        <br/>
                        <b>Informations on </b>
                        <input type="text" name="p1" class="inputText" maxlength="100" value="<?=htmlentities(stripslashes($p1))?>">
                        <input type="hidden" name="type" value="<?=htmlentities(stripslashes($type))?>">
                        <br/><br/>&nbsp;
                        <?php
                        foreach($toolsArray as $toolName=>$toolInfos) {
                                ?>
                                <input class="toolbutton" type="submit" name="tool" value="<?=htmlentities($toolName)?>">&nbsp;&nbsp;
                                <?php
                        }
                        ?>
                </form>
        </td>
</tr>
</table>
<?php
flush();
if($tool) {
        if($toolsArray[$tool]["type"]=="command") {
                $myCommand=$toolsArray[$tool]["value"];
                $myparam=$p1;
                if($toolsArray[$tool]["precompute"]=="extractdomain") {
                        if (preg_match("/\d+\.\d+\.\d+\.\d+/", $p1)) { // it's an ip address
                                $myparam=$p1;
                        } else {
                                $myparam=substr(strstr($p1,"."),1); // remove first part of canonical name
                        }
                }
                $myCommand=str_replace("%p1%",$myparam,$myCommand);
        }
        if($toolsArray[$tool]["type"]=="url") {
                $myCommand=$toolsArray[$tool]["value"];
                $myCommand=str_replace("%p1%",urlencode($p1),$myCommand);

        }
?>
<br/>
<table border="0" cellpadding="0" cellspacing="0" width="<?=$maxWidth?>">
<tr>
        <td class="toolCommandBoxHeader">
         <?php
                if($toolsArray[$tool]["type"]=="url") {
                ?>
                        <a style="color: #FFFFFF" href="<?=$myCommand?>" target="q"><?=$myCommand?></a>
                <?php
                } else {
                        echo($myCommand);
                }
         
                ?>
                
        </td>
</tr>
</table>
<?php
flush();
?>
<table border="0" cellpadding="0" cellspacing="0" width="<?=$maxWidth?>">
<tr>
        <td class="toolCommandBox">
                <?php
        if($toolsArray[$tool]["type"]=="command") {
                echo("<pre>");
                passthru(escapeshellcmd($myCommand));
                echo("</pre>");
        }
        if($toolsArray[$tool]["type"]=="url") {
                ?>
                <iframe name="window_recherche_affaire_resultat" src="<?=$myCommand?>" width="<?=$maxWidth+5?>" height="750"  FRAMEBORDER=0>
                Your browser doesn't support iframe, unable to get url.
                </iframe>
                <?php
        }
                ?>
        </td>
</tr>
</table>
<?php
}
?>
<br>
<table border="0" cellpadding="0" cellspacing="0" width="<?=$maxWidth?>" class="footer">
  <tr>
        <td align="center">
        <A HREF="http://www.creabilis.com" target="creabilis">Firewall Eyes</A> - <A HREF="http://www.gnu.org/licenses/gpl.html">GPL</A> - Creabilis © 2004 - Web site : <A HREF="http://firewalleyes.creabilis.com">http://firewalleyes.creabilis.com</A>
        </td>
  </tr>
</table>
</div>
</body>
</html>