Closed kvk484 closed 3 years ago
I don't think you can get this. I think the SMB system is shielded from this. The only way to know would be to browse the Administrative Shares (C$
).
You can get this using MS-SRVS RPC calls (https://github.com/rapid7/smbj-rpc/blob/master/src/main/java/com/rapid7/client/dcerpc/mssrvs/ServerService.java), provided the SMB server in question supports this. Info level 2 (https://github.com/rapid7/smbj-rpc/blob/master/src/main/java/com/rapid7/client/dcerpc/mssrvs/dto/NetShareInfo2.java) for instance provides the path you're looking for.
Note that this will almost always be a Windows style path even if you're talking to a UNIX based SMB server. Most systems I've seen so far take the Unix path, change all /
s to \
and stick C:\
in front of the path.
@kvk484 I think @pepijnve's answer should solve your question. As such I'm closing this issue. If you have any additional questions, feel free to reopen.
Hi Can you plz let me know how can I get the physical location of a share , like (C:\abc\xyz...) given a sharename or sharerelative path. I searched all the info in FIleALLinformation to noavail.