aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorheqnx <root@heqnx.com>2025-06-03 23:07:22 +0300
committerheqnx <root@heqnx.com>2025-06-03 23:07:22 +0300
commit3acc97fddf208f52cf20fcc2ad7864d9846013ca (patch)
treedd8d54478e838d4fb7bb5dcfa9c8cac29ac47077
parentbf4b50c3cc9b93ce779bb5f040c727a450fdd89c (diff)
downloadgo-powerglot-3acc97fddf208f52cf20fcc2ad7864d9846013ca.tar.gz
go-powerglot-3acc97fddf208f52cf20fcc2ad7864d9846013ca.zip
added author
-rw-r--r--main.go20
1 files changed, 20 insertions, 0 deletions
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")