Here is what I’m trying to do. I need to combine a list of NTFS permissions with a list of Share permissions, into one analysis:
I have easily separated the queries so they work separately:
NTFS Permissions (Analysis 1):
(if (name of operating system as lowercase contains “win”) then (("[NTFS]: " & name of it, path of it,(account name of trustee of it & “: " & (”//") & (
if (generic all permission of it) then “Full Control//” else (
if (generic write permission of it) then “Modify//” else (
if (generic read permission of it AND generic execute permission of it) then “Read & Execute//” else (
(if (read permission of it) then “Read/” else “”)
& (if (write permission of it) then “Write/” else “”)
& (if (execute permission of it) then “Execute/” else “”)
& (if (delete permission of it) then “Delete/” else “”)
& (if (list permission of it) then “List/” else “”)
& (if (append permission of it) then “Append/” else “”)
& (if (write dac permission of it) then “Modify DACL/” else “”) & ("/")
)
)
)
)) of entries of dacls of security descriptors of folders (paths of it)) of network shares whose (name of it does not contain “$”)) else nothings)
A1:
test, C:\test, [NTFS]: Authenticated Users: //Modify//
test, C:\test, [NTFS]: SYSTEM: //Full Control//
test, C:\test, [NTFS]: Administrators: //Full Control//
test, C:\test, [NTFS]: Users: //Read & Execute//
HP, C:\HP, [NTFS]: Authenticated Users: //Modify//
HP, C:\HP, [NTFS]: SYSTEM: //Full Control//
HP, C:\HP, [NTFS]: Administrators: //Full Control//
HP, C:\HP, [NTFS]: Users: //Read & Execute//
Share Permissions (Analysis 2):
(if (name of operating system as lowercase contains “win”) then (("[SHARE]: " & name of it, (account name of trustee of it & “: " & (”//") & (
if (generic all permission of it) then “Full Control//” else (
if (generic write permission of it) then “Change//” else (
if (generic read permission of it) then “Read//” else (
(if (read permission of it) then “Read/” else “”)
& (if (write permission of it) then “Write/” else “”)
& (if (execute permission of it) then “Execute/” else “”)
& (if (delete permission of it) then “Delete/” else “”)
& (if (list permission of it) then “List/” else “”)
& (if (append permission of it) then “Append/” else “”)
& (if (write dac permission of it) then “Modify DACL/” else “”) & ("/")
)
)
)
)) of entries of dacls of security descriptors of it) of network shares whose (name of it does not contain “$”)) else nothings)
A2:
test, [SHARE]: Everyone: //Read//
HP, [SHARE]: Everyone: //Change//
I need to combine these two so a single analysis result looks like:
test, C:\test, [NTFS]: Authenticated Users: //Modify// - [SHARE]: Everyone: //Read//
test, C:\test, [NTFS]: SYSTEM: //Full Control// - [SHARE]: Everyone: //Read//
test, C:\test, [NTFS]: Administrators: //Full Control// - [SHARE]: Everyone: //Read//
test, C:\test, [NTFS]: Users: //Read & Execute// - [SHARE]: Everyone: //Read//
HP, C:\HP, [NTFS]: Authenticated Users: //Modify// - [SHARE]: Everyone: //Change//
HP, C:\HP, [NTFS]: SYSTEM: //Full Control// - [SHARE]: Everyone: //Change//
HP, C:\HP, [NTFS]: Administrators: //Full Control// - [SHARE]: Everyone: //Change//
HP, C:\HP, [NTFS]: Users: //Read & Execute// - [SHARE]: Everyone: //Change//