PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, November 2, 2022

[FIXED] What does "269681087" represent in FileSystemRights?

 November 02, 2022     file     No comments   

Issue

Like "65536" represent "Delete" in FileSystemRights. Then what does "269681087" represent in FileSystemRights?

Thank you!

Aleady read: https://learn.microsoft.com/zh-tw/dotnet/api/system.security.accesscontrol.filesystemrights?view=net-6.0


Solution

The value should be a combination of flags from that FileSystemRights enum.

For instance FileSystemRights.ReadData | FileSystemRights.WriteData allows both reading and writing of data. That | is the bitwise OR operator.

Code to test for specific values:

var val = (System.Security.AccessControl.FileSystemRights)269681087;

foreach(FileSystemRights fsr in Enum.GetValues(typeof(FileSystemRights)))
{
    if ((val & fsr) == fsr)
    {
        Console.WriteLine($"{fsr} (0x{(int)fsr:X} = {(int)fsr})");
    }
}

This gives a list of values, with some apparent duplicates. The reason is that for instance AppendData and CreateDirectories share the same underlying value (4) so the ToString (implicit in that {fsr}) cannot distinguish between them and chooses the first matching text value.

ReadData (0x1 = 1)
ReadData (0x1 = 1) = ListDirectory
CreateFiles (0x2 = 2)
CreateFiles (0x2 = 2) = WriteData
AppendData (0x4 = 4)
AppendData (0x4 = 4) = CreateDirectories
ReadExtendedAttributes (0x8 = 8)
WriteExtendedAttributes (0x10 = 16)
ExecuteFile (0x20 = 32)
ExecuteFile (0x20 = 32) = Traverse
ReadAttributes (0x80 = 128)
WriteAttributes (0x100 = 256)
Write (0x116 = 278)
Delete (0x10000 = 65536)
ReadPermissions (0x20000 = 131072)
Read (0x20089 = 131209)
ReadAndExecute (0x200A9 = 131241)
Modify (0x301BF = 197055)
Synchronize (0x100000 = 1048576)

But even then, when I combine all matching values I don't get your original value back: a value 0x1000_0000 is unaccounted for.



Answered By - Hans Kesting
Answer Checked By - Dawn Plyler (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing