# GenericWrite sobre computador

{% hint style="info" %}
Para llevar tu aprendizaje al siguiente nivel y practicar estas técnicas de manera segura y efectiva, te invitamos a adquirir acceso premium a nuestro material de curso. No pierdas esta oportunidad de profundizar tus conocimientos. Para más información y adquirir tu acceso, visita nuestro canal de ventas: <https://wa.link/ej3kiu>. ¡Te esperamos para empezar este viaje juntos!
{% endhint %}

<figure><img src="/files/Ci8gUzmSBfjNKm8S7PET" alt=""><figcaption></figcaption></figure>

Vamos a iniciar, realizando una conversion de texto a SID:

```powershell
PS C:\Users\admin\Desktop> $user = Get-ADUser -Identity "compwrite.user"
PS C:\Users\admin\Desktop> $user.SID

BinaryLength AccountDomainSid                         Value
------------ ----------------                         -----
          28 S-1-5-21-1861162130-2580302541-221646211 S-1-5-21-1861162130-2580302541-221646211-1120
```

Luego de lo anterior, hemos determinado que el SID del usuario `compwrite.user` es `S-1-5-21-1861162130-2580302541-221646211-1120`

Teniendo en cuenta lo anterior, vamos analizar las ACL del computador afectado:

{% code overflow="wrap" %}

```powershell
Get-ObjectAcl -SamAccountName First-DC -ResolveGUIDs | Where-Object {$_.ActiveDirectoryRights -eq "GenericWrite" -and $_.SecurityIdentifier -eq "S-1-5-21-1861162130-2580302541-221646211-1120"}
AceType               : AccessAllowed
ObjectDN              : CN=FIRST-DC,OU=Domain Controllers,DC=spartancybersec,DC=corp
ActiveDirectoryRights : GenericWrite
OpaqueLength          : 0
ObjectSID             : S-1-5-21-1861162130-2580302541-221646211-1009
InheritanceFlags      : ContainerInherit
BinaryLength          : 36
IsInherited           : False
IsCallback            : False
PropagationFlags      : None
SecurityIdentifier    : S-1-5-21-1861162130-2580302541-221646211-1120
AccessMask            : 131112
AuditFlags            : None
AceFlags              : ContainerInherit
AceQualifier          : AccessAllowed
```

{% endcode %}

La conclusión de la información proporcionada es que en el entorno de Active Directory de `spartancybersec.corp`, el usuario `compwrite.user` (identificado por el SID `S-1-5-21-1861162130-2580302541-221646211-1120`) tiene derechos de `GenericWrite` sobre el controlador de dominio `FIRST-DC`. Esto significa que `compwrite.user` tiene permisos para modificar ciertos atributos o propiedades de este objeto de controlador de dominio. Aunque `GenericWrite` no otorga un control tan amplio como `GenericAll`, sigue siendo significativo, ya que permite realizar cambios que podrían afectar la configuración y la seguridad del controlador de dominio.

Para este escenario, seria necesario continuarlo con el [ataque RBCD.](/cpad/vulnerabilidades-y-ataques-en-ad/rbcd-resource-based-constrained.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://books.spartan-cybersec.com/cpad/vulnerabilidades-y-ataques-en-ad/abuso-de-acl/genericwrite-sobre-computador.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
