bats3c / shad0w

A post exploitation framework designed to operate covertly on heavily monitored environments
https://blog.dylan.codes/shad0w/
MIT License
2.03k stars 323 forks source link

shad0w doesn't exit from exit command #39

Closed Luct0r closed 4 years ago

Luct0r commented 4 years ago

Issuing the "exit" command doesn't seem to do anything. Currently, Ctrl + C seems to partly get there but errors with threading.py regarding lock.acquire() - after waiting a couple minutes to see if the shutdown process was similar to starting shad0w in terms of length, a second Ctrl + C fully exits.

Tried "exit" twice then a Ctrl + C, and once more to shutdown... exitError

bblenard commented 4 years ago

I took a look at this and as far as I can tell after shad0w starts up there are 2 threads running: the console thread and the http server thread. While testing I simply changed the http server thread to a daemon thread which according to the threading library documentation will cause the program to exit once there are only daemon threads executing. This change solves the problem allowing the console thread to exit and then the entire program to exit once the last thread (http server) that is left is a daemon thread. I will open up a PR for this however I am wondering if there was a reason to explicitly set the http server as a non daemon thread?

bblenard commented 4 years ago

@Luct0r The PR I just opened worked for me. Feel free to test it out and let me know if you still have an issue.