grrrr

Started on the old forum in October 2010 · view the original in the archive · old links redirect here

8 replies · 496 views · started 16 years ago · 1 min read

5 participants
nclemale36 Lead · 537 posts #1

i thought i had this covered but seems not.

else if($action=="uprof")
{
    addonline(getuid_sid($sid),"Updating Settings","");
    $savat = mysql_real_escape_string($_POST["savat"]);
    $semail = mysql_real_escape_string($_POST["semail"]);
    $ubday = mysql_real_escape_string($_POST["ubday"]);
    $uloc = mysql_real_escape_string($_POST["uloc"]);
    $usig = mysql_real_escape_string($_POST["usig"]);
    $usex = mysql_real_escape_string($_POST["usex"]);
    $ms = mysql_real_escape_string($_POST["ms"]);
/////////////////////

function mysql_real_escape_string($string) 
{
 $badWords = "(delete)|(update)|(union)|(insert)| (drop)|(http)|(--)|(>)|(<)|(&)|(#)"; 
 $string = eregi_replace($badWords, "", $string);

 $string = mysql_real_escape_string($string); 

return $string;
 }
/////////////////////////////

just had some muppet update all my location and emails to this site always gets hacked.

last person that did this was huwad or his mates .

why dont the codes i got in place stop this ? ? ?

subzero Super moderator Fellow · 3,954 posts #2

block ' , in inputs 🙂

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

opticalpigion Lead · 593 posts #4

nclemale36 wrote: so add (,) to

$badWords = "(delete)|(update)|(union)|(insert)| (drop)|(http)|(--)|(>)|(<)|(&)|(#)";

???

function clean($str) { 
        $str = @trim($str); 
        if(get_magic_quotes_gpc()) { 
            $str=htmlspecialchars($str);                        
            $str=stripslashes(trim($str)); 
            $search=array("\\","\0","\n","\r","\x1a","'",'"'); 
            $replace=array("\\\\","\\0","\\n","\\r","\Z","\'",'\"'); 
            $str = str_replace($search,$replace,$str); 
        } 
        return mysql_real_escape_string($str); 
    } 
thanatos Senior · 261 posts #6

sanitize the query where the browser and ip gets updated.

CreativityKills Lead · 833 posts #7
function sanitize($value, $escape = FALSE)
{
 if(is_array($value) OR is_object($value))
 {
  foreach($value as $k => $v)
  {
   // Handle recursively
   $value[$k] = sanitize($v, (bool) $escape);
  }
 }
 elseif(is_string($value))
 {
   if(get_magic_quotes_gpc())
  {
    $value = stripslashes($value);
  }

  if(strpos($value, "\r") === TRUE)
  {
   $value = str_replace(array("\r\n", "\n"), "\n", $value);
  }

 return ($escape) ? mysql_real_escape_string($value) : $value;
 }
}

$_GET = sanitize($_GET);
$_POST = sanitize($_POST);
$_COOKIE = sanitize($_COOKIE);

Added after 2 minutes:

and oh i just noticed your function name is a reserved php function, thats stupid.

Sign in to reply.

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close