Swift Keylogger: Keylogger for mac written in Swift

Swift Keylogger

Swift Keylogger – macOS Keylogger

It is a simple and easy to use keylogger for macOS. It is not meant to be malicious. There are only a few keyloggers available for Mac and none of them are in Swift.

Another problem is with Apple high-level APIs. I don’t know the reason but Apple suddenly deprecates and removes the documentation of APIs from its website.

So, I don’t want to keep checking about the availability of their APIs and changing my code frequently. That is the reason I went to low-level API which is using HID API.

Most of the keyloggers available only log keystrokes into a file without much information about on which app the keystrokes are generated.

Note: This keylogger doesn’t capture secure input fields like passwords due to EnableSecureEventInput

Usage Swift Keylogger

Clone the repository and open the project in Xcode and build the project and run the executable.

git clone https://github.com/SkrewEverything/Swift-Keylogger.git

To run it in the background

To be able to close the Terminal when Keylogger is running, use this command while running the executable.

$ nohup ./Keylogger &

And you can quit the Terminal.

To quit/stop the Keylogger

To quit the Keylogger, first, find its PID using ps and use kill to stop the keylogger.

$ ps -e | grep “Keylogger”
$ kill -9 pid_of_keylogger_from_above_command

When it’s run, it creates folder Data

|--Keylogger

|--Data
|--App
|--Devices
|--Key

Key folder stores all the keystrokes according to the application. App folder stores all the timestamps of applications being active. Devices folder stores the information on the connected keyboards.

By default, it creates a folder where the executable is present. To change the path edit bundlePathURL in Keylogger.swift

All the data is grouped according to day in each folder.

Disclaimer

If the use of this product causes the death of your firstborn or anyone, I’m not responsible ( no warranty, no liability, etc.)

For technical people: It is only for educational purpose.

Source: https://github.com/SkrewEverything/Swift-Keylogger