Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[enhancement] Display comment field in output #4

Closed
CaledoniaProject opened this issue Oct 7, 2021 · 1 comment
Closed

[enhancement] Display comment field in output #4

CaledoniaProject opened this issue Oct 7, 2021 · 1 comment
Assignees
Milestone

Comments

@CaledoniaProject
Copy link

CaledoniaProject commented Oct 7, 2021

Please add the comment field to your output. Currently only the folder name and server name is displayed.

screenshot 2021-10-07 at 5 39 37 PM

@p0dalirius p0dalirius self-assigned this Oct 7, 2021
@p0dalirius p0dalirius added this to the 1.4 milestone Oct 7, 2021
@p0dalirius p0dalirius added the enhancement New feature or request label Oct 7, 2021
p0dalirius added a commit that referenced this issue Oct 7, 2021
@p0dalirius
Copy link
Owner

p0dalirius commented Oct 7, 2021

The share comments are included in the structure _SHARE_INFO_1 returned by smbClient.listShares() :

typedef struct _SHARE_INFO_1 {
  LMSTR shi1_netname;
  DWORD shi1_type;
  LMSTR shi1_remark;
} SHARE_INFO_1, *PSHARE_INFO_1, *LPSHARE_INFO_1;

It's now added into FindUncommonShares.py:

# SHARE_INFO_1 structure (lmshare.h)
# https://docs.microsoft.com/en-us/windows/win32/api/lmshare/ns-lmshare-share_info_1
sharename = share['shi1_netname'][:-1]
sharecomment = share['shi1_remark'][:-1]
sharetype = share['shi1_type']

image

I also added the share flags in the exported JSON data.

{
  "sharename": "AnotherShare",
  "uncpath": "\\\\192.168.2.11\\AnotherShare\\",
  "computer": "PC01.LAB.local",
  "comment": "",
  "type": {
    "stype_value": 0,
    "stype_flags": [
      "STYPE_DISKTREE",
      "STYPE_SPECIAL",
      "STYPE_TEMPORARY"
    ]
  }
}

References

@p0dalirius p0dalirius changed the title Display comment field in output [enhancement] Display comment field in output Sep 16, 2022
@p0dalirius p0dalirius removed the enhancement New feature or request label Apr 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants