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] When there are many tasks, smb grunt cannot connect normally #346

Open
mimidogz opened this issue Jan 4, 2022 · 0 comments
Open
Assignees

Comments

@mimidogz
Copy link

mimidogz commented Jan 4, 2022

Feature Request or Bug
Bug

Describe the feature request or bug
Because of the lack of efficient data query, Memory limitation caused smb grunt cannot be connected normally.

Code location:

List<APIModels.GruntTasking> taskings = _client.GetAllGruntTaskings().ToList();

The following exception may be thrown:
Cannot write more bytes to the buffer than the configured maximum buffer size: 2147483647.
It should be noted that this exception is only when I try {} catch {} the line of code, otherwise it will be caught by the upper layer and eventually become 404 not found.

To Reproduce
Steps to reproduce the behavior:

  1. Generate too much tasks...
  2. Using HTTP grunt to connect SMB grunt

Expected behavior
Only fetch egress grunt tasks

Covenant Server Information:

  • OS: Ubuntu20.04
  • Docker or Native: Native

Additional context
This problem may cause smb grunt to fail to connect, so #224 may also be caused by this problem; in addition to this, it is also recommended that other places take more efficient methods, namely Get only the data you need into the memory.

After modifying the code to these, smb grunt successfully connected:

if (egressGrunt.Id.HasValue)
    taskings = _client.GetGruntTaskings(egressGrunt.Id.Value).ToList();
else
    taskings = _client.GetAllGruntTaskings().ToList();

I am not good at csharp and familiar with this project, so the code is for reference only : ).

@mimidogz mimidogz changed the title [Bug] Short Description of Issue [Bug] When there are many tasks, smb grunt cannot connect normally Jan 4, 2022
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