Skip to main content

Table Of Contents

  • MacOS Details
    • MacOS Versions
    • File System Structure
  • MacOS System Enumeration
    • Mac OS Situational Awareness
    • User Plist File Enumeration
    • User enumeration & Modification
    • Create User & Make Administrator
    • Create A Group
    • Group enumeration & Modification

Mac OS Details

  • Note: This section details Mac OS version information and general file system layout. There are many similarities between Mac OS and Linux, but there are also many key differences listed below.

Mac OS Versions

Here is the markdown table based on the provided data:

IDVERSIONDATE RELEASED
10.0.4Mac OS X Cheetah2001-03-24
10.1.5Mac OS X Puma2001-09-25
10.2.8Mac OS X Jaguar2002-08-23
10.3.9Mac OS X Panther2003-10-24
10.4.11Mac OS X Tiger2005-04-29
10.5.8Mac OS X Leopard2007-10-26
10.6.8Mac OS X Snow Leopard2009-08-28
10.7.5OS X Lion2011-07-20
10.8.5OS X Mountain Lion2012-07-25
10.9.5OS X Mavericks2013-10-22
10.10.5OS X Yosemite2014-10-16
10.11.6OS X El Capitan2015-09-30
10.12.6macOS Sierra2016-09-20
10.13.6macOS High Sierra2017-09-25
10.14.6macOS Mojave2018-09-24
10.15.7macOS Catalina2019-10-07
11.6.7macOS Big Sur2020-11-12
12.4macOS Monterey2021-10-25

FILE SYSTEM STRUCTURE

Here is the markdown table with two columns, PATH and DESCRIPTION:

PATHDESCRIPTION
/ApplicationsContains applications such as Mail, Calendar, Safari, and many others
/binUser binaries
/devInterface for system devices
/coresHidden binary files which contain pieces of computer memory. Used for debugging purposes
/etcSystem configuration files
/UsersBase directory for user files
/LibraryCritical software libraries
/homeNot used for anything
/privateStores essential system files and caches
/optThird party software
/sbinSystem administrator binaries
/SystemContains operating system files
/tmpTemporary files
/usrLess critical files
/VolumesShows mounted volumes
/varVariable system files

MAC OS SYSTEM ENUMERATION

  • Note: This section details system enumeration and user/group manipulation commands. It is worth noting user management and authentication in Mac OS is accomplished much differently than Linux. Shadow/Passwd files are not used and user information is stored in “.plist” files.

Display apps

ls /Applications

Display computer name

hostname

Current username

id

List logged on users

w

List previous user log in sessions

last

Disk usage

df -h

Kernel version & CPU information

uname -a

List mounted drives

mount

Display OS version information

sw_vers

Display shell type

echo $0

Enumerate user home directories

ls /Users

Network and IP information

ifconfig -a

Process enumeration

ps -ef

Kill process PID

kill -9 <PID>

Find specific process

ps -ef | grep -ia <STRING_TO_SEARCH>

Check for active TCP network connections

netstat -p tcp -van

Add another variable to the PATH

sudo nano /etc/paths

USER PLIST FILE ENUMERATION

  • Note: As mentioned above, Mac OS stores user information (including user password hashes) in files called property lists (.plist). With administrative credentials, these can be directly enumerated, and user hashes can be collected.

Enumerate user plist information

sudo plutil -p /var/db/dslocal/nodes/Default/users/<USERNAME>.plist

Enumerate user password hash

sudo dscl . read Users/<USERNAME> ShadowHashData

USER ENUMERATION & MODIFICATION

Display all user and daemon accounts

dscl . list /Users

Display actual user accounts (No daemon accounts)

dscl . list /Users | grep -v '_'

Display verbose user information (shell type, gid, uid, full name, description, etc.)

dscacheutil -q user

Display very verbose user information (user hash included)

dscl . -read /Users/<USERNAME>

Enumerate a specific user's group assignments

dscacheutil -q group -a name <GROUP_NAME>

Delete user

dscl . -delete /Users/<USERNAME>

CREATE USER & MAKE ADMINISTRATOR

Create User

dscl . -create /Users/<USERNAME>

Set shell preferences for user

dscl . -create /Users/<USERNAME> UserShell /bin/bash

Set user full name

dscl . -create /Users/<USERNAME> RealName "<USER_FULL_NAME>"

List out ID’s and select an un-used ID

dscl . list /Users UniqueID

Set unique ID for user

dscl . -create /Users/<USERNAME> UniqueID "<NEWLY_SELECTED_ID>"

Give list of users that belong to a group.

dscl . -create /Users/<USERNAME> PrimaryGroupID 20

Make home directory

dscl . -create /Users/<USERNAME> NFSHomeDirectory /Users/<USERNAME>
mkdir /Users/<USERNAME>

Set user password

dscl . -passwd /Users/<USERNAME> <NEW_PASSWORD>

Add user to admin group

dscl . -append /Groups/admin GroupMembership <USERNAME>

CREATE A GROUP

Create group

sudo dscl . -create /Groups/<GROUPNAME>

Add longform name

sudo dscl . -create /Groups/<GROUPNAME> RealName "Service and Support"

Initialize group password

sudo dscl . -create /Groups/<GROUPNAME> passwd "*"

Find unused group ID

dscl . list /Groups PrimaryGroupID | tr -s ' ' | sort -n -t ' ' -k2,2

Assign group ID

sudo dscl . -create /Groups/<GROUPNAME> gid <NEWLY_SELECTED_ID>

Assign only ONE user to group (will overwrite with this ONE user)

sudo dscl . -create /Groups/<GROUPNAME> GroupMembership <USERNAME>

GROUP ENUMERATION & MODIFICATION

Enumerate all groups and their members

dscacheutil -q group

Append user to group

sudo dscl . -append /Groups/<GROUPNAME> GroupMembership <USERNAME>

Remove user from group

sudo dscl . -delete /Groups/<GROUPNAME> GroupMembership <USERNAME >

Delete group

dscl . -delete /Groups/<GROUPNAME>