- Readme First! - Read and follow the rules, otherwise your posts will be closed
There are currently, 70 guest(s) and 0 member(s) that are online. You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - How to disable html filter? [ ]
Author
Message
nok1a
Nuke Cadet
Joined: Mar 30, 2007
Posts: 1
Posted:
Thu Mar 29, 2007 11:36 pm
I heed to disable php-nuke html filter.
i founded in mainfile.php this:
Code:
function check_html ($str, $strip="") {
/* The core of this code has been lifted from phpslash */
/* which is licenced under the GPL. */
include("config.php");
if ($strip == "nohtml")
$AllowableHTML=array('');
$str = stripslashes($str);
$str = eregi_replace("<[[:space:]]*([^>]*)[[:space:]]*>",'<\\1>', $str);
// Delete all spaces from html tags .
$str = eregi_replace("<a[^>]*href[[:space:]]*=[[:space:]]*\"?[[:space:]]*([^\" >]*)[[:space:]]*\"?[^>]*>",'<a href="\\1">', $str);
// Delete all attribs from Anchor, except an href, double quoted.
$str = eregi_replace("<[[:space:]]* img[[:space:]]*([^>]*)[[:space:]]*>", '', $str);
// Delete all img tags
$str = eregi_replace("<a[^>]*href[[:space:]]*=[[:space:]]*\"?javascript[[:punct:]]*\"?[^>]*>", '', $str);
// Delete javascript code from a href tags -- Zhen-Xjell @ http://nukecops.com
$tmp = "";
while (ereg("<(/?[[:alpha:]]*)[[:space:]]*([^>]*)>",$str,$reg)) {
$i = strpos($str,$reg[0]);
$l = strlen($reg[0]);
if ($reg[1][0] == "/") $tag = strtolower(substr($reg[1],1));
else $tag = strtolower($reg[1]);
if ($a = $AllowableHTML[$tag])
if ($reg[1][0] == "/") $tag = "</$tag>";
elseif (($a == 1) || ($reg[2] == "")) $tag = "<$tag>";
else {
# Place here the double quote fix function.
$attrb_list=delQuotes($reg[2]);
// A VER
//$attrb_list = ereg_replace("&","&",$attrb_list);
$tag = "<$tag" . $attrb_list . ">";
} # Attribs in tag allowed
else $tag = "";
$tmp .= substr($str,0,$i) . $tag;
$str = substr($str,$i+$l);
}
$str = $tmp . $str;
return $str;
exit;
/* Squash PHP tags unconditionally */
$str = ereg_replace("<\?","",$str);
return $str;
What i must do to disable this?
i try to comment it, but then nuke doesnt work
PS dont say me about adding tags in $AllowableHTML, i need to disable filter AT ALL.
Evaders99
Site Admin
Joined: Aug 17, 2003
Posts: 12397
Posted:
Tue Apr 03, 2007 7:16 pm
BlackCalvinist
Nuke Cadet
Joined: May 27, 2006
Posts: 3
Location: EC, MD
Posted:
Sat Apr 07, 2007 5:20 am
Is there a way to have it not strip the HTML and not be vulnerable ? I have several articles in the topics module on my site that had images, tables, etc.... no more.
_________________ LIVE Your Theology.
Theologically Correct dot Com
Evaders99
Site Admin
Joined: Aug 17, 2003
Posts: 12397
Posted:
Sat Apr 07, 2007 6:12 pm
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