4 ms·
> Disable Access Control This was terrible advice back in the 90s and still is. An attacker anywhere on the network can listen to your input devices, insert fa
by Tepix 6y ago
> Disable Access Control
This was terrible advice back in the 90s and still is. An attacker anywhere on the network can listen to your input devices, insert fake keypresses, view your screen, etc.
Basically a total system compromise.
All without log entries.
The correct way to do this is to use MIT-MAGIC-COOKIE.
One the client host:
$ xauth -extract - $DISPLAY
Then copy the output.
On the host running the X server:
$ xauth nmerge -
then paste the output copied previously.
Press enter and CTRL-D (EOF).
If you then check the output of "xhost" on the client, it should only say "Access control enabled."
- ThePhysicist 6y agoVcXsrv binds to localhost by default, so unless you already have malware on your system the added risk is quite small I'd say.
- szszrk 6y agoWhat about javascript code on a harmfull website that does requests to localhost? It used to be possible to easily scan what sites are running locally, even if js code was from a public website. [0] [0] https://defuse.ca/in-browser-port-scanning.htm https://defuse.ca/in-browser-port-scanning.htm
- ThePhysicist 6y agoA JS based exploit that hijacks the X Window System Core Protocol running on your localhost to inject key presses into your X server or steal screenshots? I mean it's possible, but it seems quite far-fetched except maybe if someone specifically targets you.
- gruez 6y agoThe main impediment is that http request won't look anything like the x window requests, so the x server would likely reject it.
- presumably 6y agoThere are actually several (published and non-published) ways to exploit that type of configuration, here is one example: https://samy.pl/slipstream/ https://samy.pl/slipstream/
- gruez 6y agoIf you're talking about the general concept of using js to spoof another protocol: that exploit involves middleboxes sniffing TCP connections at the packet level, rather than at connection/stream level. It certainly won't work for connections with a TCP server. If you're talking about using that exploit to allow access to the victim's machine from the internet: that won't work because listening interface for the x11 server is localhost, not the LAN interface.
- beowulfey 6y agoThank you for posting this. I tried many times to google how to do this and saw the magic cookie explanation, but never found a good clear description of what was happening. Much appreciated!
- Tepix 6y agoGlad to help. Btw there is a typo, you need to use "nextract", it's too late to edit it now
- numpad0 6y agoInstruction unclear: on the host running the X server, I get PS C:\Users\user> _
- tracker1 6y agomaybe something like... (cmd.exe -C xauth -extract - $Display) | xauth nmerge - first part to run via windows environment, second to pipe that to the wsl environment? Actual commands probably different, but should be something you could maybe trigger from inside .bashrc file.