Open DanaEpp opened 2 years ago
This shouldn't be too difficult to implement. I should be able to simply remove the reference from Manager.modules
and sys.modules
, then reload the Python module. I'll try to get this added soon!
I implemented a first-pass on this in the referenced PR. @DanaEpp if you have the time/interest, I'd appreciate you giving that branch a try. You should be able to either use load --reload /path/to/modules
or run --reload my.module.name
. The former will obviously explicitly reload the module, while the latter will reload the module prior to execution (as mentioned in your original issue above).
Thanks for the suggestion. This is a really good feature to have for debugging, and I don't know why it didn't occur to me before! :+1:
I implemented a first-pass on this in the referenced PR. @DanaEpp if you have the time/interest, I'd appreciate you giving that branch a try. You should be able to either use
load --reload /path/to/modules
orrun --reload my.module.name
. The former will obviously explicitly reload the module, while the latter will reload the module prior to execution (as mentioned in your original issue above).Thanks for the suggestion. This is a really good feature to have for debugging, and I don't know why it didn't occur to me before! 👍
Thanks for such a quick turnaround Caleb! This will be an awesome feature. I am right in the middle of writing a module as we speak, so this is timely.
I'll try to test this branch tonight.
When doing custom module development it is rather tedious to have to restart pwncat and establish a new session just to reload the changes to the module code. It would be nice to do
reload /path/to/modules
, or to otherwise auto-reload when a module file has been altered.Alternatively, having an option during dev to pass a switch to pwncat-cs to have it reload modules from disk on every "run", or offer a new command like
run-dev
that would always fetch the module code would be useful.