For those who are receiving an error message after adding the code to your mainfile.php
Find:
if (eregi("mainfile.php",$_SERVER['PHP_SELF'])) { // Current code
Header("Location: index.php"); // Current code
After, Add
}
**Notice** There is an open bracket, therefore all you need to do is add the close bracket and the error message disappear.
_________________ If you shoot for the moon and miss, you'll still be amongst the stars.
nuke-lux Premium
Joined: Aug 18, 2003
Posts: 41
Location: Luxembourg
Posted:
Sun May 23, 2004 12:34 pm
Here is my mainfile (www.nukecommunity.com/fortress.htm) but every time i attack my site i get back to index.php but nothing appears in my fortress.htm file?
Code:
/************************************************************************/
/* PHP-NUKE: Advanced Content Management System */
/* ============================================ */
/* */
/* Copyright (c) 2002 by Francisco Burzi */
/* http://phpnuke.org */
/* */
/* 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. */
/************************************************************************/
/* Additional security checking code 2003 by chatserv */
/* http://www.nukefixes.com -- http://www.nukeresources.com */
/************************************************************************/
//Nav Tap
include("includes/navtap.php");
$phpver = phpversion();
if ($phpver >= '4.0.4pl1' && strstr($HTTP_USER_AGENT,'compatible')) {
if (extension_loaded('zlib')) {
ob_end_clean();
ob_start('ob_gzhandler');
}
} else if ($phpver > '4.0') {
if (strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip')) {
if (extension_loaded('zlib')) {
$do_gzip_compress = TRUE;
ob_start();
ob_implicit_flush(0);
//header('Content-Encoding: gzip');
}
}
}
if (!ini_get("register_globals")) {
import_request_variables('GPC');
}
// Union Tap Code Final // Add this line
// Copyright 2004 // Add this line
// Paul Laudanski // Add this line
// http://computercops.biz // Add this line
// http://fortress.cc // Add this line
define('ZERO', true); // Add this line
include('fortress.php'); // Add this line
Bards($addr); // Add this line
foreach ($_GET as $secvalue) {
if ((eregi("<[^>]*script*\"?[^>]*>", $secvalue)) ||
(eregi("<[^>]*object*\"?[^>]*>", $secvalue)) ||
(eregi("<[^>]*iframe*\"?[^>]*>", $secvalue)) ||
(eregi("<[^>]*applet*\"?[^>]*>", $secvalue)) ||
(eregi("<[^>]*meta*\"?[^>]*>", $secvalue)) ||
(eregi("<[^>]*style*\"?[^>]*>", $secvalue)) ||
(eregi("<[^>]*form*\"?[^>]*>", $secvalue)) ||
(eregi("\([^>]*\"?[^)]*\)", $secvalue)) ||
(eregi("\"", $secvalue))) {
# die ("<center><img src=images/logo.gif><br><br><b>The html tags you attempted to use are not allowed</b><br><br>[ <a href=\"javascript:history.go(-1)\"><b>Go Back</b></a> ]");
$method = "BAD-TAGS"; // Add this line
$matches[1] = "BAD-TAGS"; // Add this line
AlertMail($method); // Add this line
AlertLog($method); // Add this line
}
}
foreach ($_POST as $secvalue) {
if ((eregi("<[^>]script*\"?[^>]*>", $secvalue)) || (eregi("<[^>]style*\"?[^>]*>", $secvalue))) {
die ("<center><img src=images/logo.gif><br><br><b>The html tags you attempted to use are not allowed</b><br><br>[ <a href=\"javascript:history.go(-1)\"><b>Go Back</b></a> ]");
}
}
ccheck(); // Add this line
ucheck(); // Add this line
ReleaseVars(); // Add this line
if (eregi("mainfile.php",$_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}
if ($forum_admin == 1) {
require_once("../../../config.php");
require_once("../../../db/db.php");
} elseif ($inside_mod == 1) {
require_once("../../config.php");
require_once("../../db/db.php");
} else {
require_once("config.php");
require_once("db/db.php");
/* FOLLOWING TWO LINES ARE DEPRECATED BUT ARE HERE FOR OLD MODULES COMPATIBILITY */
/* PLEASE START USING THE NEW SQL ABSTRACTION LAYER. SEE MODULES DOC FOR DETAILS */
require_once("includes/sql_layer.php");
$dbi = sql_connect($dbhost, $dbuname, $dbpass, $dbname);
}
Did you create the htm file or did you copy/paste it from the php file footer? Also, its not a good idea to include navtap in the beginning, you might want to move that down.
_________________ Paul Laudanski, Microsoft MVP Windows-Security
CastleCops: [de] [en] [wiki]
nuke-lux Premium
Joined: Aug 18, 2003
Posts: 41
Location: Luxembourg
Posted:
Sun May 23, 2004 12:39 pm
ok i removed the old unionTap files, but i still have the same problem, every time i do an union attack, nuke sends me back to index.php without performing the request, but the problem is there is also no entry in fortress.htm ? Every time i attack myself fortress doesn't ban me? Perhaps there is an error in fortress.htm, is it normal that there are no
Its ok that the end tags aren't there. They will never be because it'll be open to a continual append. However, read my reply in the news article to you.
_________________ Paul Laudanski, Microsoft MVP Windows-Security
CastleCops: [de] [en] [wiki]
nuke-lux Premium
Joined: Aug 18, 2003
Posts: 41
Location: Luxembourg
Posted:
Sun May 23, 2004 12:43 pm
Zhen-Xjell wrote:
Did you create the htm file or did you copy/paste it from the php file footer? Also, its not a good idea to include navtap in the beginning, you might want to move that down.
I did a copy from the footer, so here is my fortress.htm content:
Code:
<HTML><HEAD><TITLE>Fortress(TM) Alerts</TITLE></HEAD><style type="text/css">.ccops{ color : #FFFFFF; font-size : 10pt; font-family : Arial, Helvetica; }.fortress{ color : #000000; font-size : 10pt; font-family : Helvetica, Arial; }</STYLE><BODY><H2><SPAN style="FONT-FAMILY: Arial, Helvetica;">Fortress(TM) Alerts by Computer Cops - Energized by BanOnDemand(SM)</SPAN></H2><A HREF="http://computercops.biz">ComputerCops</a>: Global Security Solutions<BR><A HREF="http://fortress.cc">Fortress(TM)</a>: PHP CMS Security<BR></SPAN></H2>Server: <BR>Spreadsheet: <A HREF="/fortress.csv">fortress.csv</A><TABLE cellpadding=1 cellspacing=1 bgcolor="navy" width=100%><TR><TD><SPAN class="ccops">TIMESTAMP</SPAN></TD><TD><SPAN class="ccops">SUSPECT USERNAME</SPAN></TD><TD><SPAN class="ccops">REMOTE IP ADDRESS</SPAN></TD><TD><SPAN class="ccops">REMOTE PORT</SPAN></TD><TD><SPAN class="ccops">REMOTE USER-AGENTS</SPAN></TD><TD><SPAN class="ccops">REMOTE HOSTNAME</SPAN></TD><TD><SPAN class="ccops">SUSPECT AUTHOR</SPAN></TD><TD><SPAN class="ccops">REFERING SITE</SPAN></TD><TD><SPAN class="ccops">METHOD OF ATTACK</SPAN></TD><TD><SPAN class="ccops">URL USED FOR DELIVERY</SPAN></TD></TR>
and here is the .csv code:
Code:
TIMESTAMP,SUSPECT USERNAME,REMOTE IP ADDRESS,REMOTE PORT,REMOTE USER-AGENTS,REMOTE HOSTNAME,SUSPECT AUTHOR,REFERING SITE,METHOD OF ATTACK,URL USED TO DELIVERY
No need to remove navtap, just move it down down down in mainfile.php. Also, feel free to jump in and help me help others. I take it'll take a little time for everyone to come up to speed with the installation and use.
_________________ Paul Laudanski, Microsoft MVP Windows-Security
CastleCops: [de] [en] [wiki]
fyrfight Nuke Soldier
Joined: Aug 01, 2003
Posts: 17
Posted:
Sun May 23, 2004 1:26 pm
So chmod the csv file to 666 ?
Thinks are looking ok my way. Thanks for the new release.
fyrfight Nuke Soldier
Joined: Aug 01, 2003
Posts: 17
Posted:
Sun May 23, 2004 1:37 pm
Yep that did it.
It works, I banned myself.
nix Nuke Cadet
Joined: Dec 26, 2003
Posts: 7
Posted:
Sun May 23, 2004 1:49 pm
So what do we do when its not sending email or baning? All it does is send me back to the index.
I have giving premission to the two fiels. Checked the config, there is an email address in there.
fyrfight Nuke Soldier
Joined: Aug 01, 2003
Posts: 17
Posted:
Sun May 23, 2004 2:20 pm
Mine is banning but not sending an email.
Anyone else have same prob ?
Also regarding the fortress.htm just wondering how everyone is using that. Is there a way so I can be the only one to see it?
foxyfemfem Support Staff
Joined: Jan 23, 2003
Posts: 668
Location: USA
Posted:
Sun May 23, 2004 2:35 pm
@fyrfight
You can add fortress.htm & fortress.csv to a directory and password protect the directory.
(ie) Fortress (folder name that's password protective), add the two files, then edit the following two lines in fortress.php....
$fortfile = "fortress.csv"; // Change this to the full path and filename you want alerts logged to.
$forthtml = "fortress.htm"; // Change this to the full path and filename you want alerts in HTML format.
to something like this.....
$fortfile = "Fortress/fortress.csv"; // Change this to the full path and filename you want alerts logged to.
$forthtml = "Fortress/fortress.htm"; // Change this to the full path and filename you want alerts in HTML format.
I'm still playing around with the script to see what's going on with the email.
_________________ If you shoot for the moon and miss, you'll still be amongst the stars.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum