Home
Calendar
Certifications
Columns
Features
Forum
Resources
Vitals
Latest Additions
April 2013 Free Giveaway Sponsor - eLearnSecurity
Human Intelligence to Navigate the Security Data Deluge
February 2013 Free Giveaway Winner of SANS CyberCon Training
Interview: Bugcrowd Founders on Herding Ninjas for Crowdsourced Bug Bounties
Network Forensics: The Tree in the Forest
March 2013 Free Giveaway Sponsor - Mile2
Book Review: Violent Python
February 2013 Free Giveaway Sponsor - SANS
Holiday 2012 Free Giveaway Winner of Metasploit Pro by Rapid7
Course Review: SANS FOR408 Computer Forensic Investigations – Windows In-Depth
The Security Consulting Sugar High
Tutorial: Fun with SMB on the Command Line
Interview: Ilia Kolochenko, CEO of High-Tech Bridge
October 2012 Free Giveaway Winner of LearningGate Training
The Broken: Assessing Corporate Security in 2012 to Make a Better 2013
EH-Net Login
Welcome Guest.
Username:
Password:
Remember me
Lost Password?
No account yet?
Register
Who's Online
We have 23 guests and 2 members online
Free Business and Tech Magazines and eBooks
You are here:
Home
Ethical Hacking Discussions and Related Certifications
Programming
spit out all users and passwords in MySQL DB?
EH-Net
May 24, 2013, 12:57:29 AM
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
: Go back to The Ethical Hacker Network Online Magazine
Home Page
Home
Help
Calendar
Login
Register
EH-Net
>
Ethical Hacking Discussions and Related Certifications
>
Programming
(Moderator:
don
) >
spit out all users and passwords in MySQL DB?
Pages: [
1
]
Go Down
« previous
next »
Print
Author
Topic: spit out all users and passwords in MySQL DB? (Read 6173 times)
0 Members and 1 Guest are viewing this topic.
wlandymore
Newbie
Offline
Posts: 34
spit out all users and passwords in MySQL DB?
«
on:
April 17, 2012, 01:02:01 PM »
I'm practicing a SQL injection on a DB and I've made some progress. When I enter:
') AND (SELECT * FROM mysql.user) -- AND (((1=1
I get: "Operand should contain 1 column(s)"
How can I get this to display on one line or something so that I can see the output from that command?
Logged
j0rDy
Hero Member
Offline
Posts: 590
Re: spit out all users and passwords in MySQL DB?
«
Reply #1 on:
April 18, 2012, 02:43:58 AM »
its been a while, but let me try this.
the key is to know which tables and columns are containing the information you want, you can get these by requesting the information.schema database. When you have insufficient rights to access the information.schema database you can try two things, guess the names or brute force them.
in the end you want to inject a request like this:
UNION SELECT password FROM users where login_name='admin'--
there are several good sql injection tutorials out there which you can use for more information. good luck!
Logged
ISC2 Associate, CEH, ECSA, OSCP, OSWP
earning my stripes appears to be a road i must travel alone...with a little help of EH.net
TheXero
Full Member
Offline
Posts: 112
Try Harder!
Re: spit out all users and passwords in MySQL DB?
«
Reply #2 on:
April 18, 2012, 05:28:54 AM »
This is where I'd start running "sqlmap" with a --dumpall xD
Logged
OSCP | OSWP
www.thexero.co.uk
j0rDy
Hero Member
Offline
Posts: 590
Re: spit out all users and passwords in MySQL DB?
«
Reply #3 on:
April 18, 2012, 08:29:14 AM »
Quote from: TheXero on April 18, 2012, 05:28:54 AM
This is where I'd start running "sqlmap" with a --dumpall xD
hehe, me too, hence the its been a while. i know certain challenges block such tools so being able to do it manually is a plus in that situation, in real life however...
Logged
ISC2 Associate, CEH, ECSA, OSCP, OSWP
earning my stripes appears to be a road i must travel alone...with a little help of EH.net
wlandymore
Newbie
Offline
Posts: 34
Re: spit out all users and passwords in MySQL DB?
«
Reply #4 on:
April 18, 2012, 11:24:55 AM »
I hadn't actually thought of sqlmap. I have it right on my desktop too.
Is --dumpall actually a switch for sqlmap?
Logged
lorddicranius
Sr. Member
Offline
Posts: 447
Re: spit out all users and passwords in MySQL DB?
«
Reply #5 on:
April 18, 2012, 11:29:11 AM »
Quote from: wlandymore on April 18, 2012, 11:24:55 AM
I hadn't actually thought of sqlmap. I have it right on my desktop too.
Is --dumpall actually a switch for sqlmap?
"--dump-all", but yep!
http://sqlmap.sourceforge.net/doc/README.html#s5
Logged
GSEC, eCPPT, Sec+
wlandymore
Newbie
Offline
Posts: 34
Re: spit out all users and passwords in MySQL DB?
«
Reply #6 on:
April 18, 2012, 07:50:48 PM »
nah, didn't seem to work with sqlmap. Looks like I'll have to use the old fashioned way...
Logged
j0rDy
Hero Member
Offline
Posts: 590
Re: spit out all users and passwords in MySQL DB?
«
Reply #7 on:
April 19, 2012, 01:54:38 AM »
see if you can access the information.schema table, it will save you loads of time and helps you configure your query once you know which tables and columns you want to extract.
Logged
ISC2 Associate, CEH, ECSA, OSCP, OSWP
earning my stripes appears to be a road i must travel alone...with a little help of EH.net
wlandymore
Newbie
Offline
Posts: 34
Re: spit out all users and passwords in MySQL DB?
«
Reply #8 on:
April 25, 2012, 07:19:30 PM »
If I run:
') AND (select * from information_schema)-- (((1=1
I get the error "table glocken_emil.information_schema doesn't exist" so it would appear that they have appended glocken_emil to all of the tables here. I guess that tells me a little bit about the structure...
Logged
j0rDy
Hero Member
Offline
Posts: 590
Re: spit out all users and passwords in MySQL DB?
«
Reply #9 on:
April 26, 2012, 04:49:20 AM »
Quote from: wlandymore on April 25, 2012, 07:19:30 PM
If I run:
') AND (select * from information_schema)-- (((1=1
I get the error "table glocken_emil.information_schema doesn't exist" so it would appear that they have appended glocken_emil to all of the tables here. I guess that tells me a little bit about the structure...
hmm, from here you can go two ways: try to guess the correct information.schema tablename (which could be glocken_emil.information_schema) or try to guess other tables like glocken_emil.users.
come to think of it, the error gets me thinking, it looks like the query is being modified to access a table with the tablename 'glocken_emil.*'. again it has been a while but you can try to use the brute forcer in sqlmap (where you define the prefix as glocken_emil) and see if you can get some tablenames.
Logged
ISC2 Associate, CEH, ECSA, OSCP, OSWP
earning my stripes appears to be a road i must travel alone...with a little help of EH.net
MaXe
Hero Member
Offline
Posts: 669
I've just upgraded myself to a cyborg muahahaa!!1
Re: spit out all users and passwords in MySQL DB?
«
Reply #10 on:
April 26, 2012, 08:24:53 AM »
Use "LIMIT 0,1" in the end of your original query to return only one (1) result from your "SELECT * FROM information_schema" sub-query.
Furthermore, -- (((1=1 seems incorrect.
If you break out of a query with ' (apostrophe), you could something as simple as: AND 'a'='a . That will make the end of the query look like: 'a'='a', as it will append the "missing" apostrophe.
Using a comment like -- and then adding more data afterward seems a bit obscure, because either it (or other ways like #) works or you should avoid using it.
FYI I recommend you don't just use information_schema, but more specific queries like: information_schema.tables
Logged
I'm an InterN0T'er
ajohnson
Recruiters
Hero Member
Online
Posts: 1057
aka dynamik
Re: spit out all users and passwords in MySQL DB?
«
Reply #11 on:
April 26, 2012, 08:40:51 AM »
Just curious, is this one of the hacking-lab.com challenges?
Logged
WIP: GCFA |
www.infosiege.net
| @infosiege
The day you stop learning is the day you start becoming obsolete.
MaXe
Hero Member
Offline
Posts: 669
I've just upgraded myself to a cyborg muahahaa!!1
Re: spit out all users and passwords in MySQL DB?
«
Reply #12 on:
April 26, 2012, 11:17:44 AM »
Quote from: ajohnson on April 26, 2012, 08:40:51 AM
Just curious, is this one of the hacking-lab.com challenges?
Not that I know, as I haven't done them
Logged
I'm an InterN0T'er
Partyball
Newbie
Offline
Posts: 1
Re: spit out all users and passwords in MySQL DB?
«
Reply #13 on:
April 26, 2012, 01:14:26 PM »
Quote from: ajohnson on April 26, 2012, 08:40:51 AM
Just curious, is this one of the hacking-lab.com challenges?
Yes
Logged
Pages: [
1
]
Go Up
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
EH-Net
-----------------------------
=> Calendar Of Events
===> ChicagoCon 2007
===> ChicagoCon 2008s
===> ChicagoCon 2008f
===> ChicagoCon 2009s
=> Ethical Hacktivism
=> News Items and General Discussion About EH-Net
===> Greetings
=> Special Events
-----------------------------
Ethical Hacking Discussions and Related Certifications
-----------------------------
=> General Certification
===> Networking
===> OS
===> Security
=> Compliance, Regulations & Standards
=> Control Systems
=> Cyber Warfare
=> Forensics
===> CCE / MCCE - (Master) Certified Computer Examiner
===> CHFI - Computer Hacking Forensic Investigator
===> EnCE - EnCase® Certified Examiner
===> GCFA - GIAC Certified Forensics Analyst
=> Hardware
=> Incident Response
===> CSIH - Computer Security Incident Handler
===> GCIH - GIAC Certified Incident Handler
=> Malware
===> Advisories
=> Mobile
=> Network Pen Testing
===> CEH - Certified Ethical Hacker
===> CPTC - Certified Penetration Testing Consultant
===> CPTE - Certified Penetration Testing Engineer
===> CSTA - Certified Security Testing Associate
===> eCPPT - eLearnSecurity Certified Professional Penetration Tester
===> ECSA - EC-Council Certified Security Analyst
===> GPEN - GIAC Certified Penetration Tester
===> OSCP - Offensive Security Certified Professional
=> Physical Security
=> Programming
=> Social Engineering
=> Web Applications
=> Wireless
===> CWNP Certs
===> GAWN - GIAC Assessing Wireless Networks
===> OSWP - Offensive Security Wireless Professional
=> Other
-----------------------------
Columns
-----------------------------
=> Editor-In-Chief
=> Andress
=> Gates
=> Haddix
=> Hadnagy
=> Heffner
=> Hoffman
=> Linn
=> RichM
=> Murray
=> J. Peltier
=> Weidman
=> Wilson
-----------------------------
Features
-----------------------------
=> /root
=> Book Reviews
=> Opinions
=> Skillz
===> Examples
===> May 06 - Star Hacks, Episode V: The Empire Hacks Back
===> July 06 - Hack Bill!
===> Sept 06 - Netcat in the Hat
===> Nov 06 - Hitch-Hackers Guide to the Galaxy
===> Dec 06 - A Christmas (Hacking) Story
===> Feb 07 - Charlottes Web Site
===> April 07 - Microsoft Office Space
===> June 07 - Serenity Hack
===> Oct 07 - Worst. Ethical. Hacker. Challenge. Ever.
===> Dec 07 - Frosty the Snow Crash
===> March 2008 - It Happened One Friday
===> Oct 2008 - Scooby Doo and the Crypto Caper
===> Dec 08 - Santa Claus Is Hacking to Town
===> Feb 2009 - Brady Bunch Boondoggle
===> July 2009 - Prison Break
===> October 2009 - SSHliders
===> December 2009 - Miracle on Thirty-Hack Street
===> December 2010 - The Nightmare Before Charlie Browns Christmas
-----------------------------
Resources
-----------------------------
=> Career Central
===> Looking For Work
===> Looking To Hire
=> Links to cool sites.
=> Mass Media
=> News from the Outside World
=> Tools
=> Tutorials
===> Tutorial Requests
Loading...
Exclusive Deal
SANSFIRE 2013
June 15 - 22
5% Off
w/ Code
:
EHN_5
SANS Deals 4 EH-Netters
5% OFF
Any
SANS Course
in Any Format!
Coupon Code:
EHN_5
Including
SANS Rocky Mountain 2013
&
SANS Boston 2013
Polls
Compared to this year, 2013 will be:
Great!
Better.
About the same.
Little worse.
FUBAR!
Recent Forum Topics
GCIH - GIAC Certified Incident Handler
: GCIH Free Practice test attempt
(1) by
prats84
GCIH - GIAC Certified Incident Handler
: Passed my GCIH
(7) by
prats84
News Items and General Discussion About EH-Net
: Change is Coming to EH-Net!!
(28) by
don
Greetings
: Hi from the UK
(4) by
MrTuxracer
EH-Net News Feeds
Latest Additions
Privacy Notice
for TDCC & All Properties
© 2013 The Ethical Hacker Network
Joomla!
is Free Software released under the GNU/GPL License.