Skip to content

Instantly share code, notes, and snippets.

@kitzy
kitzy / disable8443_server.xml
Created March 8, 2016 02:48
Disabling Tomcat's HTTPS Connector on port 8443
<!-- <Connector URIEncoding="UTF-8" port="8443" executor="tomcatThreadPool" SSLEnabled="true" maxHttpHeaderSize="8192" maxPostSize="-1" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" disableUploadTimeout="true" acceptCount="100" scheme="https" protocol="HTTP/1.1" secure="true" clientAuth="false" sslProtocol="TLS" sslEnabledProtocols="TLSv1.2,TLSv1.1,TLSv1" keystoreFile="/usr/local/jss/tomcat/.keystore" keystorePass="changeit" ciphers="TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDH_RSA_W
@kitzy
kitzy / server.xml
Last active March 8, 2016 02:55
Server.xml configured to work behind a load balancer
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You 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
@kitzy
kitzy / unloadFDERecoveryAgent.sh
Created May 9, 2016 20:00
A script that will unload the FDERecoveryAgent if it has been running longer than 5 minutes.
#!/bin/bash
# Output all to log
exec 2>&1 >> /var/log/unloadFDERecoveryAgent.log
log()
{
NOW="$(date +"%Y-%m-%d %H:%M:%S")"
echo "$NOW": "$1"
}
@kitzy
kitzy / Transmission Vulnerability.xml
Created August 30, 2016 17:51
A Casper extension attribute to detect OSX/Keydnap
<?xml version="1.0" encoding="UTF-8"?>
<extensionAttribute>
<displayName>Transmission Vulnerability</displayName>
<description>Detects the existence of OSX/Keydnap. Returns "VULNERABLE" if found and "NOT VULNERABLE" if not.</description>
<dataType>string</dataType>
<scriptContentsMac>#!/bin/bash&#13;
&#13;
#################&#13;
### Variables ###&#13;
#################&#13;
@kitzy
kitzy / RemoveTransmissionVulnerablity.sh
Created August 30, 2016 17:54
A script to remove the OSX/Keydnap vulnerability distributed through Transmission.app
#!/bin/bash
#################
### Variables ###
#################
# Items at the system level to be removed
systemItems=(
/Applications/Transmission.app
/Library/Application\ Support/com.apple.iCloud.sync.daemon/

Keybase proof

I hereby claim:

  • I am kitzy on github.
  • I am kitzy (https://keybase.io/kitzy) on keybase.
  • I have a public key whose fingerprint is 06BA 6DAD C99B 68D9 E1D7 804B CBB3 50B6 0A7D 053D

To claim this, I am signing this object:

<key>RECIPE_REPOS</key>
<dict>
<key>/Users/<user>/Library/AutoPkg/RecipeRepos/<your-repo-identifier></key>
<dict>
<key>URL</key>
<string>[email protected]:<your-github-org>/<your-private-repo>.git</string>
</dict>
</dict>
<key>RECIPE_SEARCH_DIRS</key>
<array>
#!/bin/bash
KNOWNHASH=""
FILEPATH=""
TESTHASH=$(md5 ${FILEPATH} | awk '{print $4}')
if [ ! -e "${FILEPATH}" ]
then
echo "<result>not found</result>"
#!/bin/bash
result=$(/usr/bin/defaults read /Library/Preferences/com.apple.commerce AutoUpdateRestartRequired)
if [ "$result" != 1 ]
then
defaults write /Library/Preferences/com.apple.commerce AutoUpdateRestartRequired -bool TRUE
result=$(/usr/bin/defaults read /Library/Preferences/com.apple.commerce AutoUpdateRestartRequired)
fi
@kitzy
kitzy / masCheck.sh
Created March 22, 2017 15:49
A simple script that can be used as a Jamf Extension Attribute to check if a file was installed from the Mac App Store or not.
#!/bin/bash
APP=""
if [ ! -e "/Applications/${APP}.app" ]
then
echo "<result>Not Installed</result>"
elif [ -e "/Applications/${APP}.app/Contents/_MASReceipt" ]
then
echo "<result>Mac App Store</result>"