This file contains hidden or 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 | |
# | |
# getosversionfromdmg.py | |
# | |
# Copyright (c) 2014 The Regents of the University of Michigan | |
# | |
# Retrieves the OS version and build from the InstallESD.dmg contained in | |
# a typical "Install (Mac) OS X <Name>.app" bundle. | |
# | |
# To run: |
This file contains hidden or 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
# Pure python reimplementation of .cpio.xz content extraction from pbzx file payload originally here: | |
# http://www.tonymacx86.com/general-help/135458-pbzx-stream-parser.html | |
# | |
# Cleaned up C version (as the basis for my code) here, thanks to Pepijn Bruienne / @bruienne | |
# https://gist.github.com/bruienne/029494bbcfb358098b41 | |
# Example usage: | |
# parse_pbzx('PayloadJava', 'PayloadJava.cpio.xz') | |
# Updated for speeeeeeeeeeeeed |
This file contains hidden or 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
# Python routines for parsing bom files | |
# | |
# Examples so far: | |
# | |
# dump_bom(filename) - prints diagnostic structure information about bom file (including path list) | |
from ctypes import BigEndianStructure, c_char, c_uint8, c_uint16, c_uint32, sizeof, memmove, addressof | |
class BOMHeader(BigEndianStructure): | |
_pack_ = 1 |
This file contains hidden or 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
from munkilib import gurl | |
def run_connection(options): | |
connection = gurl.Gurl.alloc().initWithOptions_(options) | |
percent_complete = -1 | |
bytes_received = 0 | |
connection.start() | |
try: | |
while not connection.isDone(): | |
if connection.destination_path: |
This file contains hidden or 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 | |
#This script adds local groups to allow for the ard_* group directory based groups to access the computer via ARD | |
# List of groups to create and edit | |
groupArray=(ard_interact ard_manage ard_admin) | |
# List of AD group UUIDs. Get the UUID from the group info in AD. | |
my_ARD_interact_UUID=AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE | |
my_ARD_manage_UUID=AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE | |
my_ARD_admin_UUID=AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE |
This file contains hidden or 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
username=INSERTUSERNAMEHERE | |
# Check the username has been set | |
if [ $username = INSERTUSERNAMEHERE ] | |
then | |
echo You need to set the username | |
exit 1 | |
fi | |
# Create the ARD Interact group which allows Control and Observe |
This file contains hidden or 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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure(2) do |config| | |
config.vm.box = "osx104" | |
config.vm.synced_folder "./data", "/vagrant_data" | |
config.vm.provision "shell", inline: <<-SHELL | |
curl -s -O "https://osquery-packages.s3.amazonaws.com/darwin/osquery-1.4.5.pkg" | |
installer -pkg osquery-1.4.5.pkg -target / | |
SHELL |
This file contains hidden or 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 | |
# witness the horror | |
# seriously don't do this | |
# last warning.. maybe | |
# Guess I'm putting a license in | |
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 | |
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, | |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
# See the License for the specific language governing permissions and limitations under the License. |
This file contains hidden or 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
pyobjc versions OS X | |
import objc | |
objc.__version__ | |
10.6: 2.2b3 | |
10.7: 2.3.2a0 | |
10.8: 2.3.2a0 | |
10.9: 2.3.2a0 | |
10.10: 2.5.1 |
This file contains hidden or 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 plistlib, os.path, os | |
# Based off of https://forums.developer.apple.com/message/6741 | |
# and http://apple.stackexchange.com/a/136976 | |
def jdk_info_plists(): | |
# Find all the JDK Info.plist files | |
JDK_ROOT = "/Library/Java/JavaVirtualMachines" | |
if (os.path.exists(JDK_ROOT) and os.path.isdir(JDK_ROOT)): |