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."It used to be possible to easily scan what sites are running locally, even if js code was from a public website. [0]
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.
Btw there is a typo, you need to use "nextract", it's too late to edit it now
(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.
PS C:\Users\user> _My VcXsrv config is public on GitHub at: https://github.com/nickjj/dotfiles/blob/master/c/Users/Nick/...
Putting it in that directory sets VcXsrc to start when Windows boots up. You would just replace "Nick" with your Windows user name and put it in that path. Then you never have to worry about starting VcXsrv ever again.
Also if anyone is using both WSL 2 and WSL 1, you need to set different values for DISPLAY depending on which version you use.
My .bashrc handles this at: https://github.com/nickjj/dotfiles/blob/385007837ab787a2be2e...
It's not slow for me. Maybe you have something else running that's interfering with WSL (Defender, etc.)?
I've been using the VcXsrv set up for years (in WSL 1 and now WSL 2). It runs native GUI Linux apps really well. It's how I ran Sublime Text in WSL for a long time before I eventually switched to a different editor. I even ran i3 in it for a bit but gave up on that because it didn't work well with dual monitors. It was smooth as butter tho.
export DISPLAY=$(route -n | grep UG | head -n1 | awk '{print $2}'):0
and on the Windows side, start VcXsrv with the 'Disable Access Control' combo box checked. this will enable X clients from other hosts (WSL is another host, basically) to connect to the server without too much hassle. that's it.