Fix for arbitrary file write via spider_plus module#1121
Fix for arbitrary file write via spider_plus module#1121Marshall-Hallenbeck merged 1 commit intomainfrom
Conversation
|
@NeffIsBack we should probably push a 1.5.1 release and get it on Kali ASAP too |
We don't need a new version, I'm just gonna tell them to apply the patches manually. |
This will probably be CVE'd and we'll need a proper way to differentiate it rather than just a commit hash. |
Why should we. This is not a web server where this matters, there is practically no realistic attack scenario. You could likely inject all kind of things into NetExec and with that the OS. This is a security tool doing all kinds of insecure stuff. |
I disagree, the PoC works to overwrite arbitrary files and all you have to do is run the module with download against it. This puts nxc users at risk of having their systems completely nuked. |
Yeah but so what. Someone would need to setup a specific kind of file structure and hope that some pentester (or who would you target with that?) run exactly that module against your smb server (who is btw in your internal network lol). Of course there is a risk and it is good that we patch that but the actual risk is diminishing. NetExec is not a service running all the time. |
|
At that point just hack the internal network on your own, much higher probability on being successful lol. |
The likelihood is definitely low, but the impact is high and still exists. |
|
As @NeffIsBack asked me privately for my opinion: I fully agree with the way that @Marshall-Hallenbeck wants to handle this. Disregarding any theorizing about attack models and risk awareness when running attack tools, this seems to be a valid security report that should be handled like one. Users will want to identify whether or not their version is affected and the easiest way to see this is by publishing a bug fix release. It is perfectly valid to write a release note that also talks about the inherent risk of running security tooling in your environment. However, imho you shouldn't neglect the validity of this report. |
|
Sure okay. Then @Marshall-Hallenbeck please:
|
|
Since we have decided to do a bug fix release for it we should probably communicate it to the public as well once the patch rolled out to kali. |
Description
The module spider_plus improperly creates the output file and folder path when saving files from SMB shares.
It does not take into account that it is possible for Linux SMB shares to have path traversal characters such as ../ in them. An attacker can craft a filename in an SMB share that includes these characters, which when spider_plus crawls and downloads, can write or overwrite arbitrary files.
This PR resolves #1120
(sidenote: ruff is throwing errors about the line-length: 65000, and I think we already ignore that rule...)
Type of change
Insert an "x" inside the brackets for relevant items (do not delete options)
Setup guide for the review
Requires an SMB share with at least one file to be shared in it.
The PoC for the arbitrary write was shared with me privately; I can provide that to other maintainers for them to test if needed, but the reporter of this vulnerability has nicely not shared the PoC publicly yet.
Screenshots (if appropriate):
Before fix:




After fix:
Checklist:
Insert an "x" inside the brackets for completed and relevant items (do not delete options)
poetry run ruff check ., use--fixto automatically fix what it can)tests/e2e_commands.txtfile if necessary (new modules or features are required to be added to the e2e tests)