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 26 guests and 1 member online
You are here:
Home
Ethical Hacking Discussions and Related Certifications
Network Pen Testing
Tomcat authentication with sqlmap
EH-Net
May 25, 2013, 02:43:01 PM
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
>
Network Pen Testing
(Moderator:
don
) >
Tomcat authentication with sqlmap
Pages: [
1
]
Go Down
« previous
next »
Print
Author
Topic: Tomcat authentication with sqlmap (Read 11096 times)
0 Members and 1 Guest are viewing this topic.
H1t M0nk3y
Hero Member
Offline
Posts: 865
Tomcat authentication with sqlmap
«
on:
June 07, 2010, 06:05:47 PM »
Hi,
I am having an hard time authenticating sqlmap to a Tomcat 6 server (in my lab).
This command works well:
Quote
wget "
http://192.168.1.57:8080/WebGoat/attack?Screen=137&menu=1200&stage=1
" --http-user=guest --http-password=guest
But when I run this command:
Quote
./sqlmap.py -u "
http://192.168.1.57:8080/WebGoat/attack?Screen=137&menu=1200&stage=1
" --auth-cred="guest:guest" --auth-type="Basic"
I get the following error:
Quote
[19:02:11] [INFO] using '/pentest/database/sqlmap/output/192.168.1.57/session' as session file
[19:02:11] [INFO] testing connection to the target url
[19:02:11]
[ERROR] not authorized, try to provide right HTTP authentication type and valid credentials
I tried many, many things, but I can't find the right command...
Anyone while I am TRYING HARDER?
Logged
OSCP, GPEN, GWAPT, GSEC, CEH, CISSP
Ketchup
Hero Member
Offline
Posts: 1021
Re: Tomcat authentication with sqlmap
«
Reply #1 on:
June 07, 2010, 06:28:03 PM »
Stupid question, could the authentication be something other than Basic? Perhaps Digest?
Could the User Agent play into as well?
Logged
~~~~~~~~~~~~~~
Ketchup
H1t M0nk3y
Hero Member
Offline
Posts: 865
Re: Tomcat authentication with sqlmap
«
Reply #2 on:
June 07, 2010, 06:34:26 PM »
I also tried Digest and it didn't solved my problem.
Let me try the user agent...
Logged
OSCP, GPEN, GWAPT, GSEC, CEH, CISSP
H1t M0nk3y
Hero Member
Offline
Posts: 865
Re: Tomcat authentication with sqlmap
«
Reply #3 on:
June 07, 2010, 06:43:58 PM »
I just tried this:
Quote
./sqlmap.py -u "
http://192.168.1.57:8080/WebGoat/attack?Screen=137&menu=1200&stage=1
" --auth-cred="guest:guest" --auth-type="Basic" --user-agent="Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.15) Gecko/2009102814 Ubuntu/8.10 (intrepid) Firefox/3.0.15"
...and it didn't work.
Logged
OSCP, GPEN, GWAPT, GSEC, CEH, CISSP
H1t M0nk3y
Hero Member
Offline
Posts: 865
Re: Tomcat authentication with sqlmap
«
Reply #4 on:
June 07, 2010, 07:00:45 PM »
Tomcat 6 uses "Digest" and not "Basic" authentication as described there:
http://tomcat.apache.org/tomcat-6.0-doc/realm-howto.html#Digested%20Passwords
I am moving slowly toward the solution...
Logged
OSCP, GPEN, GWAPT, GSEC, CEH, CISSP
Ketchup
Hero Member
Offline
Posts: 1021
Re: Tomcat authentication with sqlmap
«
Reply #5 on:
June 07, 2010, 08:17:34 PM »
try --auth-type="Digest"
Logged
~~~~~~~~~~~~~~
Ketchup
H1t M0nk3y
Hero Member
Offline
Posts: 865
Re: Tomcat authentication with sqlmap
«
Reply #6 on:
June 08, 2010, 06:56:22 AM »
Thanks ketchup but I have tested (and now I just it for all my tests) it even before posting on this forum.
I will keep trying today...
Logged
OSCP, GPEN, GWAPT, GSEC, CEH, CISSP
Ketchup
Hero Member
Offline
Posts: 1021
Re: Tomcat authentication with sqlmap
«
Reply #7 on:
June 08, 2010, 07:17:40 AM »
I would try to capture some traffic during authentication with both wget and sqlmap, to see what they are doing differently.
Logged
~~~~~~~~~~~~~~
Ketchup
H1t M0nk3y
Hero Member
Offline
Posts: 865
Re: Tomcat authentication with sqlmap
«
Reply #8 on:
June 08, 2010, 02:26:56 PM »
I am getting closer now. I authenticated manually with my web browser, then I copied the session cookie from the browser and used it in sqlmap:
Quote
./sqlmap.py -u "
http://192.168.1.57:8080/WebGoat/attack?Screen=137&menu=1200&stage=1
" --cookie "JSESSIONID=HPCBGONANJBGFJFHGOKDMCGJ"
The output is:
Quote
[19:02:11] [INFO] using '/pentest/database/sqlmap/output/192.168.1.57/session' as session file
[19:02:11] [INFO] testing connection to the target url
[19:02:11] [INFO] url is stable
[19:02:11] [INFO] testing if Cookie parameter 'JSESSIONID' is dynamic
[19:02:11] [ERROR] not authorized, try to provide right HTTP authentication type and valid credentials
So it does work now, other then this annoying test with the cookie. I will keep trying tomorrow...
Logged
OSCP, GPEN, GWAPT, GSEC, CEH, CISSP
slackerxxl
Newbie
Offline
Posts: 2
Re: Tomcat authentication with sqlmap
«
Reply #9 on:
December 10, 2010, 07:19:39 AM »
Did you find a solution? I'm having the same problem.
Logged
slackerxxl
Newbie
Offline
Posts: 2
Re: Tomcat authentication with sqlmap
«
Reply #10 on:
December 10, 2010, 07:28:41 AM »
The cookie auth gets sqlmap to check for injection and report if injection works but after that it stops. So I don't know if you thought you had figured it out above, but that was not a working solution.
Quote
xxx:sqlmap xxx$ python sqlmap.py -u "
http://127.0.0.1:8080/WebGoat/attack?Screen=58&menu=1200
" --data "account_number=101" --method=POST --cookie="JSESSIONID=6CE6368E5570B4227B520DAE391203CF" --current-db
sqlmap/0.8 - automatic SQL injection and database takeover tool
http://sqlmap.sourceforge.net
starting at: 14:22:14
[14:22:15]
[INFO] using '/Users/xxx/Documents/Hacking/Tools/sqlmap/output/127.0.0.1/session' as session file
[14:22:15] [INFO] resuming match ratio '0.999' from session file
[14:22:15] [INFO] testing connection to the target url
[14:22:15] [INFO] testing if the url is stable, wait a few seconds
[14:22:16] [INFO] url is stable
[14:22:16] [INFO] testing if POST parameter 'account_number' is dynamic
[14:22:17] [INFO] confirming that POST parameter 'account_number' is dynamic
[14:22:18] [INFO] POST parameter 'account_number' is dynamic
[14:22:18] [INFO] testing sql injection on POST parameter 'account_number' with 0 parenthesis
[14:22:18] [INFO] testing unescaped numeric injection on POST parameter 'account_number'
[14:22:18] [INFO] confirming unescaped numeric injection on POST parameter 'account_number'
[14:22:19] [INFO] POST parameter 'account_number' is unescaped numeric injectable with 0 parenthesis
[14:22:19] [INFO] testing if User-Agent parameter 'User-Agent' is dynamic
[14:22:19] [WARNING] User-Agent parameter 'User-Agent' is not dynamic
[14:22:19] [INFO] testing if Cookie parameter 'JSESSIONID' is dynamic
[14:22:19] [ERROR] not authorized, try to provide right HTTP authentication type and valid credentials
shutting down at: 14:22:19
Logged
sil
Hero Member
Offline
Posts: 549
Re: Tomcat authentication with sqlmap
«
Reply #11 on:
December 10, 2010, 07:50:20 AM »
Just out of curiousity without me having to get too deep into it, have you tried changing your values? For example, look at the error you're getting:
[14:22:19] [INFO] testing if Cookie parameter 'JSESSIONID'
is dynamic
[14:22:19] [ERROR] not authorized, try to provide right HTTP authentication type and valid credentials
Have you tried changing this? My inference is this:
Tomcat --> check to make sure things are dynamic (meaning this value has changed)
Code:
if
field = static
then
this shouldn't be
exit
fi
I don't have Webgoat running to tinker, but my guess is, WebGoat is seeing something it doesn't like - something that is supposed to change and hasn't:
http://www.coderanch.com/t/152524/java-Architect-SCEA/certification/Risk-session-tracking
I suggest checking out:
Stinger (
http://www2.owasp.org/index.php/Testing_for_Command_Injection_%28OWASP-DV-013%29
)
Testing command injection (
http://www2.owasp.org/index.php/Testing_for_Command_Injection_%28OWASP-DV-013%29
)
and "session identifier strength" (
http://www2.owasp.org/index.php/How_to_test_session_identifier_strength_with_WebScarab
)
In order to understand JSESSIONID in cookies and what you might be missing
Logged
http://www.infiltrated.net/mgz/puppylecter.jpg
sil
Hero Member
Offline
Posts: 549
Re: Tomcat authentication with sqlmap
«
Reply #12 on:
December 10, 2010, 07:52:12 AM »
Also take note, that webgoat is broken for certain tests:
http://code.google.com/p/webgoat/issues/detail?id=18
Logged
http://www.infiltrated.net/mgz/puppylecter.jpg
H1t M0nk3y
Hero Member
Offline
Posts: 865
Re: Tomcat authentication with sqlmap
«
Reply #13 on:
December 10, 2010, 07:56:55 AM »
Wow, it's been a while now (about 6 months).
I remember spending quite some time on this problem, and it didn't work out. I remember using wireshark and trying to compare a manual (successful) query and the ones sent by sqlmap. I also remember running out of time (it was for a demo at work).
I got around it by using sqlcheck.sh instead. It was good enough for what I wanted to do.
That being said, I am still very much interested to see if someone can find a solution using this tool!
Logged
OSCP, GPEN, GWAPT, GSEC, CEH, CISSP
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
News Items and General Discussion About EH-Net
: Change is Coming to EH-Net!!
(30) by
don
Tools
: Symbolic Exploit Assistant project is looking for collaborators
(0) by
galapag0
Greetings
: Hi from the UK
(5) by
prats84
GCIH - GIAC Certified Incident Handler
: Passed my GCIH
(9) by
prats84
Network Pen Testing
: Want a challenge? Want a GXPN practice exam?
(0) by
ajohnson
GCIH - GIAC Certified Incident Handler
: GCIH Free Practice test attempt
(1) by
prats84
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.