fix plist files and enhance privilege escalation method

This commit is contained in:
chenbaiyu
2022-01-14 03:17:36 +08:00
parent 29bb10a40a
commit b4f61c735e
14 changed files with 116 additions and 71 deletions

View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.carriez.rustdesk.agent.root</string>
<key>LimitLoadToSessionType</key>
<array>
<string>LoginWindow</string>
</array>
<key>KeepAlive</key>
<dict>
<key>SuccessfulExit</key>
<false />
<key>AfterInitialDemand</key>
<false />
</dict>
<key>RunAtLoad</key>
<true />
<key>ProgramArguments</key>
<array>
<string>/Applications/RustDesk.app/Contents/MacOS/rustdesk</string>
<string>--server</string>
</array>
<key>WorkingDirectory</key>
<string>/Applications/RustDesk.app/Contents/MacOS/</string>
</dict>
</plist>

View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.carriez.rustdesk.agent.user</string>
<key>LimitLoadToSessionType</key>
<array>
<string>Aqua</string>
</array>
<key>KeepAlive</key>
<dict>
<key>SuccessfulExit</key>
<false />
<key>AfterInitialDemand</key>
<false />
</dict>
<key>RunAtLoad</key>
<true />
<key>ProgramArguments</key>
<array>
<string>/Applications/RustDesk.app/Contents/MacOS/rustdesk</string>
<string>--server</string>
</array>
<key>WorkingDirectory</key>
<string>/Applications/RustDesk.app/Contents/MacOS/</string>
</dict>
</plist>

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.carriez.rustdesk.daemon</string>
<key>KeepAlive</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>/Applications/RustDesk.app/Contents/MacOS/rustdesk</string>
<string>--daemon</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>WorkingDirectory</key>
<string>/Applications/RustDesk.app/Contents/MacOS/</string>
</dict>
</plist>

View File

@@ -0,0 +1,19 @@
on run {daemon_file, root_agent_file, user_agent_file}
set sh1 to "echo " & quoted form of daemon_file & " > /Library/LaunchDaemons/com.carriez.rustdesk.daemon.plist && chown root:wheel /Library/LaunchDaemons/com.carriez.rustdesk.daemon.plist;"
set sh2 to "echo " & quoted form of root_agent_file & " > /Library/LaunchAgents/com.carriez.rustdesk.agent.root.plist && chown root:wheel /Library/LaunchAgents/com.carriez.rustdesk.agent.root.plist;"
set sh3 to "echo " & quoted form of user_agent_file & " > /Library/LaunchAgents/com.carriez.rustdesk.agent.user.plist && chown root:wheel /Library/LaunchAgents/com.carriez.rustdesk.agent.user.plist;"
set sh4 to "launchctl load -w /Library/LaunchDaemons/com.carriez.rustdesk.daemon.plist;"
set sh5 to "launchctl load -w /Library/LaunchAgents/com.carriez.rustdesk.agent.root.plist;"
set sh6 to "launchctl load -w /Library/LaunchAgents/com.carriez.rustdesk.agent.user.plist;"
set sh to sh1 & sh2 & sh3 & sh4 & sh5 &sh6
log (sh)
do shell script sh with prompt "RustDesk 需要安装服务" with administrator privileges
end run

View File

@@ -0,0 +1,7 @@
set sh1 to "launchctl load -w /Library/LaunchAgents/com.carriez.rustdesk.agent.root.plist;"
set sh2 to "launchctl load -w /Library/LaunchAgents/com.carriez.rustdesk.agent.user.plist;"
set sh to sh1 & sh2
do shell script sh with prompt "RustDesk 需要停止服务" with administrator privileges

View File

@@ -0,0 +1,7 @@
set sh1 to "launchctl unload -w /Library/LaunchAgents/com.carriez.rustdesk.agent.root.plist;"
set sh2 to "launchctl unload -w /Library/LaunchAgents/com.carriez.rustdesk.agent.user.plist;"
set sh to sh1 & sh2
do shell script sh with prompt "RustDesk 需要停止服务" with administrator privileges