aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-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")