How Updated is this Anti SQl

Results 1 to 5 of 5
  1. #1
    人◕ ‿‿ ◕人 Forean is offline
    MemberRank
    Jul 2008 Join Date
    1,183Posts

    How Updated is this Anti SQl

    Like title says How Updated is this Anti SQL
    PHP Code:
    <?
    //Anti SQL injection.
    function antisql($sql)
    {
    // Remove words that contain SQL syntax
    $sql preg_replace(sql_regcase("/(from|update|set|character|clan|account|name|opened|serverstatus|indexcontent|account|level|select|insert|delete|where|drop table|show tables|#|\|*|--|\\\\)/"),"",$sql); //Replaces some parts of a SQL query with absolutely nothing.
    $sql trim($sql); //antisqls up spaces
    $sql strip_tags($sql);//Php and html tags strip
    $sql addslashes($sql);//Adds backslashes to one string
    $sql stripcslashes($sql); //Un-quote string quoted with addcslashes
    //$sql = stripslashes($sql); //Un-quotes a quoted string
    $sql htmlspecialchars($sql); //Convert special characters to HTML entities
    //$sql = quotemeta($sql); //Quote meta characters
    return $sql;
    }
    ?>


  2. #2
    Account Upgraded | Title Enabled! Torsen is offline
    MemberRank
    Jan 2009 Join Date
    294Posts

    Re: How Updated is this Anti SQl

    Do you even know what a SQL injection is==

  3. #3
    Account Upgraded | Title Enabled! Guy is offline
    MemberRank
    Apr 2009 Join Date
    919Posts

    Re: How Updated is this Anti SQl

    This sample doesn't stop SQL injection in MSSQL.

  4. #4
    人◕ ‿‿ ◕人 Forean is offline
    MemberRank
    Jul 2008 Join Date
    1,183Posts

    Re: How Updated is this Anti SQl

    Quote Originally Posted by TidusXIII View Post
    Do you even know what a SQL injection is==


    yes i do actualy. i wanted to know if this was a good anti for it. a friend sent to me and i wanted to know if it was.

  5. #5
    Account Upgraded | Title Enabled! Guy is offline
    MemberRank
    Apr 2009 Join Date
    919Posts

    Re: How Updated is this Anti SQl

    There haven't been any new disclosures for SQL injection relating to MSSQL in years! There's no reason for it to be "updated", this fallacy was just caused because of WizKid's overall lack-of knowledge pertaining to sanitizing data being entered into a MSSQL query.

    I've made some posts detailing the proper method of sanitizing queries, even posting a working poc - use it.



Advertisement