bkahlert / kill-zscaler

Kill Zscaler without password or jail Zscaler in a virtual machine
MIT License
284 stars 22 forks source link

Kill-zscaler not working on Sonoma 14.0 #6

Open lannister7890 opened 1 year ago

lannister7890 commented 1 year ago

It is not working on Mac OS sonoma 14.0

dakira commented 9 months ago

The commands still work perfectly fine. You don't even need to download this repo. Just run the commands in the shell.

mathias8dev commented 8 months ago

Yes, The commands still work. I am also on Mac Os sonoma 14.0.

avivshafir commented 8 months ago

zscaler is killed and then restarts and is active after a few minutes for me. In OSX Sonoma.

KarelPetruzela commented 8 months ago

After latest macOS update, I get this:

Warning: Expecting a LaunchDaemons path since the command was ran as root. Got LaunchAgents instead.
`launchctl bootout` is a recommended alternative.
Unload failed: 5: Input/output error
Try running `launchctl bootout` as root for richer errors.
Unload failed: 5: Input/output error
Try running `launchctl bootout` as root for richer errors.
Unload failed: 5: Input/output error
Try running `launchctl bootout` as root for richer errors.
Unload failed: 5: Input/output error
Try running `launchctl bootout` as root for richer errors.

Does anyone know If there is any way to make this work again. Zscaler is just a nightmare.

onyx4 commented 3 months ago

Same issue with Unload failed: Input/Output error on Sonoma 14.6

MacsInSpace commented 2 months ago

In Sonoma, the "new" (proper) language used in loading and unloading is bootstrap and bootout respectively. As per: https://joelsenders.wordpress.com/2019/03/14/dear-launchctl-were-all-using-you-wrong/ https://gist.github.com/masklinn/a532dfe55bdeab3d60ab8e46ccc38a68

The commands should now be something like this:

`

!/bin/bash

Unload/Kill zscaler

re-run as root if not already.

if [[ $UID -ne 0 ]]; then echo "$0 must be run as root. Please enter your Macs admin/login password:" exec sudo bash "$0" "$@" fi

Name_loggedInUser=$(stat -f %Su /dev/console) UID_loggedInUser=$(id -u $Name_loggedInUser)

find /Library/LaunchAgents -name 'zscaler' -exec launchctl bootout gui/$UID_loggedInUser {} \; find /Library/LaunchDaemons -name 'zscaler' -exec launchctl bootout gui/$UID_loggedInUser {} \;

exit 0 `

And `

!/bin/sh

Load/Startup zscaler

re-run as root if not already.

if [[ $UID -ne 0 ]]; then echo "$0 must be run as root. Please enter your Macs admin/login password:" exec sudo bash "$0" "$@" fi

Name_loggedInUser=$(stat -f %Su /dev/console) UID_loggedInUser=$(id -u $Name_loggedInUser)

/usr/bin/sudo -iu "$Name_loggedInUser" /usr/bin/open -a /Applications/Zscaler/Zscaler.app --hide find /Library/LaunchAgents -name 'zscaler' -exec launchctl bootstrap gui/$UID_loggedInUser {} \; find /Library/LaunchDaemons -name 'zscaler' -exec launchctl bootstrap gui/$UID_loggedInUser {} \;

exit 0 `

Edit: I'll test these and get back to you shortly. Edit #2: Its not quite there. Need to add something like a: zscalers=find /Library/LaunchDaemons -name "*zscaler*" -exec basename {} .plist ';' zscalers+=find /Library/LaunchAgents -name "*zscaler*" -exec basename {} .plist ';'

Leave it with me. ... I don't want this running all the time on a personal device either.

MacsInSpace commented 2 months ago

Try:

#!/bin/sh

#re-run as root if not already.
if [[ $UID -ne 0 ]]; then
echo "$0 must be run as root.
Please enter your Macs admin/login password:"
exec sudo bash "$0" "$@"
fi

#As needed through script, logged in user is variable below
loggedInUser=$( ls -l /dev/console | awk '{print $3}' )

#Get loggedInUser ID
userID=$( id -u $loggedInUser )

#To load:
/usr/bin/sudo -iu "$loggedInUser" /usr/bin/open -a /Applications/Zscaler/Zscaler.app --hide
find /Library/LaunchAgents -name "*zscaler*" -exec launchctl bootstrap gui/$userID {} \;
find /Library/LaunchDaemons -name "*zscaler*" -exec launchctl bootstrap gui/$userID {} \;
#To unload:
find /Library/LaunchAgents -name "*zscaler*" -exec launchctl bootout gui/$userID {} \;
find /Library/LaunchDaemons -name "*zscaler*" -exec launchctl bootout system {} \;
exit 0
MacsInSpace commented 2 months ago

An Applescript toggle:

set appName to "zscaler"

if application appName is running then
    do shell script "loggedInUser=$( ls -l /dev/console | awk '{print $3}' )

# Get loggedInUser ID
userID=$( id -u $loggedInUser )

# to load:
find /Library/LaunchAgents -name \"*zscaler*\" -exec launchctl bootout gui/$userID {} \\;
find /Library/LaunchDaemons -name \"*zscaler*\" -exec launchctl bootout system {} \\;
    " with administrator privileges
else
    do shell script "loggedInUser=$( ls -l /dev/console | awk '{print $3}' )

# Get loggedInUser ID
userID=$( id -u $loggedInUser )

# to load:
find /Library/LaunchAgents -name \"*zscaler*\" -exec launchctl bootstrap gui/$userID {} \\;
find /Library/LaunchDaemons -name \"*zscaler*\" -exec launchctl bootstrap system {} \\;
    " with administrator privileges
end if

or if we need to add fingerprint auth to it, we could use sudo instead of "with administrator privileges" by adding sudo to /etc/pam.d/sudo_local : https://apple.stackexchange.com/questions/259093/can-touch-id-on-mac-authenticate-sudo-in-terminal