SQL Injectie check

Gestart doorIlyasftw15 reacties25 weergaven

16 berichten · pagina 1 van 2

Ilyasftw

Lid · Topicstarter

Berichten
1.157
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Beste,

Ik doe gratis een check op je website of iemand je kan hacken door een sql injectie.
Ik doe dit bij de eerste 10 , daarna doe ik het niet meer.
Je moet me pben

Groen = Klaar
Oranje = Bezig
Rood = Nog niet aan begonnen

Sevvlor
Sevvlor 2


Jellesch 1
Jellesch 2

Jellesch 3
Mikeb
Bash
Wouter
Nielsjojo
Jellesch 4
0
Berichten
4.912
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
chek bestaat niet het is check.

Hier een code die je hele site tegen injecties beveiligd (wel include)

[COLOR= #0000BB]<?php[/COLOR]
    [URL="http://www.php.net/class"]class[/URL] secure [COLOR= #007700]{[/COLOR]
        [URL="http://www.php.net/public"]public[/URL] [URL="http://www.php.net/static"]static[/URL] [COLOR= #007700]function[/COLOR] ty[COLOR= #007700]() {[/COLOR]
            [URL="http://www.php.net/return"]return[/URL] [COLOR= #DD0000]<!-- Ty to smiegles --->[/COLOR][COLOR= #007700];
        }[/COLOR]
        [URL="http://www.php.net/public"]public[/URL] [URL="http://www.php.net/static"]static[/URL] [COLOR= #007700]function[/COLOR] transfer[COLOR= #007700]() {[/COLOR]
               [URL="http://www.php.net/foreach"]foreach[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR] [COLOR= #007700]as[/COLOR] [COLOR= #0000BB]$input[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #0000BB]$value[/COLOR][COLOR= #007700]) {[/COLOR] 
                    [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$input[/COLOR][COLOR= #007700]] =[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$value[/COLOR][COLOR= #007700]); 
                }[/COLOR]
                [URL="http://www.php.net/foreach"]foreach[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR] [COLOR= #007700]as[/COLOR] [COLOR= #0000BB]$input[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #0000BB]$value[/COLOR][COLOR= #007700]) {[/COLOR] 
                    [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$input[/COLOR][COLOR= #007700]] =[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$value[/COLOR][COLOR= #007700]); 
        }
    }
}[/COLOR]
secure[COLOR= #007700]::[/COLOR]transfer[COLOR= #007700]();[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] secure[COLOR= #007700]::[/COLOR]ty[COLOR= #007700]();[/COLOR]
?>
0
Berichten
1.017
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
@Smiegles moet dat in include bestand?
0
Berichten
3.788
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Smiegles schreef:
chek bestaat niet het is check.

Hier een code die je hele site tegen injecties beveiligd (wel include)

[COLOR= #0000BB]<?php[/COLOR]
    [URL="http://www.php.net/class"]class[/URL] secure [COLOR= #007700]{[/COLOR]
        [URL="http://www.php.net/public"]public[/URL] [URL="http://www.php.net/static"]static[/URL] [COLOR= #007700]function[/COLOR] ty[COLOR= #007700]() {[/COLOR]
            [URL="http://www.php.net/return"]return[/URL] [COLOR= #DD0000]<!-- Ty to smiegles --->[/COLOR][COLOR= #007700];
        }[/COLOR]
        [URL="http://www.php.net/public"]public[/URL] [URL="http://www.php.net/static"]static[/URL] [COLOR= #007700]function[/COLOR] transfer[COLOR= #007700]() {[/COLOR]
               [URL="http://www.php.net/foreach"]foreach[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR] [COLOR= #007700]as[/COLOR] [COLOR= #0000BB]$input[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #0000BB]$value[/COLOR][COLOR= #007700]) {[/COLOR] 
                    [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$input[/COLOR][COLOR= #007700]] =[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$value[/COLOR][COLOR= #007700]); 
                }[/COLOR]
                [URL="http://www.php.net/foreach"]foreach[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR] [COLOR= #007700]as[/COLOR] [COLOR= #0000BB]$input[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #0000BB]$value[/COLOR][COLOR= #007700]) {[/COLOR] 
                    [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$input[/COLOR][COLOR= #007700]] =[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$value[/COLOR][COLOR= #007700]); 
        }
    }
}[/COLOR]
secure[COLOR= #007700]::[/COLOR]transfer[COLOR= #007700]();[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] secure[COLOR= #007700]::[/COLOR]ty[COLOR= #007700]();[/COLOR]
?>
Je weet dat dit nog niet je hele site beveiligd tegen injecties?
Het gaat nu puur om POST/GET waardes, wat nou als iemand op een andere manier informatie in je database krijgt oid.
0
Berichten
4.912
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Eleky schreef:
Eerdere citaten tonen
Smiegles schreef:
chek bestaat niet het is check.
Hier een code die je hele site tegen injecties beveiligd (wel include)

[COLOR= #0000BB]<?php[/COLOR]
    [URL="http://www.php.net/class"]class[/URL] secure [COLOR= #007700]{[/COLOR]
        [URL="http://www.php.net/public"]public[/URL] [URL="http://www.php.net/static"]static[/URL] [COLOR= #007700]function[/COLOR] ty[COLOR= #007700]() {[/COLOR]
            [URL="http://www.php.net/return"]return[/URL] [COLOR= #DD0000]<!-- Ty to smiegles --->[/COLOR][COLOR= #007700];
        }[/COLOR]
        [URL="http://www.php.net/public"]public[/URL] [URL="http://www.php.net/static"]static[/URL] [COLOR= #007700]function[/COLOR] transfer[COLOR= #007700]() {[/COLOR]
               [URL="http://www.php.net/foreach"]foreach[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR] [COLOR= #007700]as[/COLOR] [COLOR= #0000BB]$input[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #0000BB]$value[/COLOR][COLOR= #007700]) {[/COLOR] 
                    [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$input[/COLOR][COLOR= #007700]] =[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$value[/COLOR][COLOR= #007700]); 
                }[/COLOR]
                [URL="http://www.php.net/foreach"]foreach[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR] [COLOR= #007700]as[/COLOR] [COLOR= #0000BB]$input[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #0000BB]$value[/COLOR][COLOR= #007700]) {[/COLOR] 
                    [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$input[/COLOR][COLOR= #007700]] =[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$value[/COLOR][COLOR= #007700]); 
        }
    }
}[/COLOR]
secure[COLOR= #007700]::[/COLOR]transfer[COLOR= #007700]();[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] secure[COLOR= #007700]::[/COLOR]ty[COLOR= #007700]();[/COLOR]
?>

Je weet dat dit nog niet je hele site beveiligd tegen injecties?
Het gaat nu puur om POST/GET waardes, wat nou als iemand op een andere manier informatie in je database krijgt oid.

Cookies en sessies worden hier niet mee beveiligd maar dat kun je zo toevoegen..
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Smiegles schreef:
chek bestaat niet het is check.

Hier een code die je hele site tegen injecties beveiligd (wel include)

[COLOR= #0000BB]<?php[/COLOR]
    [URL="http://www.php.net/class"]class[/URL] secure [COLOR= #007700]{[/COLOR]
        [URL="http://www.php.net/public"]public[/URL] [URL="http://www.php.net/static"]static[/URL] [COLOR= #007700]function[/COLOR] ty[COLOR= #007700]() {[/COLOR]
            [URL="http://www.php.net/return"]return[/URL] [COLOR= #DD0000]<!-- Ty to smiegles --->[/COLOR][COLOR= #007700];
        }[/COLOR]
        [URL="http://www.php.net/public"]public[/URL] [URL="http://www.php.net/static"]static[/URL] [COLOR= #007700]function[/COLOR] transfer[COLOR= #007700]() {[/COLOR]
               [URL="http://www.php.net/foreach"]foreach[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR] [COLOR= #007700]as[/COLOR] [COLOR= #0000BB]$input[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #0000BB]$value[/COLOR][COLOR= #007700]) {[/COLOR] 
                    [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$input[/COLOR][COLOR= #007700]] =[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$value[/COLOR][COLOR= #007700]); 
                }[/COLOR]
                [URL="http://www.php.net/foreach"]foreach[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR] [COLOR= #007700]as[/COLOR] [COLOR= #0000BB]$input[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #0000BB]$value[/COLOR][COLOR= #007700]) {[/COLOR] 
                    [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$input[/COLOR][COLOR= #007700]] =[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$value[/COLOR][COLOR= #007700]); 
        }
    }
}[/COLOR]
secure[COLOR= #007700]::[/COLOR]transfer[COLOR= #007700]();[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] secure[COLOR= #007700]::[/COLOR]ty[COLOR= #007700]();[/COLOR]
?>
Die code is gewoon slecht... is niet eens correcte oop, en je maakt geen gebruik van magic methods zoals __construct()... Weet jij wel hoe OOP werkt?

toevoeging op 16 juli 2012, 21:57:49:
Als je tevens gebruikt maakt van prepared statements is SQL injection ONMOGELIJK.
0
Berichten
3.425
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Wil je PokeMania.nl checken voor mijn neef?
0
Berichten
4.912
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Raaoul schreef:
Eerdere citaten tonen
Smiegles schreef:
chek bestaat niet het is check.
Hier een code die je hele site tegen injecties beveiligd (wel include)

[COLOR= #0000BB]<?php[/COLOR]
    [URL="http://www.php.net/class"]class[/URL] secure [COLOR= #007700]{[/COLOR]
        [URL="http://www.php.net/public"]public[/URL] [URL="http://www.php.net/static"]static[/URL] [COLOR= #007700]function[/COLOR] ty[COLOR= #007700]() {[/COLOR]
            [URL="http://www.php.net/return"]return[/URL] [COLOR= #DD0000]<!-- Ty to smiegles --->[/COLOR][COLOR= #007700];
        }[/COLOR]
        [URL="http://www.php.net/public"]public[/URL] [URL="http://www.php.net/static"]static[/URL] [COLOR= #007700]function[/COLOR] transfer[COLOR= #007700]() {[/COLOR]
               [URL="http://www.php.net/foreach"]foreach[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR] [COLOR= #007700]as[/COLOR] [COLOR= #0000BB]$input[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #0000BB]$value[/COLOR][COLOR= #007700]) {[/COLOR] 
                    [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$input[/COLOR][COLOR= #007700]] =[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$value[/COLOR][COLOR= #007700]); 
                }[/COLOR]
                [URL="http://www.php.net/foreach"]foreach[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR] [COLOR= #007700]as[/COLOR] [COLOR= #0000BB]$input[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #0000BB]$value[/COLOR][COLOR= #007700]) {[/COLOR] 
                    [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$input[/COLOR][COLOR= #007700]] =[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$value[/COLOR][COLOR= #007700]); 
        }
    }
}[/COLOR]
secure[COLOR= #007700]::[/COLOR]transfer[COLOR= #007700]();[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] secure[COLOR= #007700]::[/COLOR]ty[COLOR= #007700]();[/COLOR]
?>

Die code is gewoon slecht... is niet eens correcte oop, en je maakt geen gebruik van magic methods zoals __construct()... Weet jij wel hoe OOP werkt?

toevoeging op 16 juli 2012, 21:57:49:
Als je tevens gebruikt maakt van prepared statements is SQL injection ONMOGELIJK.

Ik heb niet eens gezegd dat het OOP is?
EN ja ik WEET hoe OOP werkt
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Smiegles schreef:
Eerdere citaten tonen
Raaoul schreef:
Eerdere citaten tonen
Smiegles schreef:
chek bestaat niet het is check.
Hier een code die je hele site tegen injecties beveiligd (wel include)

[COLOR= #0000BB]<?php[/COLOR]
    [URL="http://www.php.net/class"]class[/URL] secure [COLOR= #007700]{[/COLOR]
        [URL="http://www.php.net/public"]public[/URL] [URL="http://www.php.net/static"]static[/URL] [COLOR= #007700]function[/COLOR] ty[COLOR= #007700]() {[/COLOR]
            [URL="http://www.php.net/return"]return[/URL] [COLOR= #DD0000]<!-- Ty to smiegles --->[/COLOR][COLOR= #007700];
        }[/COLOR]
        [URL="http://www.php.net/public"]public[/URL] [URL="http://www.php.net/static"]static[/URL] [COLOR= #007700]function[/COLOR] transfer[COLOR= #007700]() {[/COLOR]
               [URL="http://www.php.net/foreach"]foreach[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR] [COLOR= #007700]as[/COLOR] [COLOR= #0000BB]$input[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #0000BB]$value[/COLOR][COLOR= #007700]) {[/COLOR] 
                    [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$input[/COLOR][COLOR= #007700]] =[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$value[/COLOR][COLOR= #007700]); 
                }[/COLOR]
                [URL="http://www.php.net/foreach"]foreach[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR] [COLOR= #007700]as[/COLOR] [COLOR= #0000BB]$input[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #0000BB]$value[/COLOR][COLOR= #007700]) {[/COLOR] 
                    [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$input[/COLOR][COLOR= #007700]] =[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$value[/COLOR][COLOR= #007700]); 
        }
    }
}[/COLOR]
secure[COLOR= #007700]::[/COLOR]transfer[COLOR= #007700]();[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] secure[COLOR= #007700]::[/COLOR]ty[COLOR= #007700]();[/COLOR]
?>

Die code is gewoon slecht... is niet eens correcte oop, en je maakt geen gebruik van magic methods zoals __construct()... Weet jij wel hoe OOP werkt?

toevoeging op 16 juli 2012, 21:57:49:
Als je tevens gebruikt maakt van prepared statements is SQL injection ONMOGELIJK.
Ik heb niet eens gezegd dat het OOP is?
EN ja ik WEET hoe OOP werkt

Ik raad niemand aan om dit te gebruiken.
Wees niet lui en escape alles netjes en als je dat niet doet, gebruik dan prepared statements in mysqli / pdo
0
Berichten
4.912
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Raaoul schreef:
Eerdere citaten tonen
Smiegles schreef:
Eerdere citaten tonen
Raaoul schreef:
Eerdere citaten tonen
Smiegles schreef:
chek bestaat niet het is check.
Hier een code die je hele site tegen injecties beveiligd (wel include)

[COLOR= #0000BB]<?php[/COLOR]
    [URL="http://www.php.net/class"]class[/URL] secure [COLOR= #007700]{[/COLOR]
        [URL="http://www.php.net/public"]public[/URL] [URL="http://www.php.net/static"]static[/URL] [COLOR= #007700]function[/COLOR] ty[COLOR= #007700]() {[/COLOR]
            [URL="http://www.php.net/return"]return[/URL] [COLOR= #DD0000]<!-- Ty to smiegles --->[/COLOR][COLOR= #007700];
        }[/COLOR]
        [URL="http://www.php.net/public"]public[/URL] [URL="http://www.php.net/static"]static[/URL] [COLOR= #007700]function[/COLOR] transfer[COLOR= #007700]() {[/COLOR]
               [URL="http://www.php.net/foreach"]foreach[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR] [COLOR= #007700]as[/COLOR] [COLOR= #0000BB]$input[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #0000BB]$value[/COLOR][COLOR= #007700]) {[/COLOR] 
                    [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$input[/COLOR][COLOR= #007700]] =[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$value[/COLOR][COLOR= #007700]); 
                }[/COLOR]
                [URL="http://www.php.net/foreach"]foreach[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR] [COLOR= #007700]as[/COLOR] [COLOR= #0000BB]$input[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #0000BB]$value[/COLOR][COLOR= #007700]) {[/COLOR] 
                    [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$input[/COLOR][COLOR= #007700]] =[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$value[/COLOR][COLOR= #007700]); 
        }
    }
}[/COLOR]
secure[COLOR= #007700]::[/COLOR]transfer[COLOR= #007700]();[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] secure[COLOR= #007700]::[/COLOR]ty[COLOR= #007700]();[/COLOR]
?>

Die code is gewoon slecht... is niet eens correcte oop, en je maakt geen gebruik van magic methods zoals __construct()... Weet jij wel hoe OOP werkt?

toevoeging op 16 juli 2012, 21:57:49:
Als je tevens gebruikt maakt van prepared statements is SQL injection ONMOGELIJK.
Ik heb niet eens gezegd dat het OOP is?
EN ja ik WEET hoe OOP werkt
Ik raad niemand aan om dit te gebruiken.
Wees niet lui en escape alles netjes en als je dat niet doet, gebruik dan prepared statements in mysqli / pdo

Je kunt het ook gewoon gebruiken als een fall back voor als je het ergens vergeet.
ik heb nergens gezegd dat je verder nergens mysql_real_escape_string moet gaan toepassen het is gewoon een extra filer.
0
Berichten
8.649
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Smiegles schreef:
Eerdere citaten tonen
Raaoul schreef:
Eerdere citaten tonen
Smiegles schreef:
Eerdere citaten tonen
Raaoul schreef:
Eerdere citaten tonen
Smiegles schreef:
chek bestaat niet het is check.
Hier een code die je hele site tegen injecties beveiligd (wel include)

[COLOR= #0000BB]<?php[/COLOR]
    [URL="http://www.php.net/class"]class[/URL] secure [COLOR= #007700]{[/COLOR]
        [URL="http://www.php.net/public"]public[/URL] [URL="http://www.php.net/static"]static[/URL] [COLOR= #007700]function[/COLOR] ty[COLOR= #007700]() {[/COLOR]
            [URL="http://www.php.net/return"]return[/URL] [COLOR= #DD0000]<!-- Ty to smiegles --->[/COLOR][COLOR= #007700];
        }[/COLOR]
        [URL="http://www.php.net/public"]public[/URL] [URL="http://www.php.net/static"]static[/URL] [COLOR= #007700]function[/COLOR] transfer[COLOR= #007700]() {[/COLOR]
               [URL="http://www.php.net/foreach"]foreach[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR] [COLOR= #007700]as[/COLOR] [COLOR= #0000BB]$input[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #0000BB]$value[/COLOR][COLOR= #007700]) {[/COLOR] 
                    [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$input[/COLOR][COLOR= #007700]] =[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$value[/COLOR][COLOR= #007700]); 
                }[/COLOR]
                [URL="http://www.php.net/foreach"]foreach[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR] [COLOR= #007700]as[/COLOR] [COLOR= #0000BB]$input[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #0000BB]$value[/COLOR][COLOR= #007700]) {[/COLOR] 
                    [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$input[/COLOR][COLOR= #007700]] =[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$value[/COLOR][COLOR= #007700]); 
        }
    }
}[/COLOR]
secure[COLOR= #007700]::[/COLOR]transfer[COLOR= #007700]();[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] secure[COLOR= #007700]::[/COLOR]ty[COLOR= #007700]();[/COLOR]
?>

Die code is gewoon slecht... is niet eens correcte oop, en je maakt geen gebruik van magic methods zoals __construct()... Weet jij wel hoe OOP werkt?

toevoeging op 16 juli 2012, 21:57:49:
Als je tevens gebruikt maakt van prepared statements is SQL injection ONMOGELIJK.
Ik heb niet eens gezegd dat het OOP is?
EN ja ik WEET hoe OOP werkt
Ik raad niemand aan om dit te gebruiken.
Wees niet lui en escape alles netjes en als je dat niet doet, gebruik dan prepared statements in mysqli / pdo
Je kunt het ook gewoon gebruiken als een fall back voor als je het ergens vergeet.
ik heb nergens gezegd dat je verder nergens mysql_real_escape_string moet gaan toepassen het is gewoon een extra filer.

Handig toch.

Quote:
Lekker weertje is t vandaag.

Mag je dus ook bij elke echo stripslashes gaan zetten...?
0
Berichten
4.912
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Antonn schreef:
Eerdere citaten tonen
Smiegles schreef:
Eerdere citaten tonen
Raaoul schreef:
Eerdere citaten tonen
Smiegles schreef:
Eerdere citaten tonen
Raaoul schreef:
Eerdere citaten tonen
Smiegles schreef:
chek bestaat niet het is check.
Hier een code die je hele site tegen injecties beveiligd (wel include)

[COLOR= #0000BB]<?php[/COLOR]
    [URL="http://www.php.net/class"]class[/URL] secure [COLOR= #007700]{[/COLOR]
        [URL="http://www.php.net/public"]public[/URL] [URL="http://www.php.net/static"]static[/URL] [COLOR= #007700]function[/COLOR] ty[COLOR= #007700]() {[/COLOR]
            [URL="http://www.php.net/return"]return[/URL] [COLOR= #DD0000]<!-- Ty to smiegles --->[/COLOR][COLOR= #007700];
        }[/COLOR]
        [URL="http://www.php.net/public"]public[/URL] [URL="http://www.php.net/static"]static[/URL] [COLOR= #007700]function[/COLOR] transfer[COLOR= #007700]() {[/COLOR]
               [URL="http://www.php.net/foreach"]foreach[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR] [COLOR= #007700]as[/COLOR] [COLOR= #0000BB]$input[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #0000BB]$value[/COLOR][COLOR= #007700]) {[/COLOR] 
                    [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$input[/COLOR][COLOR= #007700]] =[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$value[/COLOR][COLOR= #007700]); 
                }[/COLOR]
                [URL="http://www.php.net/foreach"]foreach[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR] [COLOR= #007700]as[/COLOR] [COLOR= #0000BB]$input[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #0000BB]$value[/COLOR][COLOR= #007700]) {[/COLOR] 
                    [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$input[/COLOR][COLOR= #007700]] =[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$value[/COLOR][COLOR= #007700]); 
        }
    }
}[/COLOR]
secure[COLOR= #007700]::[/COLOR]transfer[COLOR= #007700]();[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] secure[COLOR= #007700]::[/COLOR]ty[COLOR= #007700]();[/COLOR]
?>

Die code is gewoon slecht... is niet eens correcte oop, en je maakt geen gebruik van magic methods zoals __construct()... Weet jij wel hoe OOP werkt?

toevoeging op 16 juli 2012, 21:57:49:
Als je tevens gebruikt maakt van prepared statements is SQL injection ONMOGELIJK.
Ik heb niet eens gezegd dat het OOP is?
EN ja ik WEET hoe OOP werkt
Ik raad niemand aan om dit te gebruiken.
Wees niet lui en escape alles netjes en als je dat niet doet, gebruik dan prepared statements in mysqli / pdo
Je kunt het ook gewoon gebruiken als een fall back voor als je het ergens vergeet.
ik heb nergens gezegd dat je verder nergens mysql_real_escape_string moet gaan toepassen het is gewoon een extra filer.
Handig toch.

Quote:
Lekker weertje is t vandaag.

Mag je dus ook bij elke echo stripslashes gaan zetten...?

ja of gewoon in het filteremo
0
Berichten
1.871
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Geef je na de check ook tips om het te beveiligen zodat het script SQL Injection proof wordt?
0
Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
Smiegles schreef:
Eerdere citaten tonen
Antonn schreef:
Eerdere citaten tonen
Smiegles schreef:
Eerdere citaten tonen
Raaoul schreef:
Eerdere citaten tonen
Smiegles schreef:
Eerdere citaten tonen
Raaoul schreef:
Eerdere citaten tonen
Smiegles schreef:
chek bestaat niet het is check.
Hier een code die je hele site tegen injecties beveiligd (wel include)

[COLOR= #0000BB]<?php[/COLOR]
    [URL="http://www.php.net/class"]class[/URL] secure [COLOR= #007700]{[/COLOR]
        [URL="http://www.php.net/public"]public[/URL] [URL="http://www.php.net/static"]static[/URL] [COLOR= #007700]function[/COLOR] ty[COLOR= #007700]() {[/COLOR]
            [URL="http://www.php.net/return"]return[/URL] [COLOR= #DD0000]<!-- Ty to smiegles --->[/COLOR][COLOR= #007700];
        }[/COLOR]
        [URL="http://www.php.net/public"]public[/URL] [URL="http://www.php.net/static"]static[/URL] [COLOR= #007700]function[/COLOR] transfer[COLOR= #007700]() {[/COLOR]
               [URL="http://www.php.net/foreach"]foreach[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR] [COLOR= #007700]as[/COLOR] [COLOR= #0000BB]$input[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #0000BB]$value[/COLOR][COLOR= #007700]) {[/COLOR] 
                    [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$input[/COLOR][COLOR= #007700]] =[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$value[/COLOR][COLOR= #007700]); 
                }[/COLOR]
                [URL="http://www.php.net/foreach"]foreach[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR] [COLOR= #007700]as[/COLOR] [COLOR= #0000BB]$input[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #0000BB]$value[/COLOR][COLOR= #007700]) {[/COLOR] 
                    [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$input[/COLOR][COLOR= #007700]] =[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$value[/COLOR][COLOR= #007700]); 
        }
    }
}[/COLOR]
secure[COLOR= #007700]::[/COLOR]transfer[COLOR= #007700]();[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] secure[COLOR= #007700]::[/COLOR]ty[COLOR= #007700]();[/COLOR]
?>

Die code is gewoon slecht... is niet eens correcte oop, en je maakt geen gebruik van magic methods zoals __construct()... Weet jij wel hoe OOP werkt?

toevoeging op 16 juli 2012, 21:57:49:
Als je tevens gebruikt maakt van prepared statements is SQL injection ONMOGELIJK.
Ik heb niet eens gezegd dat het OOP is?
EN ja ik WEET hoe OOP werkt
Ik raad niemand aan om dit te gebruiken.
Wees niet lui en escape alles netjes en als je dat niet doet, gebruik dan prepared statements in mysqli / pdo
Je kunt het ook gewoon gebruiken als een fall back voor als je het ergens vergeet.
ik heb nergens gezegd dat je verder nergens mysql_real_escape_string moet gaan toepassen het is gewoon een extra filer.
Handig toch.

Quote:
Lekker weertje is t vandaag.

Mag je dus ook bij elke echo stripslashes gaan zetten...?
ja of gewoon in het filteremo
Of;

function filter($var)
{
    if(get_magic_quotes_gpc()) {
        $var = stripslashes($var);
    }
    return mysql_real_escape_string(htmlentities($var));
}
0
Berichten
8.649
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Nielsjojo schreef:
Geef je na de check ook tips om het te beveiligen zodat het script SQL Injection proof wordt?
Wat heb je er anders aan...? Dat hij enkel zou checken en je zou zeggen dat die veilig was of niet aah
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren