<?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 Rahul Nambiar on Medium]]></title>
        <description><![CDATA[Stories by Rahul Nambiar on Medium]]></description>
        <link>https://medium.com/@rmaximoss?source=rss-d0332efe4410------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*RzCrb5dGcXH_8IBLIZ-cfA.jpeg</url>
            <title>Stories by Rahul Nambiar on Medium</title>
            <link>https://medium.com/@rmaximoss?source=rss-d0332efe4410------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 03:20:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rmaximoss/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[Hacking Windows 10: Unleashing John the Ripper on Password Hashes from a VM: A step by step guide]]></title>
            <link>https://medium.com/@rmaximoss/hacking-windows-10-unleashing-john-the-ripper-on-password-hashes-from-a-vm-a-step-by-step-guide-090ab57adeb9?source=rss-d0332efe4410------2</link>
            <guid isPermaLink="false">https://medium.com/p/090ab57adeb9</guid>
            <category><![CDATA[cracking-hashes]]></category>
            <category><![CDATA[virtual-machine]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[john-the-ripper]]></category>
            <category><![CDATA[windows-10]]></category>
            <dc:creator><![CDATA[Rahul Nambiar]]></dc:creator>
            <pubDate>Tue, 08 Oct 2024 16:09:35 GMT</pubDate>
            <atom:updated>2024-10-08T16:09:35.423Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s8pzRcJ-5aSXl05vzAg2LA.png" /><figcaption>Source: <a href="https://4kwallpapers.com/technology/windows-10-gradient-background-minimal-aesthetic-5k-2218.html">https://4kwallpapers.com/technology/windows-10-gradient-background-minimal-aesthetic-5k-2218.html</a></figcaption></figure><p>Have you ever forgotten the login password for your Windows 10 virtual machine? Trust me, it happens to me all the time. With this guide, I’ll show you a way to recover your password.</p><p>Though before starting this tutorial, there are some pre-requisite you can follow:</p><ol><li>Virtual machine(VM) running <strong>Kali</strong>.</li><li>A windows 10 virtual machine<strong>(ISO)</strong> installed.</li><li>John the Ripper (This should be already pre-installed on kali)</li><li>A wordlist (Kali has a pre-installed <strong>compressed wordlist</strong>, later in this guide, I’ll show you how to decompress it.)</li></ol><h4>Note:</h4><p>I haven’t tested this on any other versions of windows or on a physical machine, if you have tried this or even used another method, feel free to share it. It would be much appreciated.</p><h4>Disclaimer:</h4><p>Everything shown here is for education only. Please do not imitate or use this for malicious purposes.</p><h3><strong>Introduction</strong></h3><p>Windows is one of the most popular and commonly used desktop in the world. Of cause this comes with the bane of black hats trying to extract passwords for malicious purposes. Although when it comes to security, Microsoft&#39;s been ahead of the game, there have been many vulnerabilities discovered that have put window’s users to risk.</p><p>One of the vulnerabilities discovered was the ability to extract password hashes from windows 10 and cracking the same using password cracking tools.</p><p>Windows stores password along with user account information in the <strong>SAM (Security Account Manager)</strong> database. The file path of this database is</p><pre>#You can follow this file path to view their location in windows<br>C:\windows\System32\config\</pre><p>Don’t jump into the pool yet, Windows protect this file by locking it down while the <strong>system’s running</strong>, thus preventing any access to it and on top of that, the SAM file is encrypted using the <strong>system boot key</strong>, which is found in the <strong>SYSTEM </strong>file.</p><p><em>The system boot key, </em><strong><em>BootKey</em></strong><em> or </em><strong><em>SysKey </em></strong><em>is an encryption key that’s used to encrypt sensitive information in windows. It’s stored in the windows SYSTEM registry hive.</em></p><p>And if somehow you were able to bypass all of these security measures and extract the SAM file, you will be surprised to discover the <strong>hashed version </strong>of the password and not the password itself.</p><p>Here’s a great page to get you up to speed on hashes:</p><p><a href="https://www.codecademy.com/resources/blog/what-is-hashing/">What Is Hashing, and How Does It Work? - Codecademy Blog</a></p><p><strong><em>Now that we have tackled the basis, let’s move on to the practical part.</em></strong></p><h3>Downloading windows 10 (ISO)</h3><p><a href="https://info.microsoft.com/ww-landing-windows-10-enterprise.html">Microsoft</a></p><p>You can install the ISO from the link presented above you. It is required that you fill up the details before you could download it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O6y9A96b-_NthfolDPMp8w.png" /><figcaption>Download the Enterprise edition version(not LTSC)</figcaption></figure><p>During the installation process of the windows VM, make sure to set a password. Otherwise, there’s also a option for you to change it after completing the set-up.</p><p><em>Just search for change your password in the search bar.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/779/1*-eBu6KToDPPtSyqq-AGW6g.png" /></figure><p>This marks the end of installation of the windows-10 VM. We’ll now move on to enabling shared folder on your kali Linux using virtual box.</p><h3>Shared Folders</h3><p>This is a useful feature in virtual box that allows you to create a folder between your VM and your host machine, enabling you to share files between them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/1*SYEtWQ9anMNYI7sJzHCJUg.png" /></figure><p>You can find this by clicking on kali VM’s settings and then, shared Folders. Where, you should click on the little folder(plus) icon to create a shared folder.</p><p>A pop-up appears like the one displayed in the image.</p><pre>Folder Path: D:\V Machines\Windows 10<br>Folder Name: Windows_folder<br>Mount Point: /mnt/windows_machine</pre><p>Let’s decode these folder paths to better understand them.</p><p><strong>Decoding</strong></p><p><strong>Folder Path: </strong>This defines the path in your host machine, the folder where your windows virtual disk image(.vdi) file is stored.</p><p><strong>The path varies depending on where you choose to save your VM during installation. If you’re new to virtual machine, save your VM in the default folder for easier accessibility</strong></p><p><strong>Mount Point:</strong> This is the path in your kali VM where you will be saving the windows folder containing the .vdi image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*jXyR8am2g8Hbi7lR91XSPQ.png" /><figcaption>This should be the result when you follow the procedure</figcaption></figure><pre>#The path of the Shared folder in kali Linux<br>/mnt/windows_machine</pre><p><strong>Let’s decode this file path a bit more:</strong></p><p><strong>/mnt </strong>is the directory found in the root(/) folder of kali. This is the <strong>mount </strong>directory which provides a generic point for you to mount a file-system or device, usually temporary ones or a VM.</p><p>Don’t confuse <strong>/mnt</strong> with <strong>/media directory, </strong>which gives a standardized area for mounting and getting to different sorts of detachable media, such as USB drives, optical discs and hard drives.</p><p><strong>windows_machine</strong> is the folder that we create to share files with the host. This folder contains the .vdi and other contents of the windows-10 VM.</p><p>That concludes the creation of shared folder where we were able to connect the windows folder in our host with the kali VM.</p><h4>Mounting the windows (.vdi) file</h4><p>Now we’ll come to the crucial part of this tutorial. Mounting allows you to manage and access a removeable or temporary drive on your system. In this case, we’ll be mounting the windows image to our kali Linux.</p><p>This portion consists of three commands.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/819/1*9NqXXjZcyLcFo96tiNpnCA.png" /><figcaption>Command_1</figcaption></figure><pre>#Enabling and loading nbd module<br>$sudo modprobe nbd</pre><p><strong>Decode</strong></p><p>I’ll go through each individual commands and explain their function.</p><p><strong>modprobe: </strong>This is a command-line utility used to add and remove modules from the Linux kernel.<br><br><strong>nbd (Network Block Device module)</strong> : NBD allows a block device (like a disk partition) to be accessed over a network. It enables a client to use a remote server’s storage as if it were a local disk.</p><p><strong>Functionality</strong></p><ul><li>The system checks if the <strong>nbd module</strong> is available in the kernel modules directory (usually located in ).</li></ul><pre>#nbd module location<br>/lib/modules/$(uname -r)/</pre><ul><li>Once loaded, the NBD module allows you to create NBD devices (that can be configured to connect to remote block devices. The NBD devices can include<strong> /dev/nbd0, /dev/nbd1 etc.</strong></li></ul><p>Before we can use the second command, we’ll have to install some utilities associated with it.</p><pre>#To install the qemu utilities<br>$sudo apt install qemu-utils</pre><p>After the installation is complete, we can implement the second command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/818/1*WDlKYQoONxY7ZTgpmBhXAA.png" /><figcaption>Command_2</figcaption></figure><pre>#Connecting the nbd device with the windows .vdi<br>$sudo qemu-nbd -c /dev/nbd0 /mnt/windows_machine/Windows\ 10.vdi</pre><p><strong>Decoding of the command</strong></p><ul><li><strong>qemu -nbd: </strong>This is a utility from the QEMU project that allows you to connect a disk image file to a Network Block Device. It enables the image to be accessed as if it were a physical disk.</li><li><strong>-c /dev/nbd0:</strong> The <strong>-c </strong>option specifies the NBD device to which the disk image will be connected. In this case, it connects the image to <strong>/dev/nbd0</strong>, which is the first NBD device created.</li><li><strong>/mnt/windows_machine/Windows\ 10.vdi: </strong>This is the path to the virtual disk image file (.vdi) you want to connect. The backslash<strong> (\) </strong>before the space in <strong>Windows 10.vdi</strong> is used to escape the space, ensuring the command interprets the entire filename correctly.</li></ul><p><strong>Functionality of the command</strong></p><ul><li>When you execute this command, it connects the specified .vdi file to the NBD device <strong>/dev/nbd0. </strong>This allows you to access the contents of the .vdi file as if it were a actual physical disk on your kali Linux.</li><li>You can now mount <strong>/dev/nbd0</strong> to access the files within the Windows 10 virtual disk image.</li></ul><p>You can use the command <strong>lsblk </strong>to find the newly created partition under nbd0/ .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/1*hFCukRVZEcmojI39zmAMOQ.png" /><figcaption>For this tutorial, the target partition is nbd0p1</figcaption></figure><p><em>For some of you, there will be three partitions instead</em><strong><em> (nd0p1, ndop2, nbd0p3). </em></strong><em>In that case, you should keep an eye on the partition with the </em><strong><em>largest size</em></strong><em>. You’ll be instead using that for the the command.</em></p><p>Change the directory to <strong>/mnt</strong> and create a new directory. You can make a new directory by using the command, <strong>mkdir</strong>. The directory I have made is called <strong>windows_drive.</strong></p><p>This will be the place where you’ll be mounting the partition. Now you can go forward with the final command.</p><pre>#Mounting the .vdi to the desired directory<br>$sudo mount /dev/nbd0p1 windows_drive</pre><p><strong>Decoding of the command</strong></p><ul><li><strong>mount:</strong> This command is used to attach filesystems to the directory tree at a specified mount point, making the contents of the filesystem accessible.</li><li>In this case, we’ll be able to access the files inside the windows .vdi from the <strong>windows_drive</strong> directory.</li></ul><p>Now to check whether your mounting was successful, <strong>ls </strong>(list) the directory where you mounted the .vdi file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*wTyopHlUr-dbJAiPEI9bEQ.png" /><figcaption>Mounting has been successful</figcaption></figure><p>Congratulations, you have successfully mounted the windows .vdi image to your kali Linux. Give yourself a pat on your back.</p><p>We’ll now move on to extracting the password hashes from windows10 VM.</p><h4>Extracting Password Hashes</h4><p>We have learned that windows store their password hashes in the SAM file, which is encrypted and the decryption key is stored in the SYSTEM’s file.</p><p>So in your kali Linux, we’ll go to the directory where the SAM’s and SYSTEM’s files are located.</p><pre>#The file path in kali Linux<br>$/Windows/System32/config</pre><p><strong>(ls) list </strong>the directory to view all the files. Scroll a bit further down till you find both SAM and SYSTEM files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/812/1*uQxXpw8lHZapDHYmSxQZYQ.png" /><figcaption>The files in config directory</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/818/1*_jbiSmqrHiR_DpY5I65hcQ.png" /><figcaption>The files that we are targeting (SAM and SYSTEM)</figcaption></figure><p>Let’s look at the command that you can use to achieve both decryption and extracting the password hashes from the SAM’s file.</p><pre>$sudo impacket-secretsdump -sam SAM -system SYSTEM LOCAL</pre><p><strong>Components of the command</strong></p><ul><li><strong>impacket-secretsdump:</strong> This is a tool from the Impacket project, which is specifically designed to extract password hashes and other sensitive information from Windows system and dump them.</li><li><strong>-sam SAM: </strong>This option specifies the <strong>Security Accounts Manager (SAM)</strong> database file, which contains user account information, including password hashes.</li><li><strong>-system SYSTEM: </strong>This option specifies the SYSTEM registry hive file, which contains system-wide configuration settings, including the boot key used to decrypt the SAM database.</li><li><strong>LOCAL: </strong>This option indicates that the command should operate on the local system, rather than attempting to connect to a remote system.</li></ul><p><strong>Functionality of the command</strong></p><ul><li>When you execute this command, it extracts password hashes from the local Windows system’s SAM database and SYSTEM registry hive.</li><li>The command uses the SYSTEM registry hive to obtain the boot key, which is then used to decrypt the SAM database and extract the password hashes.</li></ul><p><strong>Output</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*v3B-ZYJTQvIufl-jJpK2fg.png" /><figcaption>The extracted password hashes</figcaption></figure><p>Awesome! The password hashes have been extracted. Don’t celebrate yet, just few more steps and you will officially be declared as a script kiddie.</p><p>Copy the entire hash content that you extracted. To be more specific, From <strong>[*] Target system bootkey: </strong>till the<strong> double colon [::] </strong>just<strong> </strong>before the cleaning up text.</p><p><em>Make sure not to miss anything as it can greatly affect the output.</em></p><p>You’ll be storing these copied hashes in a temporary file located in the <strong>/tmp</strong> directory.</p><pre>#The path to the temporary directory<br>$cd /tmp</pre><p><em>Whatever files or directory are created inside the /</em><strong><em>tmp</em></strong><em> directory remains till the system is on. Once it reboots, the </em><strong><em>/tmp </em></strong><em>directory empties everything.</em></p><p>You can create a file using the <strong>nano</strong> tool. <em>It’s pre-installed in kali, so you can directly paste the command given below.</em></p><pre>$nano hash_file</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*TYM3c8Dv2e8px-k_yry-Jw.png" /></figure><p><strong><em>Ctrl+o</em></strong><em> to save the changes and</em><strong><em> Ctrl+x</em></strong><em> to exit nano.</em></p><p>Before we can use John the ripper to crack the password, we require a wordlist.<strong> Wordlist</strong> is an important component when it comes to password cracking.</p><p><em>A wordlist consists of a list of commonly used passwords/usernames around the globe or passwords that are collected from multiple data breaches.</em></p><p>One of the most used comprehensive wordlist used is <strong>rockyou.txt, which consists of over 14 million passwords. </strong>Luckily, it’s already available in kali and you just have to decompress the file.</p><p>To do that</p><pre>$sudo /usr/share/wordlists</pre><p>Inside the wordlists directory, you can find the <strong>rockyou.txt </strong>wordlist. To decompress it, just follow this command.</p><pre>#When you&#39;re inside the wordlist directory<br>$gunzip rockyou.txt</pre><p><em>If you’re not inside the wordlists directory, you can decompress by including the file path of </em><strong><em>rockyou.txt</em></strong><em> in the command.</em></p><pre>$gunzip /usr/share/wordlists/rockyou.txt</pre><p>After decompressing the wordlist, we can now move on to the final stage of this guide.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/225/1*Dm3FPcYUsL9pUV6BTAmGAQ.png" /></figure><h4>John the Ripper</h4><p>John the Ripper (JTR) is a free and open-source password cracking software tool. It is designed to automatically detect password hash types and supports a wide range of password hash formats, including several crypt password hash types most commonly found on various Unix distros, as well as Windows LM hashes.</p><p>Essentially, it helps recover lost passwords by trying different combinations until it finds the right one.</p><p>That’s why we require a wordlist, which<strong> John </strong>will iterate through the provided wordlist, until it finds the one which matches the target file’s hash.</p><h4><strong>Note:</strong></h4><p>Before you start using John the Ripper, make sure to shut down the windows-10 VM. Otherwise, John won’t be able to crack the password hash properly.</p><p>This happens cause windows prevent any access to the SAM’s file when it’s on.</p><p>Now let’s perform the final command.</p><pre>$john --format=NT -wordlist=/usr/share/wordlists/rockyou.txt hash_file</pre><p><strong>Decoding the command</strong></p><p>This command is using John the Ripper (JTR) to crack a password hash file (hash_file) using a <strong>dictionary attack. </strong>You can refer to this website for more information on dictionary attack.</p><p><a href="https://www.beyondidentity.com/glossary/dictionary-attack">Dictionary Attack</a></p><ul><li>— <strong>format=NT:</strong> This option specifies the format of the password hash. In this case, <strong>NT</strong> refers to the <strong>NTLM (New Technology LAN Manager)</strong> hash format, which is commonly used in Windows systems.</li><li><strong>-wordlist=/usr/share/wordlists/rockyou.txt: </strong>This option specifies the wordlist (with the file path) to use for the dictionary attack. The wordlist file contains a list of potential passwords that <strong>John</strong> will try against the hash. The above mentioned wordlist file path is a common location for wordlists on Linux systems.</li><li><strong>rockyou.txt: The </strong>Wordlist that we decompressed on our system.</li><li><strong>hash_file:</strong> This is the file that contains the password hash that we stored for cracking.</li></ul><p><strong>Functionality of the command</strong></p><p>Let me explain what the command does, step by step.</p><ol><li>John reads the password hash from the <strong>hash_file</strong>.</li><li>Then the tool checks the format of the hash and confirms that it’s an NTLM hash.</li><li>John reads the specified wordlist<strong>(rockyou.txt) </strong>and starts trying each password in the list against the hash.</li><li>For each password, <strong>John</strong> hashes the password using the <strong>NTLM algorithm </strong>and compares the resulting hash to the original hash in the <strong>hash_file</strong>.</li><li>If the hashes match, <strong>John</strong> has found the correct password and will output it to the terminal</li><li>If the wordlist is exhausted without finding a match, <strong>john </strong>will report that the password was not found in the wordlist.</li></ol><p><strong>Output</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/657/1*uTiMs9xc68-AYvoNVx5U6A.png" /><figcaption>The password is max</figcaption></figure><p>As you can see, John the Ripper successfully cracked the password hashes of the targeted windows10 VM and displayed the user’s login credential on the terminal.</p><p>Well, there you go. We have successfully “hacked” Windows10 VM</p><p>I hope this guide was very helpful for you, and that you were able to learn something new or clear up any doubts you had about this particular vulnerability and how to use it.</p><p>If you have any outdated or updated information regarding this guide or just want to share some information, comment them here, I’d love to read it all.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/429/1*RzCrb5dGcXH_8IBLIZ-cfA.jpeg" /></figure><p>Thank you so much for reading :)</p><p>#1</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=090ab57adeb9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>