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 30 guests and 1 member online
You are here:
Home
Ethical Hacking Discussions and Related Certifications
Programming
is it possible to reverse engineer a Java hash.
EH-Net
May 24, 2013, 12:51:07 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
) >
is it possible to reverse engineer a Java hash.
Pages: [
1
]
Go Down
« previous
next »
Print
Author
Topic: is it possible to reverse engineer a Java hash. (Read 4875 times)
0 Members and 1 Guest are viewing this topic.
wlandymore
Newbie
Offline
Posts: 34
is it possible to reverse engineer a Java hash.
«
on:
April 11, 2012, 10:13:29 AM »
Well it's probably possible, but I have an applet that is asking for a 6 digit password and then performing a function if the password is correct. I've been looking through the code (someone else wrote it) and I have found a hash in there around the 'passwordField' variable, etc.
S(aGd0ci0jNG9wc2d1dmRmaSY7MCswLURpaXV6Yik=)
Because this is just a simple 6 digit password it has to be a static value, so I figured the password has been hashed to keep it from appearing in the code as plain text. However, is there a way to reverse engineer that?
Logged
ajohnson
Recruiters
Hero Member
Offline
Posts: 1057
aka dynamik
Re: is it possible to reverse engineer a Java hash.
«
Reply #1 on:
April 11, 2012, 10:25:27 AM »
Since you have the code, you should be able to see what operations are being performed on the password that's submitted. Just write a loop from 000000 to 999999 that performs those same operations, compares that with the value you have, and prints out the value if there's a match. Of course, that is assuming what you posted is indeed the value that's used to validate the password.
Logged
WIP: GCFA |
www.infosiege.net
| @infosiege
The day you stop learning is the day you start becoming obsolete.
unicityd
Full Member
Offline
Posts: 156
Bored IT Manager, Crypto Nerd
Re: is it possible to reverse engineer a Java hash.
«
Reply #2 on:
April 11, 2012, 10:48:28 AM »
You need to know what hash algorithm was used. Once you know that you can brute force it with something like this:
String realhash = \
"S(aGd0ci0jNG9wc2d1dmRmaSY7MCswLURpaXV6Yik=)";
for (Integer x=0; x<1000000; x++)
{
String mypass = String.format(%06d", x);
String myhash = hash(mypass);
if myhash.equals(realhash)
{
System.out.println("The password is " + mypass);
}
}
My syntax may be a little off (I'm not a Java programmer), but that code shows essentially what you need to do.
Logged
BS in IT, CISSP, MS in IS Management (in progress)
wlandymore
Newbie
Offline
Posts: 34
Re: is it possible to reverse engineer a Java hash.
«
Reply #3 on:
April 11, 2012, 01:46:06 PM »
Hey guys,
Thanks for the ideas.
Yeah, I'm not a java programmer either which is why I'm finding it so hard. The code they have here is also very non-descript so I can see it making the box that has the numbers 0-9 and then the reference to the password field, but everything else is basically nameless variables. When I decompile the thing I can see SHA1-digest in a couple of spots....
Logged
wlandymore
Newbie
Offline
Posts: 34
Re: is it possible to reverse engineer a Java hash.
«
Reply #4 on:
April 11, 2012, 01:52:09 PM »
it looks like the hash would be without the brackets as well. That kind of hash should be 40 chars I think so if the brackets were taken out of the original and just having the stuff between them you get:
aGd0ci0jNG9wc2d1dmRmaSY7MCswLURpaXV6Yik=
And that's the 40. Just need to reverse it....
Logged
ajohnson
Recruiters
Hero Member
Offline
Posts: 1057
aka dynamik
Re: is it possible to reverse engineer a Java hash.
«
Reply #5 on:
April 11, 2012, 02:03:28 PM »
Creating hashes that are not reversible and don't collide are the main objectives of a quality hashing algorithm. There's not going to be a simple way to reverse it.
You need to take a trial-and-error approach as I stated earlier and unicityd provided an actual example for.
Edit: Also, that appears to be base64 encoded, and it can be successfully base64-decoded. That's why you need to understand what is being done with the password string before you can code a comparison mechanism.
«
Last Edit: April 11, 2012, 02:16:00 PM by ajohnson
»
Logged
WIP: GCFA |
www.infosiege.net
| @infosiege
The day you stop learning is the day you start becoming obsolete.
wlandymore
Newbie
Offline
Posts: 34
Re: is it possible to reverse engineer a Java hash.
«
Reply #6 on:
April 11, 2012, 02:16:55 PM »
Okay, thanks for the help.
I wasn't really under the impression it would be 'easy' but at least what you guys have given me helps to narrow down the focus of my efforts.
Thanks again.
Logged
unicityd
Full Member
Offline
Posts: 156
Bored IT Manager, Crypto Nerd
Re: is it possible to reverse engineer a Java hash.
«
Reply #7 on:
April 11, 2012, 04:49:59 PM »
The hash you pasted in is too long for SHA-1 and too short for SHA-256. Please double-check it and let me know if it's right. I'm curious.
Logged
BS in IT, CISSP, MS in IS Management (in progress)
cd1zz
Hero Member
Offline
Posts: 561
Re: is it possible to reverse engineer a Java hash.
«
Reply #8 on:
April 14, 2012, 01:10:19 PM »
Are you sure its a hash and not just base64 encoded? That looks very base64ish. Decoded to text =
hgtr-#4opsguvdfi&;0+0-Diiuzb)
Logged
OSCE | OSCP | GXPN | OSWP | CISSP
http://www.pwnag3.com
http://www.networkadminsecrets.com
wlandymore
Newbie
Offline
Posts: 34
Re: is it possible to reverse engineer a Java hash.
«
Reply #9 on:
April 17, 2012, 01:00:09 PM »
yeah, I've been messing around with this and I used a base64 to hex converter and got:
307FD8658A395B5F103654DE62181973A0F89D45ED71E4B3E77C1B58F9417B91C2E902E6E682D692188BDF64C068CF69C5B94230B64608E7ABB09A976CD6DC8CFA0A5766EF20CEAF2BCDE0EE55899983F6D61EAF3E6E28A749597DEDA0AB2DF5
Then I was trying something like padBuster which seemed to be making some progress but never finishes. It says it's decrypting some bytes but never makes it to the end.
Logged
wlandymore
Newbie
Offline
Posts: 34
Re: is it possible to reverse engineer a Java hash.
«
Reply #10 on:
April 17, 2012, 05:22:29 PM »
hgtr-#4opsguvdfi&;0+0-Diiuzb) ... not a whole lot to go on.
I've been hunting through the class files to see if I can figure out how it got to that point so I can reverse it from there....
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
News Items and General Discussion About EH-Net
: Change is Coming to EH-Net!!
(28) by
don
GCIH - GIAC Certified Incident Handler
: Passed my GCIH
(6) by
azmatt
Greetings
: Hi from the UK
(4) by
MrTuxracer
GCIH - GIAC Certified Incident Handler
: GCIH Free Practice test attempt
(0) by
prats84
Network Pen Testing
: AIX Vulnerability Assessments
(2) by
ras76
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.