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

Permission Checking and rules for it #101

Open
cmprmsd opened this issue Sep 30, 2022 · 7 comments
Open

Permission Checking and rules for it #101

cmprmsd opened this issue Sep 30, 2022 · 7 comments

Comments

@cmprmsd
Copy link
Contributor

cmprmsd commented Sep 30, 2022

Hey l0ss!

I think we forgot to open a new issue for the permission checks discussed in #84
I just noticed that the permissions are still hardcoded and thought, it may be worth a shot to get this done.

You mentioned a better way that you worked on in group3r. I'll have a look at it if I find some spare time.

For the future it would make sense to have rules to identify e.g. folders like Microsoft's autostart folder write access in order to place some evil stuff in it during engagements.
We could brainstorm also on some other folders that might be critical like wwwroot or /var/www.

Have a great weekend!

@l0ss
Copy link
Contributor

l0ss commented Oct 7, 2022

Yeah Group3r has the better method in it - it's still imperfect but it's as good as it's going to get without a bunch of noisy NetLocalGroupEnum stuff.

Off the top of my head, writable things that should be considered interesting:
Webroots like those you mentioned above
Any executable file type or xml or inf file in the SYSVOL Policies dir
All kinds of stuff in the user's homedir - it would be good to write these rules so they can properly identify cases where they're remapping the user's desktop etc to a share as this seems to be pretty common.

@l0ss
Copy link
Contributor

l0ss commented Oct 23, 2022

ok so the aclcrimes branch should have the ability to semi-accurately get the R/W/M status of a file if you wanna take that for a spin. If that's all working properly it shouldn't be too hard to make it possible to write rules for it too.

@l0ss
Copy link
Contributor

l0ss commented Jan 3, 2023

@cmprmsd reminder to please test the aclcrimes branch out.

@cmprmsd
Copy link
Contributor Author

cmprmsd commented Jan 3, 2023

Nooooooo! I l0ss't track of this issue!

package main

import (
"fmt"
"math/rand"
"time"
)

func main() {
rand.Seed(time.Now().Unix())

excuses := []string{"I have a lot of work to do for my job.", "I have a lot of errands to run.", "I have a lot of family responsibilities.", "I'm in the middle of a big project for school.", "I'm training for a marathon.", "I have a lot of social commitments.", "I have a lot of appointments to attend.", "I'm trying to catch up on sleep."}

fmt.Println(excuses[rand.Intn(len(excuses))])
}

I'll check it out asap! Thanks for implementing this functionality! I'll also share some additional rules 🍀

@cmprmsd
Copy link
Contributor Author

cmprmsd commented Jan 3, 2023

Did a quick run in a DetectionLab. On local drives it seems to randomly display R W (M) or just R.
I could not find a clear pattern.
image

On network drives e.g. the DC only R was shown.
I might have issues with using a local user vagrant right from the initial lab setup that has local admin rights everywhere.
Will retry with a domain user tomorrow.

@cmprmsd
Copy link
Contributor Author

cmprmsd commented Jan 3, 2023

Just did this right away ^^
Observations with a domain user (administrative):

  • The shares all show up with R only although e.g. for \dc\C$ there is write access
    image
    image
  • The flags for W and M seem to show up only on files where explicitly permissions are set for the user (vagrant) as you can see here where program files shows up as read-only but the vagrant user folder shows up as writable:
    image

@cmprmsd
Copy link
Contributor Author

cmprmsd commented Oct 2, 2024

@l0ss Anything I can do to help you out on this one? I just stumbled over this issue. 😄

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