Initial commit: LAN RDP with keylogger support
This commit is contained in:
commit
c4adcbbe0f
33 files changed
+4335
No files matched your search
Executable
+35
@@ -0,0 +1,35 @@
|
||||
// Command hashpw reads a single line (a passphrase) from stdin and prints
|
||||
// its Argon2id hash to stdout, with no other output. It exists so
|
||||
// build-host.ps1 can turn a passphrase into the string that gets baked
|
||||
// into host.exe via -ldflags, without duplicating the hashing logic
|
||||
// outside of Go.
|
||||
package main
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"lanrdp/internal/protocol"
|
||||
)
|
||||
|
||||
func main() {
|
||||
reader := bufio.NewReader(os.Stdin)
|
||||
line, err := reader.ReadString('\n')
|
||||
if err != nil && line == "" {
|
||||
fmt.Fprintln(os.Stderr, "hashpw: reading passphrase from stdin:", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
line = strings.TrimRight(line, "\r\n")
|
||||
if len(line) < 8 {
|
||||
fmt.Fprintln(os.Stderr, "hashpw: passphrase must be at least 8 characters")
|
||||
os.Exit(1)
|
||||
}
|
||||
hash, err := protocol.HashPassword(line)
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, "hashpw:", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
fmt.Print(hash)
|
||||
}
|
||||
Reference in new issue
Block a user