Open Script-Nomad opened 4 months ago
I went and repeated the process of connecting to the share via smbclient.py and got the same result. Interestingly enough, if I explicitly attach to a valid share, I can connect to it and parse it just fine.
Something within the def SMBConnection.listShare()
method simply isn't finding and listing all of the shares available.
Seems like a legitimate bug, but it only appears to affect Amazon FSX shares. Don't know what's unique about them but this is a brain teaser. 😂
Configuration
impacket version: 0.11.0.dev Python version: 3.12.4 Target OS: Amazon FSX Share (not sure)
So this is a bit of a weird one. I'm working on simulating a ransomware attack on a clients' FSX share by accessing the FSX via impacket's SMBConnection class and adding my own functionality to it.
The SMBConnection class has a
self.listShares()
function that yields anmbSharesEnum
response containing share information.The problem is that when I try this on an Amazon FSX, it doesn't list all of the shares, and I'm not sure why. This seems to likely be due to an underlying bug in the dcev5 structs for Impacket, which may not account for an edge-case for identifying shares on an Amazon FSX.
I'm certain the permissions I'm using to authenticate to the shares is good, and I can see the shares listed in Windows Explorer when I access them via smb:\mytarget.example.com\, but I do not see them listed with the
SMBConnection.listShares()
method.Note: I tested this against a Linux Samba server and a windows SMB share, and both worked fine. No problems listing all my shares.
Any ideas?
Here is the relevant code that I used to overload SMBConnection and try this out. The plan is to submit this code to a PR request for Impacket to make it trivial to do SMB Share scanning on a network, if that gives you guys any incentive to check this out.
Thanks.