[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Piratage Mysql



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Le 17/09/2011 00:00, Frédéric ZULIAN a écrit :
> Hack de Mysql :

Ce n'est pas un hack de MySQL, mais une injection SQL d'une de tes
applications web.

> http://www.xxxxx.be/winedowze/1.29/index.php?page=home&com=%2760
> SELECT auteur, titre, date, contenu, icon FROM live_news WHERE id = '60;
> You have an error in your SQL syntax; check the manual that corresponds
> to your MySQL server version for the right syntax to use near ''60' at
> line 1


Voila la faille, ta requète SQL n'est pas protégée contre les injections.
La variable « com » est directement concaténée sans contrôle et sans
échappement à un morceau de SQL, ici apparement
	'SELECT auteur, titre, date, contenu, icon FROM live_news WHERE id = '
+ $_GET['com']

Tant que « com » est un nombre, pas de soucis…
	SELECT auteur, titre, date, contenu, icon FROM live_news WHERE id = 60
Si « com » devient quelque chose de plus malsain, comme
60+UNION+ALL+SELECT+1%2C+2%2C+3%2C+4%2C+5+FROM+mysql.help_topic+WHERE+1+%3D+1
Boom…

SELECT auteur, titre, date, contenu, icon
FROM live_news
WHERE id = 60
UNION ALL
SELECT 1, 2, 3, 4, 5
FROM mysql.help_topic
WHERE 1 = 1

Et je te dump toute ta table mysql.help_topic…

HAVIJ est juste là pour automatiser l'injection et la remontée des
données des tables.

C'est ton appli qui est merdique au possible (en même temps, avec du
PHP…), pas MySQL sur ce coup-ci.

- -- 
Aeris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJOc8yzAAoJEK8zQvxDY4P98BkH/i7KHpOwSZZBNX1jIDBeUTGL
MbqMfP2fJjt3GvCt3oL26cDtCnS/mdERc5nSbcB6pw5lXnZyH16DMM5OaHiMlLiI
xyiyNdlHDkLfE3Xu+b+AzoU8MbWmdC06oCnAmAz3Xdy6hf1CKoVp2z+6nIMyJbWh
g5QannBxgaUQ/2pOq0W7wITkyV2r9J2CvDkeM1/BbuQ33ob9B91VuvnQETpQyV06
Yvx6ZWSDz6cDrP/XZgOtHgKELwKhceMSq6/TbBCGmS7etrNh8pqawEPsdMaTvW4a
Bo1T2NlNQaWsmblVdS8HspwLTDaeQArgrtN92JoCKgZuEbIlFU8ooDDUIaMjstk=
=5ptw
-----END PGP SIGNATURE-----


Reply to: