Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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/
)
# 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
You can’t perform that action at this time.