myph.git


myph

~ shellcode loader for your evasion needs
git clone https://github.com/matro7sh/myph.git
log | files | refs | archive | README | LICENSE

commit 5a342f4d3fd246855eeaf9baed0bac2519050819
parent 09dc0e6213d83d0f0887bf975d425f3c63241835
Author: H Mike <[email protected]>
Date: Thu, 7 Nov 2024 01:09:25 +0100

[Feat] - Add the option to generate a DLL. (#18) * add flag to compile as dll and fix output name file * add extension * fix(cli): default -b option is always exe Signed-off-by: djnn <[email protected]> --------- Signed-off-by: djnn <[email protected]> Co-authored-by: djnn <[email protected]>

Diffstat:
Mcli/defaults.go | 2+-
Mcli/parser.go | 4+++-

2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/cli/defaults.go b/cli/defaults.go
@@ -8,7 +8,7 @@ import (
 func GetDefaultCLIOptions() Options {
 	opts := Options{
 		ShellcodePath:   "msf.raw",
-		OutName:         "payload.exe",
+		OutName:         "payload",
 		OS:              "windows",
 		Arch:            "amd64",
 		Target:          "cmd.exe",
diff --git a/cli/parser.go b/cli/parser.go
@@ -72,6 +72,7 @@ func BuildLoader(opts *Options) *exec.Cmd {
 func GetParser(opts *Options) *cobra.Command {
 
 	version := "1.2.3"
+
 	var spoofMetadata = &cobra.Command{
 		Use:                "spoof",
 		Version:            version,
@@ -333,7 +334,7 @@ func GetParser(opts *Options) *cobra.Command {
 			tools.MoveFile(MYPH_TMP_WITH_PAYLOAD+format, opts.OutName+"."+format)
 			os.RemoveAll(MYPH_TMP_DIR)
 
-			fmt.Printf("[+] Done! Compiled payload: %s\n", opts.OutName)
+			fmt.Printf("[+] Done! Compiled payload: %s\n", opts.OutName+"."+opts.BuildType)
 		},
 	}
 
@@ -343,6 +344,7 @@ func GetParser(opts *Options) *cobra.Command {
 	rootCmd.AddCommand(spoofMetadata)
 
 	rootCmd.Flags().StringVarP(&opts.OutName, "out", "f", defaults.OutName, "output name")
+	rootCmd.Flags().StringVarP(&opts.BuildType, "binary-format", "b", defaults.BuildType, "Binary format (exe,dll)")
 	rootCmd.Flags().StringVarP(&opts.ShellcodePath, "shellcode", "s", defaults.ShellcodePath, "shellcode path")
 	rootCmd.Flags().StringVarP(&opts.Target, "process", "p", defaults.Target, "target process to inject shellcode to")
 	rootCmd.Flags().StringVarP(&opts.Technique, "technique", "t", defaults.Technique, "shellcode-loading technique (allowed: CRT, CRTx, CreateFiber, ProcessHollowing, CreateThread, NtCreateThreadEx, Syscall, SyscallTest, Etwp)")