👾
ctrl-z
  • 👋Welcome to ctrl-z
  • Cheat Sheets
    • Helpful Command QR
    • Footprinting
    • Information Gathering
    • File Transfers
    • LFI
    • MetaSploit
      • Using msfconsole
      • Creating Metasploit Payloads
    • Shells
      • Shells and Payloads
      • Shell Cheatsheet
    • Password Attacks
    • Attacking Common Services
    • Pivoting & Port Forwarding
    • Web Attacks
      • SQL
        • MySQL & SQLi
        • SQLmap
      • Fuzzing w FFUF
      • Bruteforce w Hydra
      • XSS
    • Active Directory
      • Intro to AD
      • AD Enum&Attack
      • RPC-Client
      • 🥝mimikatz
      • NTLM Relay Attacks
    • 💢Buffer Overflow
    • Priv Esc
      • Linux Priv Esc
      • Windows Priv Esc
        • mimikatz
  • Tools
    • Containers
      • Kubernetes
      • Container Testing Methodology
      • Dropping Kali in your test space
    • Cloud
      • aws cli
    • Command Line
      • Linux Basic CML
      • Windows CML
      • Mac CML
    • Redteam & C2
      • Covenant C2
    • JS Deobuscation
    • Crackmapexec
  • Scripts
    • Priv Esc
  • Loot
  • Write Ups
    • Inject (active at the time)
Powered by GitBook
On this page
  • File & Directory Commands
  • Networking Commands
  • Application Management
  • Shell Management Commands
  1. Tools
  2. Command Line

Mac CML

File & Directory Commands

Command

Description

defaults write com.apple.Finder AppleShowAllFiles true && killall Finder

Enable the setting to view hidden files in finder from CLI

ls

Lists directory contents.

ls -l

list directory contents and their attributes

ls -la

list directory contents to include hidden files & their attributes

cd <path>

Changes the directory.

clear

Clears the terminal.

touch <file>

Creates an empty file in your current working directory.

mkdir <directory>

Creates a new directory in your current working directory

mv /Users/username/Documents/Test /Users/username/Desktop/Test

Move a file from one directory to another

chmod -vv <octal value> <file>

Modify permissions of a file and show the results

sudo chown <userOwn>:<groupOwn> <file>

Change the user and group owner of a file


Networking Commands

Command

Description

ifconfig

View basic networking configurations

ifcofnig <interface>

View specific networking configurations of an interface

ifconfig en0 inet <192.168.1.1> netmask < 255.255.255.0 >

Manually set an interfaces IP address and subnet mask

lsof -n -i4TCP -P

View TCP ports that are bound while displaying the application that has it bound

hostname

Check the hostname of the computer

networksetup -listallnetworkservices

Displays a list of all the network services (devices) on the computer’s hardware. This will print out the logical name of the device. (ex. Wi-Fi)

networksetup -listnetworkserviceorder

This will print out the network services running and the order in which they are queried for connection. A service at the beginning of the list is checked first.

networksetup -getinfo <devicename>

Get basic info about a networkservice (device), such as the IP address assigned, subnet mask, gateway, and Mac-Address.

networksetup -getcurrentlocation

Prints out the currently set network location.

networksetup -setmanual <networkservice> <ip> <netmask> <Gateway>

This will manually configure the IP address, network mask, and gateway for the device specified.

networkQuality -I <interface>

Check network speeds of a specific interface

security find-generic-password -wa <SSID>

Pull the password associated with a specific SSID from the security keychain

nc

Can be used to bind ports to connect with or listen from


Application Management

Command

Description

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Install Homebrew

brew -v

Display the version/package information for Homebrew

brew install <package>

Install a package using Homebrew

brew search firefox

Have Homebrew search its repository for a package named "firefox"

brew install <package> --cask

Install a cask application

brew uninstall <package>

Remove a package from the host

brew upgrade

Upgrade Homebrew and all packages installed with it

brew cleanup

Cleanup old & unused files and applications with Homebrew


Shell Management Commands

Command

Description

.bashrc

Configuration file for Bash

.zshrc

Configuration file for Zsh

chsh -s /bin/bash

Change our env shell to Bash

brew install zsh

Install zsh with Homebrew

chsh -s /bin/zsh

Change our env shell to Zsh

alias ll='ls -l'

Set an alias for ll in the .zshrc file

sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

Install Oh My Zsh

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

Install Zsh-syntax-highlighting

git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k

Install the Powerlevel-10k theme to Zsh

brew install romkatv/powerlevel10k/powerlevel10k

Install the Powerlevel-10k theme to Zsh using Homebrew

echo "source $(brew --prefix)/opt/powerlevel10k/powerlevel10k.zsh-theme" >>~/.zshrc

Set the theme of our shell in the .zshrc file

PreviousWindows CMLNextRedteam & C2

Last updated 2 years ago