-
Notifications
You must be signed in to change notification settings - Fork 807
Closed
Labels
BugAn error, flaw, misbehavior or failure in the Monkey or Monkey Island.An error, flaw, misbehavior or failure in the Monkey or Monkey Island.Complexity: HighImpact: High
Description
Describe the bug
Infection Monkey exploits MSSQL by using the xp_cmdshell
command to write commands to a temporary batch file and then to execute it. The commands sent to xp_cmdshell
are split into 128 character chunks. The logic used to split these commands is faulty and causes the temporary batch file to contain incorrect commands.
As shown in the screenshot above, the command in the batch file is missing a space between the parent agent's ID and the -t
option. It appears that the shell ignores the first space in /p= -t...
.
To Reproduce
Steps to reproduce the behavior:
- Run AppImage end-to-end tests.
Expected behavior
Agent should successfully propagate to an MSSQL target
Possible solutions
- Fix the logic that chunks up the commands and pray that similar, obscure, and difficult to reproduce errors to not creep in now or in the future.
- Remove this complicated logic and find a simple workaround for the 128 character limit instead.
Metadata
Metadata
Assignees
Labels
BugAn error, flaw, misbehavior or failure in the Monkey or Monkey Island.An error, flaw, misbehavior or failure in the Monkey or Monkey Island.Complexity: HighImpact: High