diff options
author | heqnx <root@heqnx.com> | 2025-06-03 23:07:22 +0300 |
---|---|---|
committer | heqnx <root@heqnx.com> | 2025-06-03 23:07:22 +0300 |
commit | 3acc97fddf208f52cf20fcc2ad7864d9846013ca (patch) | |
tree | dd8d54478e838d4fb7bb5dcfa9c8cac29ac47077 | |
parent | bf4b50c3cc9b93ce779bb5f040c727a450fdd89c (diff) | |
download | go-powerglot-3acc97fddf208f52cf20fcc2ad7864d9846013ca.tar.gz go-powerglot-3acc97fddf208f52cf20fcc2ad7864d9846013ca.zip |
added author
-rw-r--r-- | main.go | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -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") |