Live data from Hacker News

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

github.com

1–10 of 84 posts

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

#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.

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

#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 some cases the event was not being triggered. Turned out that the browser password field used EnableSecureEventInput and so the if the cursor focus was in the password input box, the tab button press would not be detected by my code. Pressing it twice worked because:

-first tab press moved cursor focus out of the password box

-second tab press was in the username input field which was not a secure input field, so my code received the tab keydown event.

The weird part about this is since the tab keydown moves the cursor focus out of the secure text box what you receive is a tab keyup event with no keydown before it.

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

#5
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.

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.

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

#7
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.

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...

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

#8
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.

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!

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

#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 the background. It now becomes your process' responsibility to call DisableSecureEventInput when secure entry input is not required, such as when your process detects that it is moving to the background."

0: https://developer.apple.com/library/content/technotes/tn2150...

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

#10
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.

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