Flashback.I variant Safari cleaner

rmanly
Contributor III

This one is pretty straightforward.

Unlike the user cleaner I posted this one is not tested at all (forcing all Software Updates seems to have stomped out the infected files and variables on this machine...prolly going from Safari 5.1.4 to 5.1.5 squished it)

#!/bin/bash

if check_file=$(defaults read /Applications/Safari.app/Contents/Info LSEnvironment | awk '/Safar/{print $3}'); then

    while read -r; do
        delete_me+=("$REPLY")
    done < <(grep -a -o '__ldpath__[ -~]*' "${check_file}" | uniq)

    defaults delete /Applications/Safari.app/Info LSEnvironment

    chmod 644 /Applications/Safari.app/Contents/Info.plist

    rm "${check_file}"

    for file in "${delete_me[@]}"; do
        rm "$file##*_}"
    done

fi
1 REPLY 1

rmanly
Contributor III

RUN SOFTWARE UPDATE

https://support.apple.com/kb/HT5242