Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The cmd window is not hidden when executing the command #1746

Open
23jdn opened this issue Jul 13, 2024 · 1 comment
Open

The cmd window is not hidden when executing the command #1746

23jdn opened this issue Jul 13, 2024 · 1 comment

Comments

@23jdn
Copy link

23jdn commented Jul 13, 2024

I found the control command in sliver/implant/sliver/handlers/handlers.go. In line 556, I used cmd.SysProcAttr = &syscall.SysProcAttr{HideWindow: true} to hide the window, but after the modification, I used make or go build to compile the client and server, but the line of code did not take effect

func executeHandler(data []byte, resp RPCResponse) {
	var (
		err       error
		stdErr    io.Writer
		stdOut    io.Writer
		errWriter *bufio.Writer
		outWriter *bufio.Writer
	)
	execReq := &sliverpb.ExecuteReq{}
	err = proto.Unmarshal(data, execReq)
	if err != nil {
		// {{if .Config.Debug}}
		log.Printf("error decoding message: %v", err)
		// {{end}}
		return
	}

	execResp := &sliverpb.Execute{}
	exePath, err := expandPath(execReq.Path)
	if err != nil {
		execResp.Response = &commonpb.Response{
			Err: fmt.Sprintf("%s", err),
		}
		proto.Marshal(execResp)
		resp(data, err)
		return
	}
	cmd := exec.Command(exePath, execReq.Args...)
	cmd.SysProcAttr = &syscall.SysProcAttr{HideWindow: true}
@orangex
Copy link

orangex commented Sep 17, 2024

Any solution? Facing a similar situation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants