Giter Site home page Giter Site logo

Comments (3)

itm4n avatar itm4n commented on July 22, 2024

Hi!

Your analysis is correct, you did not do anything wrong. I think I might have introduced a regression in the code at some point. 😬

No worries, you don't need to write code or submit a PR to contribute. Opening an issue with this level of detail is largely enough to help. 🙂

Thanks for reporting this bug. I'll have a look at this. 👍

from privesccheck.

itm4n avatar itm4n commented on July 22, 2024

Thanks to the information you reported, I was able to reproduce the issue on my lab machine.

There were two problems:

  1. I was checking whether the permission WriteData/AddFile was granted. That was valid before I implemented a helper function that makes the difference between files and folders. This helper just returns WriteData if it's a file, and AddFile if it's a folder. I forgot to update the code to reflect this change, hence the first regression.
  2. At some point, I modified the helper function Get-ModifiablePath so that it returns the permission as a string (joined array) rather than an array. Since I had a test like $PermissionSet -contains $Permission, this did no longer work. This was the second regression.

Now, it should report exploitable unquoted paths correctly.

+------+------------------------------------------------+------+
| TEST | SERVICES > Unquoted Path                       | VULN |
+------+------------------------------------------------+------+
| DESC | List registered services and check whether any of     |
|      | them is configured with an unquoted path that can be  |
|      | exploited.                                            |
+------+-------------------------------------------------------+
[*] Found 1 result(s).


Name              : unquotedsvc
ImagePath         : c:\Program Files\Unquoted Path Service\Common Files\unquotedpathservice.exe
User              : LocalSystem
ModifiablePath    : C:\Program Files\Unquoted Path Service
IdentityReference : BUILTIN\Users
Permissions       : Delete, WriteAttributes, Synchronize, ReadControl, ListDirectory, AddSubdirectory,
                    WriteExtendedAttributes, ReadAttributes, AddFile, ReadExtendedAttributes, Traverse
Status            : Stopped
UserCanStart      : False
UserCanStop       : False

The moral of the story is "I should have implemented unit tests"... :/

Anyways, thank you very much for reporting this. This is much appreciated. 🙏

from privesccheck.

Malayke avatar Malayke commented on July 22, 2024

🙏 Thank you for providing a detailed description of the issue and quickly resolving it. I will now close this issue. 🌟

from privesccheck.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.