ciao a tutti..mi kiamo Roberto..il sito è troppo bello e spiega tutto nei minimi particolari..comunque da qualche giorno sono entrato nella programmazzione php e vorrei creare una specie di sentinel..grazie a degli amici sono riuscito ad arrivare quì:
solo che in molti mi hanno detto che nn va bene..mi potete aiutare??? ne vorrei creare 1 che blocca RFI,XSS,SQL Inj.,etc e ad ogni attacco prenda l'IP e lo mette in un file in modo da nn far accedere quella persona...se mi potete aiutare ve ne sarei grato..codice:$stringa = $_SERVER['QUERY_STRING']; $host = $_SERVER['HTTP_HOST']; $file = $_SERVER['PHP_SELF']; $path = "$host$file?$stringa"; $ip = $_SERVER['REMOTE_ADDR']; $stringa = strtolower($stringa); $maligno1 = 'http'; $maligno2 = 'www.'; $maligno3 = 'script'; $maligno4 = 'FROM'; $maligno5 = 'SELECT'; $maligno6 = 'WHERE'; $maligno7 = 'UNION'; $maligno8 = 'phpbb_'; $maligno9 = 'ftp'; $maligno10 = 'https'; $finder_maligno1 = strpos($stringa, $maligno1); $finder_maligno2 = strpos($stringa, $maligno2); $finder_maligno3 = strpos($stringa, $maligno3); $finder_maligno4 = strpos($stringa, $maligno4); $finder_maligno5 = strpos($stringa, $maligno5); $finder_maligno6 = strpos($stringa, $maligno6); $finder_maligno7 = strpos($stringa, $maligno7); $finder_maligno8 = strpos($stringa, $maligno8); $finder_maligno9 = strpos($stringa, $maligno9); $finder_maligno10 = strpos($stringa, $maligno10); if ($finder_maligno1 >= 1 OR $finder_maligno2 >= 1 OR $finder_maligno3 >= 1 OR $finder_maligno4 >= 1 OR $finder_maligno5 >= 1 OR $finder_maligno6 >= 1 OR $finder_maligno7 >= 1 OR $finder_maligno8 >= 1 OR $finder_maligno9 >= 1 OR $finder_maligno10 >= 1) elseif (($_GET['page'])==1) { include("page1.html"); } elseif (($_GET['page'])==2) { include("page2.html"); } elseif (($_GET['page'])==3) { include("page3.html"); } else { echo("Accesso non autorizzato."); }

Rispondi quotando

