From 3acc97fddf208f52cf20fcc2ad7864d9846013ca Mon Sep 17 00:00:00 2001 From: heqnx Date: Tue, 3 Jun 2025 23:07:22 +0300 Subject: added author --- main.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/main.go b/main.go index f8955de..2663a1e 100644 --- a/main.go +++ b/main.go @@ -148,6 +148,21 @@ func embedScriptInPNG(scriptPath, outPath, imagePath, execPath string) (string, return psCmd, nil } +func init() { + const usageHeader = ` +offensive security utility that embeds PowerShell scripts into PNG images using pixel-level steganography + +author: heqnx - https://heqnx.com + +` + flag.Usage = func() { + fmt.Fprint(os.Stderr, usageHeader) + fmt.Fprintf(os.Stderr, "usage of %s:\n", os.Args[0]) + flag.PrintDefaults() + } + flag.CommandLine.SetOutput(os.Stderr) +} + func main() { imagePath := flag.String("image", "", "input png file") scriptPath := flag.String("script", "", "powershell script file to embed") @@ -155,6 +170,11 @@ func main() { outPath := flag.String("out", "", "output png file") flag.Parse() + if flag.NFlag() == 0 && flag.NArg() == 0 { + flag.Usage() + os.Exit(1) + } + if *scriptPath == "" || *outPath == "" || *imagePath == "" || *execPath == "" { fmt.Println("go implementation to embed powershell scripts into png images using steganography") fmt.Println("use the powershell one-liner to decode and iex the embedded script") -- cgit v1.2.3