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

[BUG] Literal commands in Powershell Agent not working (else is not recognized) #674

Closed
crittico opened this issue Jul 10, 2023 · 0 comments · Fixed by #675
Closed

[BUG] Literal commands in Powershell Agent not working (else is not recognized) #674

crittico opened this issue Jul 10, 2023 · 0 comments · Fixed by #675
Assignees
Labels
bug Something isn't working confirmed

Comments

@crittico
Copy link

Empire Version

  • Empire 5.1.2

OS Information (Linux flavor, Python version)

  • OS: Docker Image
  • Python: 3.11.2

Describe the bug

When trying to launch a literal command within a Powershell Agent I get the following error:
The term 'else' is not recognized as the name of a cmdlet, function, script file, or operable program.

To Reproduce

Steps to reproduce the behavior:

  1. Go to a live Powershell Agent -> Interact tab
  2. Enter a Shell command (e.g. whoami /priv) checking the Literal box
  3. Go to Task and see the error

Expected behavior

The result of the command launched.

Screenshots

Error of the command executed:
image

Additional context

The problem is in the Agent.ps1 file, as you can see below there's a ';' after an If and before the following Else.
image

I already submitted a trivial pull request that fixes the problem, I'm creating this bug report just to make it easier for other people to find this bug.

@crittico crittico added the bug Something isn't working label Jul 10, 2023
@Cx01N Cx01N linked a pull request Jul 10, 2023 that will close this issue
@Cx01N Cx01N self-assigned this Jul 10, 2023
vinnybod added a commit that referenced this issue Oct 17, 2023
* add a coverage report to pull requests

* typo

* add extra exclusions

* update changelog

* bump black on pre-commit and github actions to match poetry lock

* use pre-commit mirror for faster runs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working confirmed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants