Live data from Hacker News

Wayland Keylogger

github.com

81–90 of 121 posts

Re: Wayland Keylogger

#81
post #5

I do use Linux (almost) exclusively, but I'm well aware of the security limitations. Forget this keylogger. All you need is to somehow write a single line into .profile or .bashrc, which basically every executed program can do, and you own the user account. You can intercept every program with wrappers by changing PATH or adding desktop entries in .local/share/applications, extract all data from applications, use LD_…

A VSCode extension attempted to read/write to my contacts and calendar on macOS. Thankfully the sandbox (?) permissions UI notified me, I reported it to Microsoft and I believe they either pulled it or wound it back to an older version without that code in it. It had no need to access that data, so god knows what it was trying to do.

Re: Wayland Keylogger

#82
post #5

I do use Linux (almost) exclusively, but I'm well aware of the security limitations. Forget this keylogger. All you need is to somehow write a single line into .profile or .bashrc, which basically every executed program can do, and you own the user account. You can intercept every program with wrappers by changing PATH or adding desktop entries in .local/share/applications, extract all data from applications, use LD_…

    $ whoami
    admin
    $ sudo -- sh -c 'f="/home/admin/.bashrc"; chown root:admin $f; chmod 640 $f ; chattr +i $f'
    $ ls -al /home/admin/.bashrc
    -rw-r----- 1 root admin 1445 Jan 31 09:53 /home/admin/.bashrc
    $ rm /home/admin/.bashrc
    rm: cannot remove '/home/admin/.bashrc': Operation not permitted
    $ echo "writing?" >> /home/admin/.bashrc
    -bash: /home/admin/.bashrc: Operation not permitted

Re: Wayland Keylogger

#83
post #76

Earlier quoted context omitted.

> How do you figure? There are systems already (like Wayland) where default access to input only gives you input when the app is active, and entire different process is required for global hotkeys or key logging. That's not what is commonly understood as access to the input system. > There are no nice GUIs to manage that AFAIK, but this is not an impossible problem to solve anymore. So long you be willing to live wit…

> It would also mean that no modern browser works any more since they need access to far more to even start up. You are thinking again about old-style permissions control -- like SELinux. Yes, they are not going to work well, as you cannot really deny .cache access. But this is not what we do in the modern system. You start a new mount namespace, and then mount a new tmpfs over /home. Then you bind-mount outside ~/.c…

And still. If I can upload some text document or private picture with a web-browser onto some web host, then that web browser can also send that picture anywhere else to spy on me. Unless I need to give it permission every time I wish to do something such as that, which would be very cumbersome.

But yes, it's true that issues with the cache can be resolved with this, but not saving outside of a single file path, and whatever utility that then moves the file outside of that single path would still need full permissions or be granted permissions.

It can be done, but at the cost of a great deal of convenience and restrictions.

Re: Wayland Keylogger

#84

Earlier quoted context omitted.

So does Android , but the same security is what creates a “walled garden”. To limit what malicious software that runs as one's user can do, one must limit what the user can do, and that's exactly what they attempt to do. I personally præfer that the user be trusted to be wise enough to run software that he does not trust in a contained environment, and he be given the freedom to control his own environment as he plea…

>To limit what malicious software that runs as one's user can do, one must limit what the user can do This is completely untrue. You can gain root access on Android and have full access to do anything while still keeping applications sandboxed. Limiting user freedoms is simply an extra thing that came with new mobile OSs.

With “the user” I mean “user” in the operating system sense, not the human being.

Many “users” on Unix do not correspond to any particular physical human being.

Re: Wayland Keylogger

#85
post #76

Earlier quoted context omitted.

> It would also mean that no modern browser works any more since they need access to far more to even start up. You are thinking again about old-style permissions control -- like SELinux. Yes, they are not going to work well, as you cannot really deny .cache access. But this is not what we do in the modern system. You start a new mount namespace, and then mount a new tmpfs over /home. Then you bind-mount outside ~/.c…

And still. If I can upload some text document or private picture with a web-browser onto some web host, then that web browser can also send that picture anywhere else to spy on me. Unless I need to give it permission every time I wish to do something such as that, which would be very cumbersome. But yes, it's true that issues with the cache can be resolved with this, but not saving outside of a single file path, and…

