Created
November 29, 2017 01:54
-
-
Save theopolis/99718fc1e07e814268d6bd0aa5bacd0a to your computer and use it in GitHub Desktop.
Find enabled accounts on macOS with unset passwords
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
select os_version.version, case when from_base64(p2.value) like '%passwordLastSet%' then 1 else 0 end as password_set, case when p1.value = '*' then 0 else 1 end as account_enabled, u.shell, u.username as account_username from plist p1, plist p2, os_version, (select * from users where directory != '/var/empty') u where (p1.path = '/var/db/dslocal/nodes/Default/users/' || username || '.plist' and p1.key = 'passwd') and (p2.path = '/var/db/dslocal/nodes/Default/users/' || username || '.plist' and p2.key = 'accountPolicyData'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Another way, possibly more effective: