News for hackers. Stuff that matters.
Re:A New Attack Can Unmask Anonymous Users on Any Major Browser by Aachen on Saturday June 03, 2023 @05:59AM (#36175220)
My work requires me to open links in different VMs. How exactly do I tell a browser to override link clicks to be handled by an external program? This would be very useful indeed
Re:A New Attack Can Unmask Anonymous Users on Any Major Browser by fsflover on Saturday June 03, 2023 @03:35PM (#36179800)
This is how I do it on Debian. First, reate a custom "browser" like this:

touch .local/share/applications/open-in-dispvm.desktop,

and put inside a command like this:

qvm-open-in-vm '@dispvm:fedora-37-dvm' %u

in accordance with this guide:

https://www.qubes-os.org/doc/how-to-use-disposables/#opening...

To make this browser default, you do this:

xdg-settings set default-web-browser open-in-dispvm.desktop

See also how to create .desktop files: https://askubuntu.com/questions/45885/how-do-i-set-a-custom-....

Re:A New Attack Can Unmask Anonymous Users on Any Major Browser by Aachen on Saturday June 03, 2023 @06:24PM (#36181099)
Browsers don't call the OS to open a URL, it would have to be an add-on or something
Re:A New Attack Can Unmask Anonymous Users on Any Major Browser by fsflover on Saturday June 03, 2023 @06:39PM (#36181192)
Indeed, it only works for other applications, not browsers. Interesting question. Perhaps you could ask it on the Qubes forum: https://forum.qubes-os.org.
Re:A New Attack Can Unmask Anonymous Users on Any Major Browser by xk_id on Saturday June 03, 2023 @03:43PM (#36179869)
When the link is in a different app (e.g email client), the click event is handled by the OS and the URI is sent to the “default app” for that URI schema (for http/https, that would be your default browser). You can therefore reconfigure your OS to use a different app for that schema.

On Mac, you can for example create a simple App in AppleScript with the following code:

  on open location the_url
     do shell script "/path/script.sh" & quoted form of the_url
  end open location

Then, using a tool like “SwiftDefaultApps”, you can configure this new AppleScript app to be the default app for the http/https schema.

In script.sh, which receives the clicked url as the its first positional argument, you can then run any arbitrary logic that you require.

So this idea would work if the links you wanted to open were coming from another app. If they come from inside the browser, I would suggest writing an additional browser extension that replaces all http/https links in a page with an invented URI schema, like newschema://. Then the browser would pass those links to the OS for handling and then you would have full control over how to handle this new schema.

Hope this makes sense.

Re:A New Attack Can Unmask Anonymous Users on Any Major Browser by Aachen on Saturday June 03, 2023 @06:25PM (#36181106)
That makes sense and I knew this, but browsers are the main use case for me, not external programs
Re:A New Attack Can Unmask Anonymous Users on Any Major Browser by xk_id on Saturday June 03, 2023 @09:22PM (#36182110)
Yeah, so your script.sh could send the URI received in its positional argument to a browser with the configuration you need (and substitute newscheme:// to https://). I think it’s 100% doable