All Projects → jarun → Spy

jarun / Spy

Licence: gpl-2.0
👀 Linux kernel mode debugfs keylogger

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Spy

kernel-memtest
Hybrid memtest running in kernel mode, and userspace.
Stars: ✭ 17 (-96.89%)
Mutual labels:  kernel, linux-kernel
Sphinx-Dipper
Sphinx Custom Kernel for Mi 8 (Dipper)
Stars: ✭ 17 (-96.89%)
Mutual labels:  kernel, linux-kernel
w1-gpio-cl
Command line configured kernel mode 1-wire bus master driver. w1-gpio standard Linux module enhancement/substitution.
Stars: ✭ 17 (-96.89%)
Mutual labels:  kernel, linux-kernel
Linux Uek
Oracle Linux UEK: Unbreakable Enterprise Kernel
Stars: ✭ 185 (-66.12%)
Mutual labels:  kernel, linux-kernel
kernel-ci
Continuous integration for the Linux Kernel - Built within Docker
Stars: ✭ 34 (-93.77%)
Mutual labels:  kernel, linux-kernel
Prototype Kernel
Prototyping kernel development work outside mainline
Stars: ✭ 214 (-60.81%)
Mutual labels:  kernel, linux-kernel
OpenHarmony
华为鸿蒙分布式操作系统(Huawei OpenHarmony)开发技术交流,鸿蒙技术资料,手册,指南,共建国产操作系统万物互联新生态。
Stars: ✭ 373 (-31.68%)
Mutual labels:  kernel, linux-kernel
Linux 0.11
A heavily commented linux kernel source code in Chinese.
Stars: ✭ 81 (-85.16%)
Mutual labels:  kernel, linux-kernel
Microdot
The Microdot Project guides you to create a fully functional but compact Linux system from scratch
Stars: ✭ 41 (-92.49%)
Mutual labels:  kernel, linux-kernel
linux kernel wiki
linux内核学习资料:200+经典内核文章,100+内核论文,50+内核项目,500+内核面试题,80+内核视频
Stars: ✭ 1,653 (+202.75%)
Mutual labels:  kernel, linux-kernel
Linux Samus
Linux 4.16 on Chromebook Pixel 2015
Stars: ✭ 179 (-67.22%)
Mutual labels:  kernel, linux-kernel
Sphinx-Beryllium
Sphinx Custom Kernel for Pocophone F1 (Beryllium)
Stars: ✭ 23 (-95.79%)
Mutual labels:  kernel, linux-kernel
Linux Kernel Utilities
👷 Utilities to compile and / or update linux kernels for Debian and derivatives (e.g. Ubuntu, LinuxMint, etc.)
Stars: ✭ 166 (-69.6%)
Mutual labels:  kernel, linux-kernel
Kvm Kernel Example
Examples for: Learning KVM - implement your own kernel
Stars: ✭ 221 (-59.52%)
Mutual labels:  kernel, linux-kernel
Raspberry Pi Os
Learning operating system development using Linux kernel and Raspberry Pi
Stars: ✭ 11,000 (+1914.65%)
Mutual labels:  kernel, linux-kernel
Linux-Kernel-Exploitation
Linux kernel development & exploitation lab.
Stars: ✭ 130 (-76.19%)
Mutual labels:  kernel, linux-kernel
Traceshark
This is a tool for Linux kernel ftrace and perf events visualization
Stars: ✭ 63 (-88.46%)
Mutual labels:  kernel, linux-kernel
Simplefs
A simple file system for Linux kernel
Stars: ✭ 65 (-88.1%)
Mutual labels:  kernel, linux-kernel
execmon
Advanced process execution monitoring utility for linux (procmon like)
Stars: ✭ 77 (-85.9%)
Mutual labels:  kernel, linux-kernel
camflow-dev
Generates kernel patch for CamFlow Linux Provenance Capture.
Stars: ✭ 19 (-96.52%)
Mutual labels:  kernel, linux-kernel

spy

A Linux kernel module to grab keys pressed in the keyboard, or a keylogger.

It's also an academic project for devs willing to learn Linux kernel module programming, with extensive comments, checkpatch.pl scanned code, standards-compliant Makefile and DKMS support.

spy was initially written for the US keyboard (and conforming laptops). By default it shows human-readable strings for the keys pressed. Optionally, the keycode shift_mask pair can be printed in hex or decimal. You can lookup the keycodes in /usr/include/linux/input-event-codes.h.

The keypress logs are recorded in debugfs as long as the module is loaded. Only root or sudoers can read the log. The module name has been camouflaged to blend-in with other kernel modules.

You can, however, execute a script at shutdown or reboot (the procedure would be distro-specific) to save the keys to a file.

DISCLAIMER: spy is intended to track your own devices and NOT to trespass on others. The author is not responsible for any unethical application.

Love smart and efficient utilities? Explore my repositories. Buy me a cup of coffee if they help you.

Donate via PayPal!

Table of contents

Compilation

Build

Clone the repository and run:

# make

Note that you need to have the linux kernel headers installed for your running kernel version.

To insert the module into the kernel, run:

# insmod kisni.ko
OR
# make load

To unload the module (and clear the logs), run:

# rmmod kisni

DKMS support

If you have DKMS installed, you can install spy in such a way that it survives kernel upgrades. It is recommended to remove older versions of spy by running dkms remove -m kisni -v OLDVERSION --all as root. To install the new version, run:

# make -f Makefile.dkms

To uninstall it, run:

# make -f Makefile.dkms uninstall

Usage

To view the pressed keys, run:

# cat /sys/kernel/debug/kisni/keys
modinfo kisni.ko
cat /sys/kernel/debug/kisni/keys
#

To log generic hex keycodes in the format keycode shift_mask, run:

# insmod kisni.ko codes=1
// Type something
# cat /sys/kernel/debug/kisni/keys
23 0
12 0
26 0
26 0
18 0
39 0
2a 0
2a 1
2a 1
11 1
18 0
13 0
26 0
20 0
2a 0
2a 1
2a 1
2 1
1c 0
1f 0
16 0
20 0
18 0
39 0
2e 0
1e 0
14 0
6a 0
1c 0

To log the keycodes in decimal, run:

# insmod kisni.ko codes=2

To check the module details:

# modinfo kisni.ko
filename:       kisni.ko
description:    Sniff and log keys pressed in the system to debugfs
version:        1.8
author:         Arun Prakash Jana <[email protected]>
license:        GPL v2
srcversion:     F62F351D06A999293307C20
depends:
retpoline:      Y
name:           kisni
vermagic:       5.4.0-48-generic SMP mod_unload
parm:           codes:log format (0:US keys (default), 1:hex keycodes, 2:dec keycodes) (int)

License

License

Developer

Copyright © 2015 Arun Prakash Jana

Links

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].