MSSQL Anti Injection

Results 1 to 10 of 10
  1. #1
    Tantra Freelancer A v a r a is offline
    MemberRank
    Apr 2014 Join Date
    In Your HeadLocation
    554Posts

    MSSQL Anti Injection

    Any thoughts how to prevent this?


  2. #2
    ◝(⁰▿⁰)◜Smile◝ (⁰▿⁰)◜ Taiga is offline
    DeveloperRank
    May 2007 Join Date
    InternetLocation
    2,464Posts

    Re: MSSQL Anti Injection

    You use prepared statements.

  3. #3
    Tantra Freelancer A v a r a is offline
    MemberRank
    Apr 2014 Join Date
    In Your HeadLocation
    554Posts

    Re: MSSQL Anti Injection

    Quote Originally Posted by CodeDragon View Post
    You use prepared statements.
    Unfortunately I don't have any idea how to make one. If you don't mind, can you share some links here in RaGEZONE that most likely you recommend to be use which is also effective?

  4. #4
    Ronin Dev John is offline
    MemberRank
    Mar 2011 Join Date
    /dev/nullLocation
    382Posts

    Re: MSSQL Anti Injection

    Through the game, the web or how?

  5. #5
    Tantra Freelancer A v a r a is offline
    MemberRank
    Apr 2014 Join Date
    In Your HeadLocation
    554Posts

    Re: MSSQL Anti Injection

    Quote Originally Posted by John View Post
    Through the game, the web or how?
    Web in Ranking page.

  6. #6
    Ronin Dev John is offline
    MemberRank
    Mar 2011 Join Date
    /dev/nullLocation
    382Posts

    Re: MSSQL Anti Injection

    Quote Originally Posted by A v a r a View Post
    Web in Ranking page.
    Use a function:
    PHP Code:
    function antiinjectsql($tzgd){
        
    /* Function anti sql injection by Amir Torrez */
        
    $bn = array ("==", , "%s""or 1""'""select""insert""from""where""exec""0x""set""declare""sql"'"');
        
    $tzgd preg_replace ($bn,''$tzgd);
        return 
    $tzgd;
    }; 
    Call the function in the variables, example:
    PHP Code:
    $dios antiinjectsql($_GET['dios']); 
    Use it in any variables, for example, GET and POST.

  7. #7
    Member WildHunt is offline
    MemberRank
    Apr 2008 Join Date
    87Posts

    Re: MSSQL Anti Injection

    Quote Originally Posted by John View Post
    Use a function:
    PHP Code:
    function antiinjectsql($tzgd){
        
    /* Function anti sql injection by Amir Torrez */
        
    $bn = array ("==", , "%s""or 1""'""select""insert""from""where""exec""0x""set""declare""sql"'"');
        
    $tzgd preg_replace ($bn,''$tzgd);
        return 
    $tzgd;
    }; 
    Call the function in the variables, example:
    PHP Code:
    $dios antiinjectsql($_GET['dios']); 
    Use it in any variables, for example, GET and POST.

    Para evitar llamar la funcion en cada variable se puede usar lo siguiente usando tu función:
    foreach( $_GET as $variable => $valor ){
    $_GET [ $variable ] = antiinjectsql($_GET [ $variable ]);
    }


    foreach( $_POST as $variable => $valor ){
    $_POST [ $variable ] = antiinjectsql($_POST [ $variable ]);
    }


    Y se incluye este archivo en el config o al inicio de la web.

    Saludos!

  8. #8
    Ronin Dev John is offline
    MemberRank
    Mar 2011 Join Date
    /dev/nullLocation
    382Posts

    Re: MSSQL Anti Injection

    Quote Originally Posted by WildHunt View Post
    Para evitar llamar la funcion en cada variable se puede usar lo siguiente usando tu función:

    Y se incluye este archivo en el config o al inicio de la web.

    Saludos!
    Exactamente, aunque prefiero manual, debido al contenido de algunas otras variables, pero es a gusto del consumidor.

    != Exactly, although I prefer manually, due to the content of some other variables, but it is to consumer tastes.

  9. #9
    Fuck. SheenBR is offline
    ModeratorRank
    Feb 2008 Join Date
    Jaú, BrazilLocation
    2,433Posts

    Re: MSSQL Anti Injection

    Don't use an array with badwords. Instead, use what we call as "parameterized query". It is very simple and can help you.

  10. #10
    Member WildHunt is offline
    MemberRank
    Apr 2008 Join Date
    87Posts

    Re: MSSQL Anti Injection

    Tuve problemas igualmente con unas variables, por ejemplo con el reCaptcha. Pero eso se puede solucionar con esto:

    != I had problems with some variables, for example with reCaptcha. But that can be fixed with this:

    PHP Code:
    foreach( $_POST as $variable => $valor ){ 
        if (
    $variable=='g-recaptcha-response') { 
            continue;
        }
    $_POST $variable ] = anti_injection($_POST $variable ]); 

    PD: Tendre cuidado con los gringoliebers



Advertisement