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
#!/bin/bash | |
declare -x awk="/usr/bin/awk" | |
declare -x ioreg="/usr/sbin/ioreg" | |
declare -x sysctl="/usr/sbin/sysctl" | |
# Intel and future systems test | |
declare IOREG="$($ioreg -l | | |
$awk 'BEGIN {FS="[<>]"} | |
/.*\"system-type\".=./{ | |
systype=$2 | |
if ( systype == 1 ) |
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/python | |
import ast | |
import plistlib | |
import urllib2 | |
import subprocess | |
system_profiler = "/usr/sbin/system_profiler" | |
# Generic system_profiler parser | |
def systemReport(): | |
global spx |
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/python -tt | |
__author__ = 'Zack Smith @acidprime' | |
__version__ = '0.1' | |
import sys | |
import getopt | |
import plistlib | |
global debugEnabled | |
global plist | |
global userName |
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/perl | |
use Digest::SHA1 qw(sha1_hex);; | |
$password = $ARGV[0]; | |
sub genShadowHash($){ | |
# get our salt integer, and it's hex value | |
$salt = rand(2**31-1); | |
$saltHex = sprintf("%X",$salt); | |
# get string representation of bytes | |
$saltStr = pack("N", $salt); |
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/python | |
import binascii | |
from Cocoa import NSDictionary,NSPropertyListSerialization | |
from Cocoa import NSPropertyListImmutable | |
user = 'acid' | |
path = '/var/db/dslocal/nodes/Default/users/%s.plist' % user | |
# Read the binary plist | |
plist = NSDictionary.dictionaryWithContentsOfFile_(path) | |
# Grab the ShadowHashData key | |
dataShadowHashData = plist['ShadowHashData'][0] |
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
#!/bin/bash | |
# Commands used by this script | |
declare -x asr="/usr/sbin/asr" | |
declare -x awk='/usr/bin/awk' | |
declare -x hdiutil='/usr/bin/hdiutil' | |
declare -x rm="/bin/rm" | |
declare -x mv="/bin/mv" | |
# Check any commands are included on the .nbi | |
for COMMAND in $asr $awk $hdutil $rm ; do | |
if [ ! -x "$COMMAND" ] ; then |
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/python -tt | |
import subprocess | |
airport = '/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport' | |
def getAirportInfo(): | |
arguments = [airport,"--getinfo"] | |
execute = subprocess.Popen(arguments, stdout=subprocess.PIPE) | |
out, err = execute.communicate() | |
dict = {} | |
for line in out.split('\n'): |
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
#!/bin/bash | |
IFS=$'\n' | |
LDAP_SERVER="localhost" | |
ldapsearch -LLL -h "$LDAP_SERVER" -x -D uid=diradmin,cn=users,dc=example,dc=com -w password -b cn=users,dc=example,dc=com '(&(objectClass=posixAccount)(!(uid=root))(!(uid=diradmin))(!(uid=vpn_*)))' \ | |
cn \ | |
sn \ | |
givenName \ | |
uidNumber \ | |
uid \ | |
l \ |
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
#!/bin/bash | |
LDAP_SERVER="ldap.example.com" | |
IFS=$'\n' | |
ldapsearch -LLL -h "$LDAP_SERVER" -x -D uid=diradmin,cn=users,dc=example,dc=com -w password -b cn=groups,dc=example,dc=com '(&(objectClass=posixGroup)(!(cn=Domain*))(!(cn=com.apple.*))(!(cn=admin))(!(cn=staff)))' description apple-group-realname memberUid | | |
sed 's/^apple-group-realname:/name:/g' | | |
sed 's/cn=groups,dc=example,dc=com/ou=ImportedUsers,dc=ad,dc=example,dc=com/g' | | |
while read line ; do | |
if [ "$line" != "${line/dn://}" ] ; then | |
declare MY_UID="$(echo "$line" | awk -F'[=,]' '/^dn:/{print $2}' )" | |
declare MY_CN="$(ldapsearch -LLL -h "$LDAP_SERVER" -x -D uid=diradmin,cn=users,dc=example,dc=com -w password -b cn=groups,dc=example,dc=com "(&(objectClass=posixGroup)(&(cn=$MY_UID)))" apple-group-realname | |
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
#!/bin/bash | |
declare -x nidump="/usr/bin/nidump" | |
declare -x dirname="/usr/bin/dirname" | |
declare -x system_profiler="/usr/sbin/system_profiler" | |
declare -x hdiutil="/usr/bin/hdiutil" | |
declare -x sharing="/usr/sbin/sharing" | |
declare -x serveradmin="/usr/sbin/serveradmin" | |
declare -x RUN_DIRECTORY="/tmp/$$backup$RANDOM" | |
# Find the Run Directory from the Script Path | |
mkdir "$RUN_DIRECTORY/Server Admin" |
OlderNewer