There was am academic system (whose name I unfortunately cannot recall now) which would hook up the "file open" dialog and run it from trusted mode. When a user would pick up a file, then the program would have access to it, and only it. This apparently worked pretty great for programs which needed only one file. It probably would not have worked as great for programs which do more advanced stuff, like IDEs which need to be able to "search in files". I think modern Androids can do the same sometimes?

But practically, as a person who runs sandboxed browser daily, it there is not "a great deal of convenience and restrictions". Even before sandbox, I'd download files to default location and later move some of them elsewhere -- so this is not really changing. A requirement to place files which need to be uploaded into a shared folder is somewhat annoying, but I found out that I don't upload that many files from browsers anyway.

Re: Wayland Keylogger

#86
post #5

I do use Linux (almost) exclusively, but I'm well aware of the security limitations. Forget this keylogger. All you need is to somehow write a single line into .profile or .bashrc, which basically every executed program can do, and you own the user account. You can intercept every program with wrappers by changing PATH or adding desktop entries in .local/share/applications, extract all data from applications, use LD_…

Aside from wrapping applications with Firejail, I would also recommend setting up AppArmor[1] or SELinux in enforce mode, as most Linux distributions do not do that by default[2]. Things will break from time to time until you modify the default profiles, and you will need to write profiles for applications that do not ship with one by default, but it is worth the time you spent. [1] A MAC just like SELinux, but with…

This is good advice! I’ve heard many engineers bemoan setting up SELinux policies however they’ll dump a non-trivial amount of time into security theatre.

Re: Wayland Keylogger

#87
One of my main gripes unfortunately Wayland does not function very well with accessibility software without elevated privileges. Areas include but not limited to :

-simulated keyboard/mouse input (some progress recently with some composers)

ability to inspect window attributes (e.g. window title, executable and handle)

ability to manipulate windows (e.g. maximise, close, etc)

Considerations do need to be made in the framework / protocol for accessibility. I'm hoping the situation has changed. Possibly someone could comment on that.

Re: Wayland Keylogger

#88
post #18
post #5

I do use Linux (almost) exclusively, but I'm well aware of the security limitations. Forget this keylogger. All you need is to somehow write a single line into .profile or .bashrc, which basically every executed program can do, and you own the user account. You can intercept every program with wrappers by changing PATH or adding desktop entries in .local/share/applications, extract all data from applications, use LD_…

I would love to see a real permission system on Linux, where applications have to explicitly ask me before accessing things deemed important. It's never been a problem for me, but it would give me some comfort.

Someone needs to finish off Capsicum/CloudABI, and then we redo the userland. Will be so much simpler think about too.

Re: Wayland Keylogger

#89
post #64

The position of the Wayland project is that security isolation requires sandboxing. Otherwise, applications can do whatever you can do, including changing all your personal config files and scripts. The security considerations in Wayland are primarily aimed at not being a weak link undermining sandboxing efforts, which is the case with X11. Without sandboxing, writing to e.g. ~/.profile would in most cases be enough…

> The position of the Wayland project is that security isolation requires sandboxing. which is not really a step forward since now I have do go and sandbox every app.

You always had to. There’s no magic universe where an app has the full privilege to do everything you as a user can do while also preventing it from doing things that you could do. Whatever mechanism that enforces those restrictions is the sandbox.

Re: Wayland Keylogger

#90

Earlier quoted context omitted.

Of those distributions, only Fedora sets SELinux to enforcing by default. Moreover, AFAIK Fedora (and RHEL) are the only distributions that had wide-scale testing of the reference policy [1] [2]. So, if you enable SELinux with the reference policy on the other distributions that you mention, it is likely that you will run into all kinds of issues. [1] https://github.com/SELinuxProject/refpolicy [2] https://github.com…

Every day I become more and more of the opinion that Fedora/RHEL are the only distros that are actually worth using. I recently installed ubuntu server to see what it was like compared to fedora server and was shocked to see that the python package still links to python 2 (!) despite it already being officially discontinued. Fedora Silverblue/CoreOS look like a massive step in the right direction which no other mains…

> I recently installed ubuntu server to see what it was like compared to fedora server and was shocked to see that the python package still links to python 2 (!) despite it already being officially discontinued.

How recently? Ubuntu 20.04 dropped python 2 completely.

Post reply on HN