Created
December 8, 2011 01:37
-
-
Save rockpapergoat/1445697 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
## parse os x 10.7 shado hash data | |
# | |
require "rexml/document" | |
include REXML | |
require "base64" | |
def parse_plist(plist) | |
parsed = [] | |
doc = Document.new File.new(plist) | |
doc.elements.each("plist/data") {|e| parsed << e} | |
end | |
def base64_shadow(hash) | |
encoded = Base64.encode64(hash) | |
decoded = Base64.decode64(Base64.encode64(hash)) | |
#puts "encoded: #{encoded}" | |
#puts "decoded: #{decoded}" | |
end | |
puts parse_plist("/tmp/password.plist") | |
base64_shadow("password") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment