Skip to content

nsaway/keylogger

This branch is 3 commits ahead of, 22 commits behind MarinX/keylogger:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

02098eb · Feb 26, 2020

History

6 Commits
Feb 26, 2020
Sep 27, 2015
Sep 27, 2015
Sep 27, 2015
Apr 27, 2017
Sep 27, 2015
Sep 27, 2015

Repository files navigation

KeyLogger

Description

Capture global keyboard events on Linux

Installation

go get github.com/MarinX/keylogger

Notes

  • Only Linux based
  • Need root privilages

Example

package main

import (
    "fmt"
    "github.com/MarinX/keylogger"
)

func main() {
    devs, err := keylogger.NewDevices()
    if err != nil {
	    fmt.Println(err)
	    return
    }

    for _, val := range devs {
	    fmt.Println("Id->", val.Id, "Device->", val.Name)
    }

    //keyboard device file, on your system it will be diffrent!
    rd := keylogger.NewKeyLogger(devs[3])

    in, err := rd.Read()
    if err != nil {
	    fmt.Println(err)
	    return
    }

    for i := range in {

	    //we only need keypress
	    if i.Type == keylogger.EV_KEY {
		    fmt.Println(i.KeyString())
	    }
    }
}

Creating key sniffer

License

This library is under the MIT License

Author

Marin Basic

About

Basic keylogger in Go (no C deps)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%