Created
August 30, 2016 17:54
-
-
Save kitzy/f5f89e3e490ba7829c69a7c6dda3334f to your computer and use it in GitHub Desktop.
A script to remove the OSX/Keydnap vulnerability distributed through Transmission.app
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 | |
################# | |
### Variables ### | |
################# | |
# Items at the system level to be removed | |
systemItems=( | |
/Applications/Transmission.app | |
/Library/Application\ Support/com.apple.iCloud.sync.daemon/ | |
) | |
# Items at the user level to be removed | |
userItems=( | |
Library/Application\ Support/com.apple.iCloud.sync.daemon/icloudsyncd | |
Library/Application\ Support/com.apple.iCloud.sync.daemon/process.id | |
Library/LaunchAgents/com.apple.iCloud.sync.daemon.plist | |
Library/LaunchAgents/com.geticloud.icloud.photo.plist | |
) | |
################# | |
### Functions ### | |
################# | |
function deleteItems() | |
{ | |
declare -a toDelete=("${!1}") | |
for item in "${toDelete[@]}" | |
do | |
if [[ ! -z "${2}" ]] | |
then | |
item=("${2}""${item}") | |
fi | |
echo "Looking for $item" | |
if [ -e "${item}" ] | |
then | |
echo "Removing $item" | |
rm -rf "${item}" | |
fi | |
done | |
} | |
#################### | |
### Main Program ### | |
#################### | |
# Delete system level items | |
deleteItems systemItems[@] | |
# Delete user level items | |
for dirs in /Users/*/ | |
do | |
deleteItems userItems[@] "${dirs}" | |
done | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment