say i have the following code, using syscall
to hide command line window
process := exec.Command(name
There is a better solution, which can run exec.Command()
without spawn a visible window, ( ͡° ͜ʖ ͡°).
Here is my code:
Firstly import "syscall"
cmd_path := "C:\\Windows\\system32\\cmd.exe"
cmd_instance := exec.Command(cmd_path, "/c", "notepad")
cmd_instance.SysProcAttr = &syscall.SysProcAttr{HideWindow: true}
cmd_output, err := cmd_instance.Output()
Origin: https://www.reddit.com/r/golang/comments/2c1g3x/build_golang_app_reverse_shell_to_run_in_windows/