Joined: Aug 27, 2002 Posts: 16976 Location: Kansas
Posted:
Tue Oct 14, 2003 1:16 pm
To fix the admin.php security exploit, you need to edit admin.php. Your beginning code in admin.php will look something like this
Code:
<?php
/************************************************************************/
/* 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. */
/************************************************************************/
require_once("mainfile.php");
get_lang(admin);
Modify it to look like this
Code:
<?php
/************************************************************************/
/* 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. */
/************************************************************************/
$nastyGram = "<center>::<br />Thanks for providing me with your connection information!<br />You have been caught attempting to break into my site and appropriate action will be taken.<br />::</center>";
$myPHPVersion = str_replace('.','',phpversion());
if ($myPHPVersion>=410) $checkMyUrl = $_SERVER['REQUEST_URI'];
else $checkMyUrl = getenv("REQUEST_URI");
if (preg_match("/\?admin/", "$checkMyUrl")) {
require_once("mainfile.php");
include("header.php");
OpenTable();
echo $nastyGram;
CloseTable();
include "footer.php";
die();
}
require_once("mainfile.php");
get_lang(admin);
The $nastyGram variable can be modified to be whatever you want it to. You could display a message and then relocate them to the FBI page for something novel .
Oops, I said admin(s) what I meant to say is that a site administrator(s) that has just had this exploit or one like it, run on her/his patched site, by someone other than himself/herself, could probably benefit from knowing about the incident sooner rather than later.
For instance, it might be useful for that site administrator to be notified via e-mail or instant message, with the connection information and details of visitors that have been presented with the $nastyGram on their site(s). In this way they could manually take action, if that was what they wanted to do.
Another idea that comes to mind is the following:
If the ip address of the visitor that has been presented with the $nastyGram is not equal that of the true site administrator, then the ip address of that visitor might be automatically banned?
I do not have the skills required to implement the above ideas at this time, I am Just thinking out loud.
What is the difference between these two fixes to the admin.php? Is all that stuff in the other code really necessary to fix the problem being addressed?
Your fix
Code:
$nastyGram = "<center>::<br />Thanks for providing me with your connection information!<br />You have been caught attempting to break into my site and appropriate action will be taken.<br />::</center>";
$myPHPVersion = str_replace('.','',phpversion());
if ($myPHPVersion>=410) $checkMyUrl = $_SERVER['REQUEST_URI'];
else $checkMyUrl = getenv("REQUEST_URI");
if (preg_match("/\?admin/", "$checkMyUrl")) {
require_once("mainfile.php");
include("header.php");
OpenTable();
echo $nastyGram;
CloseTable();
include "footer.php";
die();
}
require_once("mainfile.php");
get_lang(admin);
Fix posted at the other site.....
Code:
$checkmyurl = getenv("REQUEST_URI");
if (preg_match("/\?admin/", "$checkmyurl")) {
echo "die";
exit;
}
require_once("mainfile.php");
get_lang(admin);
Only registered users can see links on this board! Get registered or login to the forums!
It protects admin IPs and you can also assign members to the protection.
It autobans and gives you the option to add more, tracks ips, who/where online, how long, reverse lookup, etc..
Oh, I can attest to the efficacy of the Protector! I have it on my site and just from idle, mindless curiosity I ran Raven's snippet above and behold I banned myself.
{ edited by admin at user's request }
Go ahead, click that link. I dare you! Now I have to figure out how to unban myself, any ideas?
Last edited by southern on Tue Aug 21, 2007 7:43 pm; edited 1 time in total
Joined: Apr 27, 2009 Posts: 21 Location: The Netherlands
Posted:
Sat Jul 18, 2009 1:44 am
Raven wrote:
To fix the admin.php security exploit, you need to edit admin.php. Your beginning code in admin.php will look something like this
Code:
<?php
/************************************************************************/
/* 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. */
/************************************************************************/
require_once("mainfile.php");
get_lang(admin);
Modify it to look like this
Code:
<?php
/************************************************************************/
/* 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. */
/************************************************************************/
$nastyGram = "<center>::<br />Thanks for providing me with your connection information!<br />You have been caught attempting to break into my site and appropriate action will be taken.<br />::</center>";
$myPHPVersion = str_replace('.','',phpversion());
if ($myPHPVersion>=410) $checkMyUrl = $_SERVER['REQUEST_URI'];
else $checkMyUrl = getenv("REQUEST_URI");
if (preg_match("/\?admin/", "$checkMyUrl")) {
require_once("mainfile.php");
include("header.php");
OpenTable();
echo $nastyGram;
CloseTable();
include "footer.php";
die();
}
require_once("mainfile.php");
get_lang(admin);
The $nastyGram variable can be modified to be whatever you want it to. You could display a message and then relocate them to the FBI page for something novel .
Code:
translated to dutch:
<?php
/************************************************************************/
/* 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. */
/************************************************************************/
$nastyGram = "<center>::<br />Dank voor het leggen van deze verbinding!<br />You Alleen je hebt nu een probleem, je ben aangemeld als hacking athempt.<br />::</center>";
$myPHPVersion = str_replace('.','',phpversion());
if ($myPHPVersion>=410) $checkMyUrl = $_SERVER['REQUEST_URI'];
else $checkMyUrl = getenv("REQUEST_URI");
if (preg_match("/\?admin/", "$checkMyUrl")) {
require_once("mainfile.php");
include("header.php");
OpenTable();
echo $nastyGram;
CloseTable();
include "footer.php";
die();
}
require_once("mainfile.php");
get_lang(admin);
Last edited by sebastiaan on Sat Jul 18, 2009 2:32 am; edited 1 time in total
View next topic View previous topic
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