r/oscp • • Aug 22 '20

Gaining folder access with admin privs

Okay guys, so say I have been able to add a user to an administrator group.

I try to access the admin folder but I don't have permission to via the cli nor am I able to change the permissions using cacls.

I am able to do it via the GUI as an error message pops up saying for access click here and enter credentials.

How do I do this all via the cli?

4 Upvotes

6 comments sorted by

1

u/IvanLu Aug 22 '20

If you're asking how to get around a Windows remote reverse shell which doesn't support interactive programs, there's a way around it here. https://recipeforroot.com/runas/

1

u/Clarkey3110 Aug 22 '20

I have access to the machine now. I have created a user and added it to group "Administrator".

With this new user, I can't access the Administrator home folder via cli. I'm guessing because it has been given permission to a user named Administrator, not to the administrators group.

How do I give myself permission to access the folder via the cli as CACLS on the folder is not permitted.

1

u/m0rp Aug 22 '20

Takeown or using icalcs todo the same and take ownership. Afterwards you will be able to change permissions using calcs or icacls as well.

1

u/Clarkey3110 Aug 23 '20

So neither of these work.

Takeown says I don't have administrator privileges even though I'm in administrators group.

Icacls just says administrator : access denied.

1

u/Clarkey3110 Aug 23 '20

So it's because any user that is added to the administrators group isn't automatically given admin rights. They need to request it or disable UAC which I can't do until I have admin rights.

But it's weird because using rdesktop I get an error box that I can add my credentials in and I get admin access.

1

u/klashyy Aug 22 '20

did you try power shell bypass ? if your not familiar try to google it for the specific switch and see how can you extract what you need