Doriți să reacționați la acest mesaj? Creați un cont în câteva clickuri sau conectați-vă pentru a continua.

Anti SQL Injection SCRIPT

In jos

Anti SQL Injection SCRIPT Empty Anti SQL Injection SCRIPT

Mesaj Scris de FlyToSky Lun Ian 03, 2011 9:56 am

Cod:
[color=#000000][color=#FF8000]// Anti-SQL Injection

[/color][color=#007700]function [/color][color=#0000BB]check_inject[/color][color=#007700]()

  {

    [/color][color=#0000BB]$badchars [/color][color=#007700]= array([/color][color=#DD0000]";"[/color][color=#007700], [/color][color=#DD0000]"'"[/color][color=#007700], [/color][color=#DD0000]"""[/color][color=#007700], [/color][color=#DD0000]"*"[/color][color=#007700], [/color][color=#DD0000]"DROP"[/color][color=#007700], [/color][color=#DD0000]"SELECT"[/color][color=#007700], [/color][color=#DD0000]"UPDATE"[/color][color=#007700], [/color][color=#DD0000]"DELETE"[/color][color=#007700], [/color][color=#DD0000]"-"[/color][color=#007700]);

 

    foreach([/color][color=#0000BB]$_POST [/color][color=#007700]as [/color][color=#0000BB]$value[/color][color=#007700])

    {

      if([/color][color=#0000BB]in_array[/color][color=#007700]([/color][color=#0000BB]$value[/color][color=#007700], [/color][color=#0000BB]$badchars[/color][color=#007700]))

      {

        die([/color][color=#DD0000]"SQL Injection Detected\n<br />\nIP: "[/color][color=#007700].[/color][color=#0000BB]$_SERVER[/color][color=#007700][[/color][color=#DD0000]'REMOTE_ADDR'[/color][color=#007700]]);

      **

      else

      {

        [/color][color=#0000BB]$check [/color][color=#007700]= [/color][color=#0000BB]preg_split[/color][color=#007700]([/color][color=#DD0000]"//"[/color][color=#007700], [/color][color=#0000BB]$value[/color][color=#007700], -[/color][color=#0000BB]1[/color][color=#007700], [/color][color=#0000BB]PREG_SPLIT_OFFSET_CAPTURE[/color][color=#007700]);

        foreach([/color][color=#0000BB]$check [/color][color=#007700]as [/color][color=#0000BB]$char[/color][color=#007700])

        {

          if([/color][color=#0000BB]in_array[/color][color=#007700]([/color][color=#0000BB]$char[/color][color=#007700], [/color][color=#0000BB]$badchars[/color][color=#007700]))

          {

            die([/color][color=#DD0000]"SQL Injection Detected\n<br />\nIP: "[/color][color=#007700].[/color][color=#0000BB]$_SERVER[/color][color=#007700][[/color][color=#DD0000]'REMOTE_ADDR'[/color][color=#007700]]);

          **

        **

      **

    **

  **
[/color][/color]
FlyToSky
FlyToSky
Administrator
Administrator

Sex : masculin
Zodiac : Fecioara
Mesaje : 611
Reputatie : 10
Data nasterii : 02/09/1993
Data de inscriere : 23/12/2010
Varsta : 31
Localizare : Buftea
Joburi/Distractii : MuOnline & Marea Ieseala :)
Stare de spirit : Happy

Sus In jos

Sus


 
Permisiunile acestui forum:
Nu puteti raspunde la subiectele acestui forum