<?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/">
  <channel>
    <title>Forem: Rajpal Singh</title>
    <description>The latest articles on Forem by Rajpal Singh (@rajpal-se).</description>
    <link>https://forem.com/rajpal-se</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2475709%2F3d0db442-1355-4986-abad-270177c5f794.png</url>
      <title>Forem: Rajpal Singh</title>
      <link>https://forem.com/rajpal-se</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/rajpal-se"/>
    <language>en</language>
    <item>
      <title>List Active Listening Ports on Windows Systems</title>
      <dc:creator>Rajpal Singh</dc:creator>
      <pubDate>Sun, 24 Nov 2024 08:57:55 +0000</pubDate>
      <link>https://forem.com/rajpal-se/list-active-listening-ports-on-windows-systems-2e81</link>
      <guid>https://forem.com/rajpal-se/list-active-listening-ports-on-windows-systems-2e81</guid>
      <description>&lt;p&gt;To view a list of listening ports in a Windows environment, you can use several methods, most commonly through the &lt;strong&gt;Command Prompt&lt;/strong&gt; or &lt;strong&gt;PowerShell&lt;/strong&gt;. Here's how you can do it:&lt;/p&gt;

&lt;h3&gt;
  
  
  Method 1: Using &lt;code&gt;netstat&lt;/code&gt; (Command Prompt)
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Open the &lt;strong&gt;Command Prompt&lt;/strong&gt; by pressing &lt;code&gt;Windows + R&lt;/code&gt;, typing &lt;code&gt;cmd&lt;/code&gt;, and pressing &lt;code&gt;Enter&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Type the following command to see a list of all listening ports:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;netstat &lt;span class="nt"&gt;-ano&lt;/span&gt; | findstr LISTEN
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;netstat&lt;/code&gt; displays network connections, routing tables, and interface statistics.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;-a&lt;/code&gt; option shows all connections and listening ports.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;-n&lt;/code&gt; option shows addresses and port numbers in numerical form.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;-o&lt;/code&gt; option shows the process ID (PID) associated with each connection.&lt;/li&gt;
&lt;li&gt;This will display a list of listening ports along with the associated process IDs (PIDs). For example:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;TCP    0.0.0.0:80             0.0.0.0:0              LISTENING       1234 TCP    &lt;span class="o"&gt;[&lt;/span&gt;::]:443                &lt;span class="o"&gt;[&lt;/span&gt;::]:0                 LISTENING      5678
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Method 2: Using &lt;code&gt;Get-NetTCPConnection&lt;/code&gt; (PowerShell)
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Open &lt;strong&gt;PowerShell&lt;/strong&gt; by pressing &lt;code&gt;Windows + X&lt;/code&gt; and selecting &lt;strong&gt;Windows PowerShell&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Run the following command to list all listening TCP connections:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Get-NetTCPConnection &lt;span class="nt"&gt;-State&lt;/span&gt; Listen&lt;span class="sb"&gt;`&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will return a list of active TCP connections that are in the "LISTEN" state, along with their local addresses and port numbers.&lt;/p&gt;

&lt;h3&gt;
  
  
  Method 3: Using &lt;code&gt;netstat&lt;/code&gt; with &lt;code&gt;findstr&lt;/code&gt; in PowerShell
&lt;/h3&gt;

&lt;p&gt;You can also use &lt;code&gt;netstat&lt;/code&gt; directly in PowerShell in the same way as in Command Prompt:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Open &lt;strong&gt;PowerShell&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt; Run this command to filter out the listening ports:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;netstat &lt;span class="nt"&gt;-ano&lt;/span&gt; | findstr LISTEN
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Method 4: Using Resource Monitor (Graphical Interface)
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Press &lt;code&gt;Ctrl + Shift + Esc&lt;/code&gt; to open &lt;strong&gt;Task Manager&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Go to the &lt;strong&gt;Performance&lt;/strong&gt; tab and click on &lt;strong&gt;Open Resource Monitor&lt;/strong&gt; at the bottom.&lt;/li&gt;
&lt;li&gt;In &lt;strong&gt;Resource Monitor&lt;/strong&gt;, go to the &lt;strong&gt;Network&lt;/strong&gt; tab.&lt;/li&gt;
&lt;li&gt;In the &lt;strong&gt;Listening Ports&lt;/strong&gt; section, you will see a list of processes that are listening on various ports.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These methods allow you to see which applications or services are actively listening for incoming connections on your system.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>cloud</category>
      <category>aws</category>
    </item>
  </channel>
</rss>
