|
Bas de page | |
---|---|
Auteur | Sujet : [PHP] Probleme requette sql |
![]() Publicité | Posté le 12-02-2007 à 11:52:41 ![]() ![]() |
anapajari s/travail/glanding on hfr/gs; | tu peux montrer ton code php: connexion à la base, execution de la requete et recupération des résultats, stp ? Message cité 1 fois Message édité par anapajari le 12-02-2007 à 12:03:18 |
drexlbob |
--------------- L'etre humain juge tres vite comprend lentement, s'enerve facilement et perd vite ses facultees d'enfant!!!! |
anapajari s/travail/glanding on hfr/gs; | $selection = "SELECT * FROM `user` WHERE `login` LIKE 'dilob' AND `pass` LIKE 'asd' LIMIT 0, 30 ";
|
drexlbob |
--------------- L'etre humain juge tres vite comprend lentement, s'enerve facilement et perd vite ses facultees d'enfant!!!! |
rufo Pas me confondre avec Lycos! | pass_in_db et login_in_db, elles sortent d'où ces variables
Message cité 1 fois Message édité par rufo le 13-02-2007 à 09:42:26 |
math2k |
Message édité par math2k le 12-02-2007 à 18:53:59 |
masklinn í dag viðrar vel til loftárása |
--------------- I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box, and replicate and expand beyond their wildest dreams by throwing away the limits imposed by overbearing genetic r |
rufo Pas me confondre avec Lycos! |
Message cité 1 fois Message édité par rufo le 13-02-2007 à 09:49:18 |
masklinn í dag viðrar vel til loftárása |
--------------- I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box, and replicate and expand beyond their wildest dreams by throwing away the limits imposed by overbearing genetic r |
![]() Publicité | Posté le 13-02-2007 à 10:42:35 ![]() ![]() |
rufo Pas me confondre avec Lycos! |
|
masklinn í dag viðrar vel til loftárása |
Ce qui n'enlève rien à la validité de l'argument
C'est simplissime et ça permet d'éviter 95% des injections SQL si on l'utilise correctement Message cité 1 fois Message édité par masklinn le 13-02-2007 à 11:40:16 --------------- I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box, and replicate and expand beyond their wildest dreams by throwing away the limits imposed by overbearing genetic r |
rufo Pas me confondre avec Lycos! |
|
masklinn í dag viðrar vel til loftárása |
--------------- I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box, and replicate and expand beyond their wildest dreams by throwing away the limits imposed by overbearing genetic r |
rufo Pas me confondre avec Lycos! |
|
masklinn í dag viðrar vel til loftárása |
--------------- I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box, and replicate and expand beyond their wildest dreams by throwing away the limits imposed by overbearing genetic r |
rufo Pas me confondre avec Lycos! | là où je travaille, si...
Message cité 1 fois Message édité par rufo le 13-02-2007 à 14:58:24 |
masklinn í dag viðrar vel til loftárása |
Message édité par masklinn le 13-02-2007 à 15:07:57 --------------- I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box, and replicate and expand beyond their wildest dreams by throwing away the limits imposed by overbearing genetic r |
masklinn í dag viðrar vel til loftárása |
En bonus, ça flinque les perfs (il faut escaper tout ce qui entre) et ça force à manuellement dé-escaper tout ce qui ne va pas dans la DB, créant non seulement un code illisible mais fusillant encore plus les perfs (puisqu'il faut appeler stripslashes sur tout ce qui rentre). C'est pourquoi magic_quotes est désactivé par défaut dans PHP5 et a été totalement supprimé dans PHP6 (normalement) Pour plus d'infos sur le sujet et les problèmes de sécurité liés à php, ce post fournit une liste. Message édité par masklinn le 13-02-2007 à 16:31:50 --------------- I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box, and replicate and expand beyond their wildest dreams by throwing away the limits imposed by overbearing genetic r |
BobbyLeZob BLZ n'est plus |
J'ai du mal: on peut bypasser le addslashes alors? mais comment? le code ci-dessous sert à quoi en fait?
ça ressemble bien à une injection SQL mais je ne comprends pas l'utilité des chr() et ce que ça retourne.
Message cité 1 fois Message édité par BobbyLeZob le 13-02-2007 à 17:07:09 --------------- BLZ n'est plus |
masklinn í dag viðrar vel til loftárása |
En gros il faut utiliser des caractères multibytes invalides créant un caractères multibyte valide + le caractère 0x27 (la quote) quand on y insère un antislash. Genre 0xbf27 (la valeur hexadécimale 27, correspondant à ' quand elle est utilisée seule): addslashes ne comprend pas les charsets multibytes, donc il tente d'échapper 0x27 ( ' ) en le préfixant par 0x5c (qui correspond au caractère \ ). Le résultat, c'est que le flux se retrouve avec 0xbf27 remplacé par 0xbf5c27. 0xfb5c étant un caractère multibyte valide dans l'encodage que l'auteur a choisi, on se retrouve donc avec un caractère 0xbf5c et un caractère 0x27... soit une quote seule... boum
Si tu es dans le premier cas, passe vite dans le second, c'est un conseil.
Message cité 1 fois Message édité par masklinn le 13-02-2007 à 17:37:16 --------------- I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box, and replicate and expand beyond their wildest dreams by throwing away the limits imposed by overbearing genetic r |
BobbyLeZob BLZ n'est plus |
Message cité 1 fois Message édité par BobbyLeZob le 13-02-2007 à 18:21:04 --------------- BLZ n'est plus |
masklinn í dag viðrar vel til loftárása |
--------------- I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box, and replicate and expand beyond their wildest dreams by throwing away the limits imposed by overbearing genetic r |
BobbyLeZob BLZ n'est plus |
Message cité 1 fois Message édité par BobbyLeZob le 13-02-2007 à 18:52:30 --------------- BLZ n'est plus |
masklinn í dag viðrar vel til loftárása |
--------------- I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box, and replicate and expand beyond their wildest dreams by throwing away the limits imposed by overbearing genetic r |
BobbyLeZob BLZ n'est plus |
J'ai lu et je ne me permettrai pas de me payer la gueule de qqn qui veut bien m'accorder de son temps pour m'expliquer. --------------- BLZ n'est plus |
masklinn í dag viðrar vel til loftárása |
--------------- I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box, and replicate and expand beyond their wildest dreams by throwing away the limits imposed by overbearing genetic r |
masklinn í dag viðrar vel til loftárása |
--------------- I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box, and replicate and expand beyond their wildest dreams by throwing away the limits imposed by overbearing genetic r |
masklinn í dag viðrar vel til loftárása |
--------------- I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box, and replicate and expand beyond their wildest dreams by throwing away the limits imposed by overbearing genetic r |
BobbyLeZob BLZ n'est plus | --------------- BLZ n'est plus |
BobbyLeZob BLZ n'est plus | --------------- BLZ n'est plus |
BobbyLeZob BLZ n'est plus |
--------------- BLZ n'est plus |
BobbyLeZob BLZ n'est plus | --------------- BLZ n'est plus |
![]() Publicité | Posté le ![]() ![]() |