Live data from Hacker News

Swift-Keylogger – Keylogger for MacOS written in Swift using HID

github.com

11–20 of 84 posts

Re: Swift-Keylogger – Keylogger for MacOS written in Swift using HID

#11
post #9
post #2

It doesn't log passwords using EnableSecureEventInput. There are probably other use cases, but Apple seems to have implemented things rather well here.

> but Apple seems to have implemented things rather well here. Reading up on it further [0] it seems you could write an anti-keylogger. Just have an app that calls EnableSecureEventInput and never disables it and no other processes would be able to capture key input: "The system will no longer pass keyboard intercept processes keyboard events if your process has enabled secure input even when your process is moved to…

Although that would probably break some apps. See for example: https://news.ycombinator.com/item?id=15488964

Re: Swift-Keylogger – Keylogger for MacOS written in Swift using HID

#12
post #4
post #2

It doesn't log passwords using EnableSecureEventInput. There are probably other use cases, but Apple seems to have implemented things rather well here.

Yes I once spent a whole day debugging an issue related to this because I was unaware of it. I was getting a game Steam ready and I was working on the Steam overlay that is triggered by the tab key. QA reported that on the login screen, you sometimes had to press tab twice to get the overlay to open. Just on that one screen. I had a piece of code that was looking for the tab keydown event to open the overlay, but in…

Interesting anecdote. What did you end up doing? Did you just leave it as-was?

Re: Swift-Keylogger – Keylogger for MacOS written in Swift using HID

#13
post #8
post #3

Earlier quoted context omitted.

It would be nice if macOS had the same permissions models as iOS, and then some. A permission before apps can access the camera, or access what keys are held down when the app isn't in the foreground - that would block this case.

The permission model on the Mac is that it is up to the user. Don’t run software that you don’t trust, end of story!

I believe that was the problem.

Re: Swift-Keylogger – Keylogger for MacOS written in Swift using HID

#15
post #3
post #2

It doesn't log passwords using EnableSecureEventInput. There are probably other use cases, but Apple seems to have implemented things rather well here.

It would be nice if macOS had the same permissions models as iOS, and then some. A permission before apps can access the camera, or access what keys are held down when the app isn't in the foreground - that would block this case.

Yes, it would be very nice if operating systems had a sane (let alone user-friendly!) way to properly, thoroughly sandbox userland applications.

It's a large reason why "web applications" became a thing -- it gives you sandboxed remote programs (and easy-access to boot!) Even if the web-browsing sandbox is flawed, it's been a convenient band-aid over a fundamental OS feature that, sadly, still doesn't properly exist.

Re: Swift-Keylogger – Keylogger for MacOS written in Swift using HID

#16
post #7
post #5

Earlier quoted context omitted.

This would effectively kill innovation. There is a reason you can't do half the things you do on a laptop on a phone unless you root said phone.

I'm not sure I buy that requiring user opt-in to camera access is why the Mac app ecosystem is is much larger than that of iOS. Can you elaborate on what apps/innovations would become impossible because of a mandatory opt-in? I cannot think of any...

Keyloggers which don't require any permissions, apparently

Re: Swift-Keylogger – Keylogger for MacOS written in Swift using HID

#17
post #5
post #3

Earlier quoted context omitted.

It would be nice if macOS had the same permissions models as iOS, and then some. A permission before apps can access the camera, or access what keys are held down when the app isn't in the foreground - that would block this case.

This would effectively kill innovation. There is a reason you can't do half the things you do on a laptop on a phone unless you root said phone.

The idea is not to prevent programs doing those things, it's to prevent programs doing those things without user permission.

Re: Swift-Keylogger – Keylogger for MacOS written in Swift using HID

#18
post #3

Earlier quoted context omitted.

It would be nice if macOS had the same permissions models as iOS, and then some. A permission before apps can access the camera, or access what keys are held down when the app isn't in the foreground - that would block this case.

Funny, I wish it was the other way around. The current model makes far to easy to impersonate elevated dialogs in iOS.

Is it hard to impersonate elevated dialogs on macOS?

Re: Swift-Keylogger – Keylogger for MacOS written in Swift using HID

#19
post #7
post #5

Earlier quoted context omitted.

This would effectively kill innovation. There is a reason you can't do half the things you do on a laptop on a phone unless you root said phone.

I'm not sure I buy that requiring user opt-in to camera access is why the Mac app ecosystem is is much larger than that of iOS. Can you elaborate on what apps/innovations would become impossible because of a mandatory opt-in? I cannot think of any...

The problem with an opt-in system is that you have to sandbox the whole app (otherwise, evading the opt-in would be trivial) and therefore lock out any advanced access not explicitly listed as an opt-in permission.

If you want an example, there's F.lux, which doesn't work (without rooting) on Android and iOS.

Post reply on HN