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

Agent Crashes When Executed Command Returns an Error #17

Closed
2 tasks done
Ne0nd0g opened this issue Jul 9, 2022 · 0 comments
Closed
2 tasks done

Agent Crashes When Executed Command Returns an Error #17

Ne0nd0g opened this issue Jul 9, 2022 · 0 comments

Comments

@Ne0nd0g
Copy link
Owner

Ne0nd0g commented Jul 9, 2022

Prerequisite

  • I have searched the opened & closed issues
  • I have searched the WIKI and its FAQ page

Environment Data

  • Merlin Version: v1.4.2
  • Merlin Build: 5ac7f6e
  • Go Version: 1.17
  • GOPATH Environment Variable: N/A
  • GOROOT Environment Variable: N/A
  • Operating System: Windows

Expected Behavior

Expected to create a sacrificial logon session and then run a command without the agent crashing.

Actual Behavior

Agent crashes after creating a sacrificial logon session and then trying to run a command

Steps to Reproduce Behavior

  1. From a Windows agent, create a sacrificial logon sessions with token make ACME\\RAstley password
  2. Run a program with that token by issuing run klist
  3. Agent will crash

Misc Information

The problem is in the commands/exec_windows.go file because error checks are not performed before trying to reference the object:

	cmd := exec.Command(application, args...)
	cmd.SysProcAttr = attr

	out, err := cmd.CombinedOutput()
	stdout = fmt.Sprintf("Created %s process with an ID of %d\n", application, cmd.Process.Pid)
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

1 participant