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] Imporper thread and status handling in reverseshell_stager_server #644

Open
Mr3Jane opened this issue Jan 26, 2023 · 0 comments
Open
Labels
bug Something isn't working confirmed good first issue Good for newcomers

Comments

@Mr3Jane
Copy link

Mr3Jane commented Jan 26, 2023

Empire Version

  • Empire 4.9.0-kali-0kali1

OS Information (Linux flavor, Python version)

  • OS: Linux kali 6.0.0-kali6-amd64
  • Python: Python 3.10.9

Describe the bug

Plugin reverseshell_stager_server drops its thread handler with each execute call:

While fixing this, I noticed that it also doesn't check if another handler is running, kinda implying that it allows to have multiple handlers at a time, which is not the case: you lose control of your previous handler if you run a new one:

And overall, current code doesn't terminate as expected as there's no timeout on socket.accept() call and spawned handler thread will hang and KThread will not be able to terminate it as well.

To Reproduce

Steps to reproduce the behavior:

  1. Start reverseshell_stager_server
  2. Try to stop reverseshell_stager_server or get its status
  3. It won't work

Expected behavior

I expect this plugin to handle exactly 1 thread and allow to start it and stop it at will without losing control over the handler.

Screenshots

I think no screenshots is fine in this case

Additional context

Is it a known bug or plugins are handled somewhere outside of this repo? I've came with a simplistic solution, should I submit a PR with a proposed fix?

@Mr3Jane Mr3Jane added the bug Something isn't working label Jan 26, 2023
@vinnybod vinnybod added the good first issue Good for newcomers label Aug 27, 2023
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 good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants