File and directory integrity levels
C:\Users\User>icacls hallo
hallo NT AUTHORITY\SYSTEM:(I)(F)
BUILTIN\Administrators:(I)(F)
WINDEV2012EVAL\User:(I)(F)
Mandatory Label\High Mandatory Level:(NW)
(I)(F) means that the corresponding user or group has (F) Full permission on the file and that the permissions are inherited from the parent = directory.
Note that the Read right ® also enables execution on that file! (There is also the Executeable flag (X).)
Mandatory labels describe that the file or directory can only be accessed (independently of the flags) if the process = user has at least the same level. The levels can be seen with whoami /priv. There are the following levels: untrusted, low, medium, high, system, installer.
Alternative method: Use accesschk.exe from SysInternalTools:
accesschk.exe /accepteula $dir
Set permissions
Set permissions to a directory or file:
icacls $dir /grant $user:(OI)(CI)(F)
Set read permissions to a directory for another user / all users:
icacls $dir /grant $user:(OI)(RX) icacls $dir /grant everyone:(OI)(RX)
Explanation of the flags is in the standard output from icacls:
perm is a permission mask and can be specified in one of two forms:
a sequence of simple rights:
N - no access
F - full access
M - modify access
RX - read and execute access
R - read-only access
W - write-only access
D - delete access
a comma-separated list in parentheses of specific rights:
DE - delete
RC - read control
WDAC - write DAC
WO - write owner
S - synchronize
AS - access system security
MA - maximum allowed
GR - generic read
GW - generic write
GE - generic execute
GA - generic all
RD - read data/list directory
WD - write data/add file
AD - append data/add subdirectory
REA - read extended attributes
WEA - write extended attributes
X - execute/traverse
DC - delete child
RA - read attributes
WA - write attributes
inheritance rights may precede either form and are applied
only to directories:
(OI) - object inherit
(CI) - container inherit
(IO) - inherit only
(NP) - don't propagate inherit
(I) - permission inherited from parent container
ADS Alternate Data Streams
- In NTFS, a stream is a property of a file.
- A file can have multiple streams, which can be referenced by a identifier.
- A stream is accessed via :$streamName appended to a file.
- Exampe: For the file
a.txt, there coud be the streamsa.txt:alphaora.txt:hidden. - It can be accessed as with
more < a.txt:hidden.
- Exampe: For the file
Journaling
NTFS stores its journal in the special NTFS file $LogFile.
The additional journal USN Update Sequence Number is store in the special file $Extend\$UrnJrnl. With each write access, the number is increased. Useful for backup tools. Also, old file names can be found there. Useful for incident analysis.
Extract the journals from an image
TODO
Leave a Reply
You must be logged in to post a comment.