<?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 Ahtasham Ahsan on Medium]]></title>
        <description><![CDATA[Stories by Ahtasham Ahsan on Medium]]></description>
        <link>https://medium.com/@ahtashamahsan?source=rss-6fdddcd15b13------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*_XqmAPXl7HQsZo3G</url>
            <title>Stories by Ahtasham Ahsan on Medium</title>
            <link>https://medium.com/@ahtashamahsan?source=rss-6fdddcd15b13------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 15:34:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ahtashamahsan/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[How To Use PowerShell]]></title>
            <link>https://medium.com/@ahtashamahsan/how-to-use-powershell-91e0d364327b?source=rss-6fdddcd15b13------2</link>
            <guid isPermaLink="false">https://medium.com/p/91e0d364327b</guid>
            <category><![CDATA[shellscripting]]></category>
            <category><![CDATA[cli]]></category>
            <category><![CDATA[powershell-scripting]]></category>
            <category><![CDATA[scripting]]></category>
            <category><![CDATA[powershell]]></category>
            <dc:creator><![CDATA[Ahtasham Ahsan]]></dc:creator>
            <pubDate>Wed, 07 Feb 2024 18:38:16 GMT</pubDate>
            <atom:updated>2024-02-07T18:39:14.051Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/210/1*ZCtJC8c6Ttip3gbdcT-9Ew.png" /></figure><p>PowerShell is a task-based command-line shell and scripting language designed especially for system administration. Built on the .NET Framework, Windows PowerShell helps IT professionals and power users control and automate the administration of the Windows operating system and applications that run on Windows. PowerShell is more powerful than the command prompt, it allows function, variable, loop string etc.</p><p>We can check the version of Powershell installed on machine.<br><strong>$PSVersionTable</strong></p><pre>PS C:WindowsSystem32WindowsPowerShellv1.0&gt; $PSVersionTable<br>Name                           Value                                                                                                 <br>----                           -----                                                                                                <br>PSVersion                      5.1.14409.1005                                                                                        <br>PSEdition                      Desktop                                                                                              <br>PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                               <br>BuildVersion                   10.0.14409.1005                                                                                      <br>CLRVersion                     4.0.30319.42000                                                                                      <br>WSManStackVersion              3.0                                                                                                   <br>PSRemotingProtocolVersion      2.3                                                                                                  <br>SerializationVersion           1.1.0.1</pre><p>let’s do a little help to show all the possibilities with the “Get-Help” Command :<br><strong>Get-Help</strong></p><pre>PS C:WindowsSystem32WindowsPowerShellv1.0&gt; Get-Help<br>TOPIC<br>Windows PowerShell Help System<br>SHORT DESCRIPTION<br>Displays help about Windows PowerShell cmdlets and concepts.<br>LONG DESCRIPTION<br>Windows PowerShell Help describes Windows PowerShell cmdlets,<br>functions, scripts, and modules, and explains concepts, including<br>the elements of the Windows PowerShell language.<br>Windows PowerShell does not include help files, but you can read the<br>help topics online, or use the Update-Help cmdlet to download help files<br>to your computer and then use the Get-Help cmdlet to display the help<br>topics at the command line.<br>You can also use the Update-Help cmdlet to download updated help files<br>as they are released so that your local help content is never obsolete.<br>Without help files, Get-Help displays auto-generated help for cmdlets, <br>functions, and scripts.<br>ONLINE HELP <br>You can find help for Windows PowerShell online in the TechNet Library<br>beginning at http://go.microsoft.com/fwlink/?LinkID=108518.<br>To open online help for any cmdlet or function, type:</pre><h3>1. PowerShell Get-Date and time</h3><p>To check date and time with powershell cmdlets.<br>Display Current Date in PowerShell:<br><strong>Get-Date</strong></p><pre>PS C:WindowsSystem32WindowsPowerShellv1.0&gt; Get-Date<br>Wednesday, November 23, 2022 9:36:01 PM</pre><p>PowerShell Display Only Date:<br><strong>Get-Date -DisplayHint Date</strong></p><pre>PS C:WindowsSystem32WindowsPowerShellv1.0&gt; Get-Date -DisplayHint Date<br>Wednesday, November 23, 2022</pre><h3>2. Working with Folder Using PowerShell</h3><p>PowerShell create a folder :<br><strong>New-Item -Path ‘F:NewFoldername’ -ItemType Directory</strong></p><pre>PS C:WindowsSystem32WindowsPowerShellv1.0&gt; New-Item -Path F:PS -ItemType Directory<br>Directory: F:<br>Mode LastWriteTime Length Name <br>---- ------------- ------ ---- <br>d----- 11/23/2022 9:43 PM PS</pre><p>PowerShell copy folder :<br><strong>Copy-Item ‘F:SourceFolder’ ‘F:DestinationFolder’</strong></p><pre>PS C:WindowsSystem32WindowsPowerShellv1.0&gt; Copy-Item F:3.LINUXLinks.txt F:PS<br>PS C:WindowsSystem32WindowsPowerShellv1.0&gt; Get-ChildItem F:PS<br>Directory: F:PS<br>Mode LastWriteTime Length Name <br>---- ------------- ------ ---- <br>-a---- 9/1/2022 9:33 AM 350 Links.txt<br>PS C:WindowsSystem32WindowsPowerShellv1.0&gt;</pre><p>PowerShell delete folder:<br><strong>Remove-Item ‘F: Foldername</strong></p><pre>PS C:WindowsSystem32WindowsPowerShellv1.0&gt; Remove-Item F:PS</pre><p>PowerShell move folder:<br><strong>Move-Item C:SourceFolder F:DestinationFolder</strong></p><pre>PS C:WindowsSystem32WindowsPowerShellv1.0&gt; Move-Item F:3.LINUX F:PS<br>PS C:WindowsSystem32WindowsPowerShellv1.0&gt; Get-ChildItem F:PS<br>Directory: F:PS<br>Mode LastWriteTime Length Name <br>---- ------------- ------ ---- <br>d----- 9/1/2022 9:33 AM 3.LINUX<br>PS C:WindowsSystem32WindowsPowerShellv1.0&gt;</pre><p>PowerShell rename folder:<br><strong>Rename-Item ‘F:Foldername Newname’</strong></p><pre>PS C:WindowsSystem32WindowsPowerShellv1.0&gt; Rename-Item F:PS3.LINUX UNIX<br>PS C:WindowsSystem32WindowsPowerShellv1.0&gt; Get-ChildItem F:PS<br>Directory: F:PS<br>Mode LastWriteTime Length Name <br>---- ------------- ------ ---- <br>d----- 9/1/2022 9:33 AM UNIX<br>PS C:WindowsSystem32WindowsPowerShellv1.0&gt;</pre><p>PowerShell Check a folder exists :<br><strong>Test-Path ‘F:Foldername</strong></p><pre>PS C:WindowsSystem32WindowsPowerShellv1.0&gt; Test-Path F:PSUNIX<br>True</pre><p>Retrieve all the content of Folder:<br><strong>Get-ChildItem F:SourceFolder</strong></p><pre>PS F:WindowsSystem32WindowsPowerShellv1.0&gt; Get-ChildItem F:PSUNIX<br>Directory: F:PSUNIX<br>Mode LastWriteTime Length Name <br>---- ------------- ------ ---- <br>d----- 7/29/2020 8:52 PM Linux <br>d----- 8/27/2022 12:15 PM Linux <br>d----- 9/30/2019 12:38 PM Microsoft Window Server 2012 <br>d----- 10/23/2016 9:42 PM Nagios <br>d----- 2/16/2022 11:24 PM VMware Setup <br>-a---- 9/1/2022 9:33 AM 350 Links.txt <br>-a---- 9/1/2022 9:33 AM 53940 Linux-Cheat-Sheet.pdf</pre><p>Retrieve all text file of Folder:<br><strong>Get-ChildItem F:SourceFolder *.txt</strong></p><pre>PS C:WindowsSystem32WindowsPowerShellv1.0&gt; Get-ChildItem F:PSUNIX *.txt<br>Directory: F:PSUNIX<br>Mode LastWriteTime Length Name <br>---- ------------- ------ ---- <br>-a---- 9/1/2022 9:33 AM 350 Links.txt</pre><h3>3. Working with File Using PowerShell</h3><p>Create New File Using PowerShell:<br><strong>New-Item -Path ‘F:Foldernamefilename.txt’-ItemType File</strong></p><pre>PS C:WindowsSystem32WindowsPowerShellv1.0&gt; New-Item F:PSAAA.txt -ItemType File<br>Directory: F:PS<br>Mode LastWriteTime Length Name <br>---- ------------- ------ ---- <br>-a---- 11/23/2022 10:07 PM 0 AAA.txt<br>PS C:WindowsSystem32WindowsPowerShellv1.0&gt;</pre><p>Copy files from one folder to another using PowerShell script:<br><strong>Copy-Item ‘F:SourceFolderText.txt’ ‘F:DestinationFolderText.txt’</strong></p><pre>PS C:WindowsSystem32WindowsPowerShellv1.0&gt; Copy-Item F:PSAAA.txt F:New<br>PS C:WindowsSystem32WindowsPowerShellv1.0&gt; Get-ChildItem F:New<br>Directory: F:New<br>Mode LastWriteTime Length Name <br>---- ------------- ------ ---- <br>-a---- 11/23/2022 10:07 PM 0 AAA.txt<br>PS C:WindowsSystem32WindowsPowerShellv1.0&gt;</pre><p>PowerShell Delete File from Folder:<br><strong>Remove-Item ‘F:FolderNameFileName.txt’</strong></p><pre>PS C:WindowsSystem32WindowsPowerShellv1.0&gt; Remove-Item F:NewAAA.txt<br>PS C:WindowsSystem32WindowsPowerShellv1.0&gt; Get-ChildItem F:New<br>PS C:WindowsSystem32WindowsPowerShellv1.0&gt;</pre><p>PowerShell move file to another folder:<br><strong>Move-Item ‘F:SourceFolderFileName.txt’ C:DestinationFolder</strong></p><pre>PS C:WindowsSystem32WindowsPowerShellv1.0&gt; Move-Item F:PSabc.txt F:New<br>PS C:WindowsSystem32WindowsPowerShellv1.0&gt; Get-ChildItem F:New<br>Directory: F:New<br>Mode LastWriteTime Length Name <br>---- ------------- ------ ---- <br>-a---- 11/23/2022 10:04 PM 0 abc.txt<br>PS C:WindowsSystem32WindowsPowerShellv1.0&gt; Get-ChildItem F:PS<br>Directory: F:PS<br>Mode LastWriteTime Length Name <br>---- ------------- ------ ---- <br>-a---- 11/23/2022 10:07 PM 0 AAA.txt<br>PS C:WindowsSystem32WindowsPowerShellv1.0&gt;</pre><p>Rename File using PowerShell:<br><strong>Rename-Item ‘F:FolderNameFileName.txt NewNameOfFIle’</strong></p><pre>PS C:WindowsSystem32WindowsPowerShellv1.0&gt; Rename-Item F:PSAAA.txt BBB<br>PS C:WindowsSystem32WindowsPowerShellv1.0&gt; Get-ChildItem F:PS<br>Directory: F:PS<br>Mode LastWriteTime Length Name <br>---- ------------- ------ ---- <br>-a---- 11/23/2022 10:07 PM 0 BBB<br>PS C:WindowsSystem32WindowsPowerShellv1.0&gt;</pre><p>Check file is exist or not using PowerShell:<br><strong>Test-Path ‘F:FolderNameFileName.txt</strong>’</p><pre>PS C:WindowsSystem32WindowsPowerShellv1.0&gt; Test-Path F:Newabc.txt<br>True<br>PS C:WindowsSystem32WindowsPowerShellv1.0&gt;</pre><p>Retrieve content from a file using PowerShell:<br><strong>Get-Content</strong></p><pre>PS C:WindowsSystem32WindowsPowerShellv1.0&gt; Get-Content F:Newabc.txt<br>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB<br>CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC<br>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB<br>PS C:WindowsSystem32WindowsPowerShellv1.0&gt;</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=91e0d364327b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Nmap Module In Python]]></title>
            <link>https://medium.com/@ahtashamahsan/nmap-module-in-python-fcc813b8a964?source=rss-6fdddcd15b13------2</link>
            <guid isPermaLink="false">https://medium.com/p/fcc813b8a964</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[nmap]]></category>
            <category><![CDATA[vulnerability-scanning]]></category>
            <category><![CDATA[nmap-module-python]]></category>
            <category><![CDATA[network-scanning]]></category>
            <dc:creator><![CDATA[Ahtasham Ahsan]]></dc:creator>
            <pubDate>Wed, 07 Feb 2024 18:27:25 GMT</pubDate>
            <atom:updated>2024-02-07T18:27:25.562Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/618/1*4VorJ8IwZLtTFsxtOYKLqA.png" /></figure><p>Python nmap module help us in manipulating nmap scan results programmatically. We can automate scanning tasks with this module.</p><p>We are going to perform nmap tasks in python. First we have to import the nmap module in our python code affterward we initialize the portscanner. Different methods of python are explained below.</p><pre>&gt;&gt;&gt; import nmap<br>&gt;&gt;&gt; nmp=nmap.PortScanner()<br>&gt;&gt;&gt; nmp.nmap_version()  #returns nmap version if detected (version, subversion) or (0, 0) if unknown<br> (7, 93)<br>&gt;&gt;&gt; nmp.listscan(&quot;192.168.10.1/30&quot;) #do not scan but interpret target hosts and return a list a hosts<br> [&#39;192.168.10.0&#39;, &#39;192.168.10.1&#39;, &#39;192.168.10.2&#39;, &#39;192.168.10.3&#39;]</pre><p>scan( # NOQA: CFQ001, C901self, hosts=”127.0.0.1″, ports=None, arguments=”-sV”, sudo=False, timeout=0)</p><p>hosts: string for hosts as nmap use it ‘scanme.nmap.org’ or ‘198.116.0–255.1–127’ or ‘216.163.128.20/20’</p><p>ports: string for ports as nmap use it ‘22,53,110,143–4564’</p><p>arguments: string of arguments for nmap ‘-sU -sX -sC’</p><p>sudo: launch nmap with sudo if True</p><p>timeout: int, if &gt; zero, will terminate scan after seconds, otherwise will wait indefintely</p><p>returns: scan_result as dictionnary</p><pre>&gt;&gt;&gt; nmp.scan(&#39;192.168.10.8&#39;, &#39;23&#39;, &#39;-sV&#39;)       # Scan given hosts                                   <br>{&#39;nmap&#39;: {&#39;command_line&#39;: &#39;nmap -oX - -p 23 -sV 192.168.10.8&#39;, &#39;scaninfo&#39;: {&#39;error&#39;: [&#39;NSOCK ERROR [0.1210s] ssl_init_helper(): OpenSSL legacy provider failed to load.\r\n\r\n&#39;], &#39;tcp&#39;: {&#39;method&#39;: &#39;syn&#39;, &#39;services&#39;: &#39;23&#39;}}, &#39;scanstats&#39;: {&#39;timestr&#39;: &#39;Mon Nov  7 21:44:55 2022&#39;, &#39;elapsed&#39;: &#39;2.09&#39;, &#39;uphosts&#39;: &#39;1&#39;, &#39;downhosts&#39;: &#39;0&#39;, &#39;totalhosts&#39;: &#39;1&#39;}}, &#39;scan&#39;: {&#39;192.168.10.8&#39;: {&#39;hostnames&#39;: [{&#39;name&#39;: &#39;PC&#39;, &#39;type&#39;: &#39;PTR&#39;}], &#39;addresses&#39;: {&#39;ipv4&#39;: &#39;192.168.10.8&#39;}, &#39;vendor&#39;: {}, &#39;status&#39;: {&#39;state&#39;: &#39;up&#39;, &#39;reason&#39;: &#39;localhost-response&#39;}, &#39;tcp&#39;: {23: {&#39;state&#39;: &#39;closed&#39;, &#39;reason&#39;: &#39;reset&#39;, &#39;name&#39;: &#39;telnet&#39;, &#39;product&#39;: &#39;&#39;, &#39;version&#39;: &#39;&#39;, &#39;extrainfo&#39;: &#39;&#39;, &#39;conf&#39;: &#39;3&#39;, &#39;cpe&#39;: &#39;&#39;}}}}}<br><br>&gt;&gt;&gt; nmp.all_hosts()     #  returns a sorted list of all hosts<br>[&#39;192.168.10.1&#39;, &#39;192.168.10.3&#39;]<br><br>#  returns command line used for the scan, may raise AssertionError exception if called before scanning<br>&gt;&gt;&gt; nmp.command_line()    <br>&#39;nmap -oX - -p 22 -sV 192.168.10.1/30&#39;<br><br>#  returns scaninfo structure / {&#39;tcp&#39;: {&#39;services&#39;: &#39;22&#39;, &#39;method&#39;: &#39;connect&#39;}<br>#  may raise AssertionError exception if called before scanning<br>&gt;&gt;&gt; nmp.scaninfo()<br>{&#39;error&#39;: [&#39;NSOCK ERROR [0.1090s] ssl_init_helper(): OpenSSL legacy provider failed to load.\r\n\r\n&#39;], &#39;tcp&#39;: {&#39;method&#39;: &#39;syn&#39;, &#39;services&#39;: &#39;22&#39;}}<br><br># returns scanstats structure / {&#39;uphosts&#39;: &#39;3&#39;, &#39;timestr&#39;: &#39;Thu Jun  3 21:45:07 2010&#39;, &#39;downhosts&#39;: &#39;253&#39;, &#39;totalhosts&#39;: &#39;256&#39;, &#39;elapsed&#39;: &#39;5.79&#39;} <br># NOQA: E50 / may raise AssertionError exception if called before scanning<br>&gt;&gt;&gt; nmp.scanstats()<br>{&#39;timestr&#39;: &#39;Mon Nov  7 21:51:38 2022&#39;, &#39;elapsed&#39;: &#39;3.28&#39;, &#39;uphosts&#39;: &#39;2&#39;, &#39;downhosts&#39;: &#39;2&#39;, &#39;totalhosts&#39;: &#39;4&#39;}<br><br>&gt;&gt;&gt; nmp.has_host(&#39;192.168.10.3&#39;)         #  returns True if host has result, False otherwise<br>True<br><br>&gt;&gt;&gt; nmp.csv()            # returns CSV output as text<br>&#39;host;hostname;hostname_type;protocol;port;name;state;product;extrainfo;reason;version;conf;cpe\r\n192.168.10.1;Broadcom.Home;PTR;tcp;22;ssh;closed;;;reset;;3;\r\n192.168.10.3;AAAA-s-A03s;PTR;tcp;22;ssh;closed;;;reset;;3;\r\n&#39;<br><br># Analyses NMAP xml scan ouput. May raise PortScannerError exception if nmap output was not xml<br># nmap_xml_output: xml string to analyse , returns: scan_result as dictionnary<br>&gt;&gt;&gt; nmp.analyse_nmap_xml_scan()<br>{&#39;nmap&#39;: {&#39;command_line&#39;: &#39;nmap -oX - -p 23 -sV 192.168.10.8&#39;, &#39;scaninfo&#39;: {&#39;tcp&#39;: {&#39;method&#39;: &#39;syn&#39;, &#39;services&#39;: &#39;23&#39;}}, &#39;scanstats&#39;: {&#39;timestr&#39;: &#39;Mon Nov  7 22:02:26 2022&#39;, &#39;elapsed&#39;: &#39;1.78&#39;, &#39;uphosts&#39;: &#39;1&#39;, &#39;downhosts&#39;: &#39;0&#39;, &#39;totalhosts&#39;: &#39;1&#39;}}, &#39;scan&#39;: {&#39;192.168.10.8&#39;: {&#39;hostnames&#39;: [{&#39;name&#39;: &#39;PC&#39;, &#39;type&#39;: &#39;PTR&#39;}], &#39;addresses&#39;: {&#39;ipv4&#39;: &#39;192.168.10.8&#39;}, &#39;vendor&#39;: {}, &#39;status&#39;: {&#39;state&#39;: &#39;up&#39;, &#39;reason&#39;: &#39;localhost-response&#39;}, &#39;tcp&#39;: {23: {&#39;state&#39;: &#39;closed&#39;, &#39;reason&#39;: &#39;reset&#39;, &#39;name&#39;: &#39;telnet&#39;, &#39;product&#39;: &#39;&#39;, &#39;version&#39;: &#39;&#39;, &#39;extrainfo&#39;: &#39;&#39;, &#39;conf&#39;: &#39;3&#39;, &#39;cpe&#39;: &#39;&#39;}}}}}<br><br>&gt;&gt;&gt; nmp[&#39;192.168.10.8&#39;].hostnames()   # returns: list of hostnames<br>[{&#39;name&#39;: &#39;PC&#39;, &#39;type&#39;: &#39;PTR&#39;}]<br><br>&gt;&gt;&gt; nmp[&#39;192.168.10.8&#39;].hostname()    # returns: try to return the user record or the first hostname of the list hostnames<br>&#39;PC&#39;<br><br>&gt;&gt;&gt; nmp[&#39;192.168.10.8&#39;].state()       # returns: host state<br>&#39;up&#39;<br><br>&gt;&gt;&gt; nmp[&#39;192.168.10.8&#39;].all_protocols()  # returns: a list of all scanned protocols<br>[&#39;tcp&#39;]<br><br>&gt;&gt;&gt; nmp[&#39;192.168.10.8&#39;].all_tcp()      # returns: list of tcp ports<br>[23]<br><br>&gt;&gt;&gt; nmp[&#39;192.168.10.8&#39;].has_tcp(22)    # param port: (int) tcp port, returns: info for tcp port<br>False                                          <br><br>&gt;&gt;&gt; nmp[&#39;192.168.10.8&#39;].has_udp(67)    # param port: (int) udp port, returns: True if udp port has info, False otherwise<br>False                                                              <br><br>&gt;&gt;&gt; nmp[&#39;192.168.10.8&#39;].has_sctp(132)  # returns: True if sctp port has info, False otherwise<br>False</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fcc813b8a964" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[IPaddress Module In Python]]></title>
            <link>https://medium.com/@ahtashamahsan/ipaddress-module-in-python-28eaac152350?source=rss-6fdddcd15b13------2</link>
            <guid isPermaLink="false">https://medium.com/p/28eaac152350</guid>
            <category><![CDATA[network-automation]]></category>
            <category><![CDATA[network-scripting]]></category>
            <category><![CDATA[ipaddress-module]]></category>
            <category><![CDATA[ipaddress-in-python]]></category>
            <category><![CDATA[python-module]]></category>
            <dc:creator><![CDATA[Ahtasham Ahsan]]></dc:creator>
            <pubDate>Wed, 07 Feb 2024 18:20:13 GMT</pubDate>
            <atom:updated>2024-02-07T18:20:13.550Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YmiXpPfIm3E26QEYaLX67g.png" /></figure><p>ipaddress module provides the capabilities to create, manipulate and operate on IPv4 and IPv6 addresses and networks. The functions and classes in this module make it straightforward to handle various tasks related to IP addresses, including checking whether or not two hosts are on the same subnet, iterating over all hosts in a particular subnet, checking whether or not a string represents a valid IP address or network definition.</p><p>The <a href="https://docs.python.org/3/library/ipaddress.html#module-ipaddress">ipaddress</a> module provides functions to create IP addresses, networks and interfaces.</p><p>ipaddress.<strong>ip_address</strong>(<em>address</em>)</p><p>Return an <a href="https://docs.python.org/3/library/ipaddress.html#ipaddress.IPv4Address">IPv4</a> or <a href="https://docs.python.org/3/library/ipaddress.html#ipaddress.IPv6Address">IPv6 Address</a> object depending on the IP address passed as argument.</p><pre>&gt;&gt;&gt; ipaddress.ip_address(&quot;10.10.10.1&quot;)<br>IPv4Address(&#39;10.10.10.1&#39;)<br>&gt;&gt;&gt; ipaddress.ip_address(&quot;2001:0:9d38:6ab8::&quot;)<br>IPv6Address(&#39;2001:0:9d38:6ab8::&#39;)</pre><p>ipaddress.<strong>ip_network</strong>(<em>address</em>, <em>strict=True</em>)</p><p>Return an <a href="https://docs.python.org/3/library/ipaddress.html#ipaddress.IPv4Network">IPv4</a> or <a href="https://docs.python.org/3/library/ipaddress.html#ipaddress.IPv6Network">IPv6 Network</a> object depending on the IP address passed as argument. address is a string or integer representing the IP network.</p><pre>&gt;&gt;&gt; ipaddress.ip_network(&quot;10.10.10.0/26&quot;)<br>IPv4Network(&#39;10.10.10.0/26&#39;)</pre><p>ipaddress.<strong>ip_interface</strong>(<em>address</em>)</p><p>Return an <a href="https://docs.python.org/3/library/ipaddress.html#ipaddress.IPv4Interface">IPv4</a> or <a href="https://docs.python.org/3/library/ipaddress.html#ipaddress.IPv6Interface">IPv6 Interface</a> object depending on the IP address passed as argument. address is a string or integer representing the IP address.</p><pre>&gt;&gt;&gt; interface = ipaddress.IPv4Interface(&quot;10.10.10.10/26&quot;)<br>&gt;&gt;&gt; interface.ip<br>IPv4Address(&#39;10.10.10.10&#39;)</pre><h4>1. IP Addresses</h4><p>· <strong>Address objects</strong></p><p>Class ipaddress.<strong>IPv4Address</strong>(<em>address</em>)</p><p>Construct an IPv4 address. An <a href="https://docs.python.org/3/library/ipaddress.html#ipaddress.AddressValueError">AddressValueError</a> is raised if <em>address</em> is not a valid IPv4 address.</p><p>Class ipaddress.<strong>IPv6Address</strong>(<em>address</em>)</p><p>Construct an IPv6 address. An <a href="https://docs.python.org/3/library/ipaddress.html#ipaddress.AddressValueError">AddressValueError</a> is raised if <em>address</em> is not a valid IPv6 address.</p><pre>&gt;&gt;&gt; ipaddress.IPv4Address(&quot;10.10.10.5&quot;)<br>IPv4Address(&#39;10.10.10.5&#39;)<br>&gt;&gt;&gt; ipaddress.IPv4Address(168430085)<br>IPv4Address(&#39;10.10.10.5&#39;)<br>&gt;&gt;&gt; ipaddress.IPv4Address(b&quot;\x0a\x0a\x0a\x05&quot;)<br>IPv4Address(&#39;10.10.10.5&#39;)<br>&gt;&gt;&gt; ipaddress.IPv6Address(&quot;2001:0000:9d38:6ab8::&quot;)<br>2001:0:9d38:6ab8::</pre><p><strong>version</strong></p><pre>&gt;&gt;&gt; print(ipaddress.IPv4Address(&quot;10.10.10.5&quot;).version)<br>4<br>&gt;&gt;&gt; print(ipaddress.ip_address(&quot;2001:0000:9d38:6ab8::&quot;).version)<br>6</pre><p><strong>max_prefixlen</strong></p><pre>&gt;&gt;&gt; print(ipaddress.IPv4Address(&quot;10.10.10.5&quot;).max_prefixlen)<br>32<br>&gt;&gt;&gt; print(ipaddress.ip_address(&quot;2001:0000:9d38:6ab8::&quot;).max_prefixlen)<br>128</pre><p><strong>Compressed</strong></p><pre>&gt;&gt;&gt; print(ipaddress.ip_address(&quot;2001:0000:9d38:6ab8::&quot;).compressed)<br>2001:0:9d38:6ab8::</pre><p><strong>Exploded</strong></p><pre>&gt;&gt;&gt; print(ipaddress.ip_address(&quot;2001:0000:9d38:6ab8::&quot;).exploded)<br>2001:0000:9d38:6ab8:0000:0000:0000:0000</pre><p><strong>Packed</strong></p><pre>&gt;&gt;&gt; print(ipaddress.ip_address(&quot;2001:0000:9d38:6ab8::&quot;).packed)<br>b&#39; \x01\x00\x00\x9d8j\xb8\x00\x00\x00\x00\x00\x00\x00\x00&#39;</pre><p><strong>reverse_pointer</strong></p><pre>&gt;&gt;&gt; print(ipaddress.IPv4Address(&quot;10.10.10.5&quot;).reverse_pointer)<br>5.10.10.10.in-addr.arpa<br>&gt;&gt;&gt; print(ipaddress.ip_address(&quot;2001:0000:9d38:6ab8::&quot;).is_reserved)<br>False</pre><p><strong>is_multicast</strong></p><pre>&gt;&gt;&gt; print(ipaddress.IPv4Address(&quot;10.10.10.5&quot;).is_multicast)<br>False<br>&gt;&gt;&gt; print(ipaddress.ip_address(&quot;2001:0000:9d38:6ab8::&quot;).is_multicast)<br>False</pre><p><strong>is_private</strong></p><pre>&gt;&gt;&gt; print(ipaddress.IPv4Address(&quot;10.10.10.5&quot;).is_private)<br>True<br>&gt;&gt;&gt; print(ipaddress.ip_address(&quot;2001:0000:9d38:6ab8::&quot;).is_private)<br>True</pre><p><strong>is_global</strong></p><pre>&gt;&gt;&gt; print(ipaddress.IPv4Address(&quot;10.10.10.5&quot;).is_global)<br>False<br>&gt;&gt;&gt; print(ipaddress.ip_address(&quot;2001:0000:9d38:6ab8::&quot;).is_global)<br>False</pre><p><strong>is_unspecified</strong></p><pre>&gt;&gt;&gt; print(ipaddress.IPv4Address(&quot;10.10.10.5&quot;).is_unspecified)<br>False<br>&gt;&gt;&gt; print(ipaddress.ip_address(&quot;2001:0000:9d38:6ab8::&quot;).is_unspecified)<br>False</pre><p><strong>is_reserved</strong></p><pre>&gt;&gt;&gt; print(ipaddress.IPv4Address(&quot;10.10.10.5&quot;).is_reserved)<br>False<br>&gt;&gt;&gt; print(ipaddress.ip_address(&quot;2001:0000:9d38:6ab8::&quot;).is_reserved)<br>False</pre><p><strong>is_loopback</strong></p><pre>&gt;&gt;&gt; print(ipaddress.IPv4Address(&quot;10.10.10.5&quot;).is_loopback)<br>False<br>&gt;&gt;&gt; print(ipaddress.ip_address(&quot;2001:0000:9d38:6ab8::&quot;).is_loopback)<br>False</pre><p><strong>is_link_local</strong></p><pre>&gt;&gt;&gt; print(ipaddress.IPv4Address(&quot;169.254.1.1&quot;).is_link_local)<br>True<br>&gt;&gt;&gt; print(ipaddress.ip_address(&quot;2001:0000:9d38:6ab8::&quot;).is_link_local)<br>False</pre><p>· Conversion to Strings and Integers</p><pre>&gt;&gt;&gt; print(str(ipaddress.ip_address(&quot;10.10.10.5&quot;)))<br>10.10.10.5<br>&gt;&gt;&gt; print(int(ipaddress.ip_address(&quot;10.10.10.5&quot;)))<br>168430085<br>&gt;&gt;&gt; print(str(ipaddress.ip_address(&quot;2001:0000:9d38:6ab8::&quot;)))<br>2001:0:9d38:6ab8::<br>&gt;&gt;&gt; print(int(ipaddress.ip_address(&quot;2001:0000:9d38:6ab8::&quot;)))<br>42540488210633193113448045193824567296</pre><p>·<strong> Operators</strong></p><p>Comparison Operators:</p><pre>&gt;&gt;&gt; print(ipaddress.IPv4Address(&#39;10.10.10.1&#39;) &lt; ipaddress.IPv4Address(&#39;172.30.1.1&#39;))<br>True<br>&gt;&gt;&gt; print(ipaddress.IPv4Address(&#39;10.10.10.1&#39;) == ipaddress.IPv4Address(&#39;172.30.1.1&#39;))<br>False<br>&gt;&gt;&gt; print(ipaddress.IPv4Address(&#39;10.10.10.1&#39;) != ipaddress.IPv4Address(&#39;172.30.1.1&#39;))<br>True<br>&gt;&gt;&gt; print(ipaddress.IPv6Address(&quot;2001:0:9d38:6ab8::&quot;) == ipaddress.IPv6Address(&quot;2001:0:9d38:6ab8::&quot;))<br>True<br>&gt;&gt;&gt; print(ipaddress.IPv6Address(&quot;2001:0:9d38:6ab8::&quot;) != ipaddress.IPv6Address(&quot;2001:0:9d38:6ab8::&quot;))<br>False</pre><p>Arithmetic Operators:</p><pre>&gt;&gt;&gt; print(ipaddress.IPv4Address(&#39;10.10.10.50&#39;) + 5)<br>10.10.10.55<br>&gt;&gt;&gt; print(ipaddress.IPv4Address(&#39;10.10.10.50&#39;) - 10)<br>10.10.10.40<br>&gt;&gt;&gt; print(ipaddress.IPv4Address(&#39;255.255.255.252&#39;) + 3)<br>255.255.255.255<br>&gt;&gt;&gt; print(ipaddress.IPv4Address(&#39;255.255.255.248&#39;) - 8)<br>255.255.255.240</pre><h4>2. IP Network definitions</h4><p>The <a href="https://docs.python.org/3/library/ipaddress.html#ipaddress.IPv4Network">IPv4Network</a> and <a href="https://docs.python.org/3/library/ipaddress.html#ipaddress.IPv6Network">IPv6Network</a> objects provide a mechanism for defining and inspecting IP network definitions. A network definition consists of a <em>mask</em> and a <em>network address</em>, and as such defines a range of IP addresses that equal the network address when masked (binary AND) with the mask. For example, a network definition with the mask 255.255.255.0 and the network address 192.168.1.0 consists of IP addresses in the inclusive range 192.168.1.0 to 192.168.1.255.</p><p>· <strong>Network objects</strong></p><p><em>class </em>ipaddress.<strong>IPv4Network</strong>(<em>address</em>, <em>strict=True</em>)</p><p><em>class </em>ipaddress.<strong>IPv6Network</strong>(<em>address</em>, <em>strict=True</em>)</p><p><strong>version</strong></p><pre>&gt;&gt;&gt; print(ipaddress.IPv4Network(&#39;10.10.11.0/24&#39;).version)<br>4<br>&gt;&gt;&gt; print(ipaddress.IPv6Network(&#39;2001:0:9d38:6ab8::&#39;).version)<br>6</pre><p><strong>max_prefixlen</strong></p><pre>&gt;&gt;&gt; print(ipaddress.IPv4Network(&#39;10.10.11.0/24&#39;).max_prefixlen)<br>32<br>&gt;&gt;&gt; print(ipaddress.IPv6Network(&#39;2001:0:9d38:6ab8::&#39;).max_prefixlen)<br>128</pre><p><strong>is_multicast</strong></p><pre>&gt;&gt;&gt; print(ipaddress.IPv4Network(&#39;10.10.11.0/24&#39;).is_multicast)<br>False<br>&gt;&gt;&gt; print(ipaddress.IPv6Network(&#39;2001:0:9d38:6ab8::&#39;).is_multicast)<br>False</pre><p><strong>is_private</strong></p><pre>&gt;&gt;&gt; print(ipaddress.IPv4Network(&#39;10.10.11.0/24&#39;).is_private)<br>True<br>&gt;&gt;&gt; print(ipaddress.IPv6Network(&#39;2001:0:9d38:6ab8::&#39;).is_private)<br>True</pre><p><strong>is_unspecified</strong></p><pre>&gt;&gt;&gt; print(ipaddress.IPv4Network(&#39;10.10.11.0/24&#39;).is_unspecified)<br>False<br>&gt;&gt;&gt; print(ipaddress.IPv6Network(&#39;2001:0:9d38:6ab8::&#39;).is_unspecified)<br>False</pre><p><strong>is_reserved</strong></p><pre>&gt;&gt;&gt; print(ipaddress.IPv4Network(&#39;10.10.11.0/24&#39;).is_reserved)<br>False<br>&gt;&gt;&gt; print(ipaddress.IPv6Network(&#39;2001:0:9d38:6ab8::&#39;).is_reserved)<br>False</pre><p><strong>is_loopback</strong></p><pre>&gt;&gt;&gt; print(ipaddress.IPv4Network(&#39;127.0.0.0/24&#39;).is_loopback)<br>True<br>&gt;&gt;&gt; print(ipaddress.IPv6Network(&#39;0:0:0:0:0:0:0:1&#39;).is_loopback)<br>True</pre><p><strong>is_link_local</strong></p><pre>&gt;&gt;&gt; print(ipaddress.IPv4Network(&#39;169.254.1.0/30&#39;).is_link_local)<br>True<br>&gt;&gt;&gt; print(ipaddress.IPv6Network(&#39;FE80::&#39;).is_link_local)<br>True</pre><p><strong>network_address</strong></p><pre>&gt;&gt;&gt; print(ipaddress.IPv4Network(&#39;10.10.11.0/24&#39;).network_address)<br>10.10.11.0<br>&gt;&gt;&gt; print(ipaddress.IPv6Network(&#39;2001:0:9d38:6ab8::&#39;).network_address)<br>2001:0:9d38:6ab8::</pre><p><strong>broadcast_address</strong></p><pre>&gt;&gt;&gt; print(ipaddress.IPv4Network(&#39;10.10.11.0/24&#39;).broadcast_address)<br>10.10.11.255<br>&gt;&gt;&gt; print(ipaddress.IPv6Network(&#39;2001:0:9d38:6ab8::&#39;).broadcast_address)<br>2001:0:9d38:6ab8::</pre><p><strong>hostmask</strong></p><pre>&gt;&gt;&gt; print(ipaddress.IPv4Network(&#39;10.10.11.0/24&#39;).hostmask)<br>0.0.0.255<br>&gt;&gt;&gt; print(ipaddress.IPv6Network(&#39;2001:0:9d38:6ab8::&#39;).hostmask)<br>::</pre><p><strong>netmask</strong></p><pre>&gt;&gt;&gt; print(ipaddress.IPv4Network(&#39;10.10.11.0/24&#39;).netmask)<br>255.255.255.0<br>&gt;&gt;&gt; print(ipaddress.IPv6Network(&#39;2001:0:9d38:6ab8::&#39;).netmask)<br>ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff</pre><p><strong>with_prefixlen</strong></p><pre>&gt;&gt;&gt; print(ipaddress.IPv4Network(&#39;10.10.11.0/24&#39;).with_prefixlen)<br>10.10.11.0/24<br>&gt;&gt;&gt; print(ipaddress.IPv6Network(&#39;2001:0:9d38:6ab8::&#39;).with_prefixlen)<br>2001:0:9d38:6ab8::/128</pre><p><strong>compressed</strong></p><pre>&gt;&gt;&gt; print(ipaddress.IPv4Network(&#39;10.10.11.0/24&#39;).compressed)<br>10.10.11.0/24<br>&gt;&gt;&gt; print(ipaddress.IPv6Network(&#39;2001:0000:9d38:6ab8::&#39;).compressed)<br>2001:0:9d38:6ab8::/128</pre><p><strong>exploded</strong></p><pre>&gt;&gt;&gt; print(ipaddress.IPv4Network(&#39;10.10.11.0/24&#39;).exploded)<br>10.10.11.0/24<br>&gt;&gt;&gt; print(ipaddress.IPv6Network(&#39;2001:0:9d38:6ab8::&#39;).exploded)<br>2001:0000:9d38:6ab8:0000:0000:0000:0000/128</pre><p><strong>with_netmask</strong></p><pre>&gt;&gt;&gt; print(ipaddress.IPv4Network(&#39;10.10.11.0/24&#39;).with_netmask)<br>10.10.11.0/255.255.255.0<br>&gt;&gt;&gt; print(ipaddress.IPv6Network(&#39;2001:0:9d38:6ab8::&#39;).with_netmask)<br>2001:0:9d38:6ab8::/ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff</pre><p><strong>with_hostmask</strong></p><pre>&gt;&gt;&gt; print(ipaddress.IPv4Network(&#39;10.10.11.0/24&#39;).with_hostmask)<br>10.10.11.0/0.0.0.255<br>&gt;&gt;&gt; print(ipaddress.IPv6Network(&#39;2001:0:9d38:6ab8::&#39;).with_hostmask)<br>2001:0:9d38:6ab8::/::</pre><p><strong>num_addresses</strong></p><pre>&gt;&gt;&gt; print(ipaddress.IPv4Network(&#39;10.10.11.0/24&#39;).num_addresses)<br>256<br>&gt;&gt;&gt; print(ipaddress.IPv6Network(&#39;2001:0:9d38:6ab8::/120&#39;).num_addresses)<br>256</pre><p><strong>prefixlen</strong></p><pre>&gt;&gt;&gt; print(ipaddress.IPv4Network(&#39;10.10.11.0/24&#39;).prefixlen)<br>24<br>&gt;&gt;&gt; print(ipaddress.IPv6Network(&#39;2001:0:9d38:6ab8::/120&#39;).prefixlen)<br>120</pre><p><strong>hosts</strong>()</p><pre>&gt;&gt;&gt; print(list(ipaddress.ip_network(&#39;10.10.10.4/30&#39;).hosts()))<br>[IPv4Address(&#39;10.10.10.5&#39;), IPv4Address(&#39;10.10.10.6&#39;)]</pre><p><strong>overlaps</strong>(<em>other</em>)</p><pre>&gt;&gt;&gt; a=ipaddress.IPv4Network(&quot;10.10.10.0/29&quot;)<br>&gt;&gt;&gt; b=ipaddress.IPv4Network(&quot;10.10.10.4/30&quot;)<br>&gt;&gt;&gt; print(a.overlaps(b))<br>True</pre><pre>address_exclude(network)<br>&gt;&gt;&gt; a=ipaddress.IPv4Network(&quot;10.10.10.0/29&quot;)<br>&gt;&gt;&gt; b=ipaddress.IPv4Network(&quot;10.10.10.4/32&quot;)<br>&gt;&gt;&gt; print(list(a.address_exclude(b)))<br>[IPv4Network(&#39;10.10.10.0/30&#39;), IPv4Network(&#39;10.10.10.6/31&#39;), IPv4Network(&#39;10.10.10.5/32&#39;)]</pre><p><strong>subnets</strong>(<em>prefixlen_diff=1</em>, <em>new_prefix=None</em>)</p><pre>&gt;&gt;&gt; a=ipaddress.IPv4Network(&quot;10.10.10.0/24&quot;)<br>&gt;&gt;&gt; print(list(a.subnets()))<br>[IPv4Network(&#39;10.10.10.0/25&#39;), IPv4Network(&#39;10.10.10.128/25&#39;)]<br>&gt;&gt;&gt; print(list(a.subnets(prefixlen_diff=3)))<br>[IPv4Network(&#39;10.10.10.0/27&#39;), IPv4Network(&#39;10.10.10.32/27&#39;), IPv4Network(&#39;10.10.10.64/27&#39;), IPv4Network(&#39;10.10.10.96/27&#39;), IPv4Network(&#39;10.10.10.128/27&#39;), IPv4Network(&#39;10.10.10.160/27&#39;), IPv4Network(&#39;10.10.10.192/27&#39;), IPv4Network(&#39;10.10.10.224/27&#39;)]<br>&gt;&gt;&gt; print(list(a.subnets(new_prefix=25)))<br>[IPv4Network(&#39;10.10.10.0/25&#39;), IPv4Network(&#39;10.10.10.128/25&#39;)]</pre><pre>supernet(prefixlen_diff=1, new_prefix=None)<br>&gt;&gt;&gt; a=ipaddress.IPv4Network(&quot;10.10.10.0/24&quot;)<br>&gt;&gt;&gt; print(a.supernet())<br>10.10.10.0/23<br>&gt;&gt;&gt; print(a.supernet(prefixlen_diff=3))<br>10.10.8.0/21<br>&gt;&gt;&gt; print(a.supernet(new_prefix=18))<br>10.10.0.0/18</pre><p><strong>subnet_of</strong>(<em>other</em>)</p><pre>&gt;&gt;&gt; a=ipaddress.IPv4Network(&quot;10.10.10.0/29&quot;)<br>&gt;&gt;&gt; b=ipaddress.IPv4Network(&quot;10.10.10.4/30&quot;)<br>&gt;&gt;&gt; print(b.subnet_of(a))<br>True</pre><p><strong>supernet_of</strong>(<em>other</em>)</p><pre>&gt;&gt;&gt; a=ipaddress.IPv4Network(&quot;10.10.10.0/29&quot;)<br>&gt;&gt;&gt; b=ipaddress.IPv4Network(&quot;10.10.10.4/30&quot;)<br>&gt;&gt;&gt; print(a.supernet_of(b))<br>True</pre><p><strong>compare_networks</strong>(<em>other</em>)</p><pre>&gt;&gt;&gt; print((ipaddress.IPv4Network(&quot;10.10.10.1/32&quot;).compare_networks(ipaddress.IPv4Network(&quot;10.10.10.2/32&quot;))))<br>-1<br>&gt;&gt;&gt; print((ipaddress.IPv4Network(&quot;10.10.10.3/32&quot;).compare_networks(ipaddress.IPv4Network(&quot;10.10.10.3/32&quot;))))<br>0<br>&gt;&gt;&gt; print((ipaddress.IPv4Network(&quot;10.10.10.4/32&quot;).compare_networks(ipaddress.IPv4Network(&quot;10.10.10.2/32&quot;))))<br>1</pre><h4>3. Interface objects</h4><p><em>class </em>ipaddress.<strong>IPv4Interface</strong>(<em>address</em>)</p><p><em>class </em>ipaddress.<strong>IPv6Interface</strong>(<em>address</em>)</p><p><strong>Ip</strong></p><pre>&gt;&gt;&gt; interface = ipaddress.IPv4Interface(&#39;10.10.11.1/30&#39;)<br>&gt;&gt;&gt; print(interface.ip)<br>10.10.11.1<br>&gt;&gt;&gt; interface = ipaddress.IPv6Interface(&#39;2001:0db8:85a3:0000:0000:8a2e:0370:7334&#39;)<br>&gt;&gt;&gt; print(interface.ip)<br>2001:db8:85a3::8a2e:370:7334</pre><p><strong>network</strong></p><pre>&gt;&gt;&gt; interface = ipaddress.IPv4Interface(&#39;10.10.11.1/30&#39;)<br>&gt;&gt;&gt; print(interface.network)<br>10.10.11.0/30<br>&gt;&gt;&gt; interface = ipaddress.IPv6Interface(&#39;2001:0db8:85a3:0000:0000:8a2e:0370:7334&#39;)<br>&gt;&gt;&gt; print(interface.network)<br>2001:db8:85a3::8a2e:370:7334/128</pre><p><strong>with_prefixlen</strong></p><pre>&gt;&gt;&gt; interface = ipaddress.IPv4Interface(&#39;10.10.11.1/30&#39;)<br>&gt;&gt;&gt; print(interface.with_prefixlen)<br>10.10.11.1/30<br>&gt;&gt;&gt; interface = ipaddress.IPv6Interface(&#39;2001:0db8:85a3:0000:0000:8a2e:0370:7334&#39;)<br>&gt;&gt;&gt; print(interface.with_prefixlen)<br>2001:db8:85a3::8a2e:370:7334/128</pre><p><strong>with_netmask</strong></p><pre>&gt;&gt;&gt; interface = ipaddress.IPv4Interface(&#39;10.10.11.1/30&#39;)<br>&gt;&gt;&gt; print(interface.with_netmask)<br>10.10.11.1/255.255.255.252<br>&gt;&gt;&gt; interface = ipaddress.IPv6Interface(&#39;2001:0db8:85a3:0000:0000:8a2e:0370:7334&#39;)<br>&gt;&gt;&gt; print(interface.with_netmask)<br>2001:db8:85a3::8a2e:370:7334/ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff</pre><p><strong>with_hostmask</strong></p><pre>&gt;&gt;&gt; interface = ipaddress.IPv4Interface(&#39;10.10.11.1/30&#39;)<br>&gt;&gt;&gt; print(interface.with_hostmask)<br>10.10.11.1/0.0.0.3<br>&gt;&gt;&gt; interface = ipaddress.IPv6Interface(&#39;2001:0db8:85a3:0000:0000:8a2e:0370:7334&#39;)<br>&gt;&gt;&gt; print(interface.hostmask)<br>::</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=28eaac152350" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Huawei Wireless Access Controller Configuration Guide (ENSP)]]></title>
            <link>https://medium.com/@ahtashamahsan/huawei-wireless-access-controller-configuration-guide-ensp-84cd2451c656?source=rss-6fdddcd15b13------2</link>
            <guid isPermaLink="false">https://medium.com/p/84cd2451c656</guid>
            <category><![CDATA[capwap]]></category>
            <category><![CDATA[wireless-controllers]]></category>
            <category><![CDATA[wlan]]></category>
            <category><![CDATA[huawei-ac]]></category>
            <category><![CDATA[ensp]]></category>
            <dc:creator><![CDATA[Ahtasham Ahsan]]></dc:creator>
            <pubDate>Mon, 05 Feb 2024 13:31:49 GMT</pubDate>
            <atom:updated>2024-02-05T13:31:49.765Z</atom:updated>
            <content:encoded><![CDATA[<p>Packets transmitted on a WLAN include management packets (control packets) and data packets (service packets). Management packets are forwarded through Control and Provisioning of Wireless Access Points (CAPWAP) control tunnels. Data packets can be forwarded in tunnel, direct, or soft Generic Routing Encapsulation (GRE) mode, depending on whether they are forwarded through CAPWAP data tunnels. Tunnel mode is also called centralized mode, and direct mode is also called local mode.</p><ul><li>AC networking mode: Layer 2 networking in inline mode.</li><li>DHCP deployment mode: The AC functions as a DHCP server to assign IP addresses to APs and STAs.</li><li>Service data forwarding mode: tunnel forwarding.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/772/1*6adobAIkfoNfSjgxaEiVRw.png" /></figure><p>Mentioned below topology we are going to implement in eNSP.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*iKkiz5QT_9KqVzGvIhBBVw.jpeg" /></figure><p><strong>We have created two VLANs on access switch one is vlan 10 (SERVICE_VLAN) and other is vlan 20 (MANAGEMENT_VLAN).</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*_ApUVPmjuQvUPqei482mLg.jpeg" /></figure><p>Same Vlans are created on AC along with their SVIs. Enable DHCP on AC and configure DHCP for STAs and APs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/633/1*LdtCEnUgdKYs9p9CV-CQwQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/1*EW0GNZxgqVbAmWR9PHAnFg.jpeg" /></figure><p>Create Service SVI on router and configure the interfaces of router.</p><p>Configure AC system parameters.</p><ul><li>Create AP group</li><li>Select country Code</li><li>Assign CAPWAP source interface</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*ndfkuOkEVgaD-unx2Os9HQ.png" /></figure><p>Select AP authentication mode. Configure APs attached with network and assign appropriate name to the APs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*OAr54Jt_WIoBSYNKlSX6hw.png" /></figure><p>As above we have seen, if we select authentication through mac address then we need mac addresses of APs. In lab we can check the mac addresses of APs on switch as below mentioned.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*6k8UdJaByQ1wY3ApcQ_9LQ.png" /></figure><p>We can check the status of APs whether they joined the AC or not. As seen below it is clear that the status of APs are normal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*jAK8IjMCRs1ksZM3HX9s7g.png" /></figure><p>Now we are going to configure security profiles. We have configure two separate security profiles for both SSIDS. As we want to create two SSIDS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/845/1*HinVv1rrpkyg2GZhx26tYA.png" /></figure><p>Two separate SSID profiles are created for two SSIDS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/619/1*hEe7Z00Uzo_LGdcogGFs2w.png" /></figure><p>Create VAP (Virtual AP) profiles in accordance with the number of SSIDS required.</p><p>Configure the mentioned below fields.</p><p>· Forwarding mode.</p><p>· Service VLAN.</p><p>· Security Profile.</p><p>· SSID profile.</p><p>After this assign the VAP profiles to the required AP group.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/1*OUyVSxgWxFFhX5LXLc_xmA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/764/1*SU3UtdTd-UImqxywZp3hBQ.png" /></figure><p>We can check the status of CAPWAP link of our APs. As seen below the CAPWAP link is UP and the name of AP is changed as we configure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/894/1*v3nSZ7vGBh_NqtuZ7nxzVg.png" /></figure><p>Connect STAs with relevant SSIDs. (Passwords are configured is security profile we can change if required).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*zM9PNa2QNgtcSLBvAvghcQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*zsZwapi2JvH_iPqaKXIKqw.png" /></figure><p>As seen below STAs connected successfully and Vlan 10 IP address has been assigned to STA.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*2Tzh-fhUJqgzKofPUMzhjA.png" /></figure><p>We have checked on AC that correct IPs are assigned to APs and STAs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*bUdGmb-ZTd9F8AmvTGO43g.png" /></figure><p>Up to this step we have configured our network successful, But if we want to access AC web interface on our Laptop we need to perform some extra routing on AC and Laptop.</p><p>Add below mentioned static route on AC which is pointing towards SVI on router.</p><p>192.168.0.0 is a network configured on laptop virtual interface.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/881/1*we6apTmM_s9vnFYJdsgXEw.png" /></figure><p>Router interface connected with the laptop virtual interface.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/906/1*yFWdJ9fJXTb0qgx7BWNvjQ.png" /></figure><p>Following configurations are done on cloud.</p><p>Ethernet 4 is laptop virtual interface.</p><p>If you want to create loopback interface refer below link:</p><p><a href="https://4sysops.com/archives/how-to-install-loopback-adapter-in-windows-8/">How to install the loopback adapter in Windows 8</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*sVRb_3yusDZbFNStOECfJA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*L9VUbCYaV1XRICNpo7FF-w.png" /></figure><p>Add this persistence route on laptop which is pointing towards router interface connected with virtual interface for network 10.10.10.0.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*zFK5uE2-IeByW1_6-y9qmA.png" /></figure><p>Now we required Credential for Web access of AC. We can change the default credentials as done below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*hpdzsnbOjB1an9kG-t5DdA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*AFMR_8NDrdmW3v3RpQIgQA.png" /></figure><p>Now we can successfully login AC with web access. Same configurations of AC are also available in web interface.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*U-HeuVDc8CJ-d1sqHmGrWA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*4MterTwA0YAWHg9u3Gy_0w.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=84cd2451c656" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Use Metasploit Framework]]></title>
            <link>https://medium.com/@ahtashamahsan/how-to-use-metasploit-framework-50c443777288?source=rss-6fdddcd15b13------2</link>
            <guid isPermaLink="false">https://medium.com/p/50c443777288</guid>
            <category><![CDATA[payload]]></category>
            <category><![CDATA[armitage]]></category>
            <category><![CDATA[exploit]]></category>
            <category><![CDATA[metasploit-framework]]></category>
            <category><![CDATA[msf]]></category>
            <dc:creator><![CDATA[Ahtasham Ahsan]]></dc:creator>
            <pubDate>Mon, 05 Feb 2024 11:27:31 GMT</pubDate>
            <atom:updated>2024-02-05T11:27:31.707Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/318/1*xmckboWSiF5HjgpJHQbXkg.jpeg" /></figure><p>The <a href="https://github.com/rapid7/metasploit-framework"><strong>Metasploit Framework</strong></a> (MSF) is far more than just a collection of exploits it is also a solid foundation that you can build upon and easily customize to meet your needs. This allows you to concentrate on your unique target environment and not have to reinvent the wheel. We consider the MSF to be one of the single most useful security auditing tools freely available to security professionals today. From a wide array of commercial grade exploits and an extensive exploit development environment, all the way to network information gathering tools and web vulnerability plugins, the Metasploit Framework provides a truly impressive work environment. <strong>Armitage</strong> is the graphic user interface (GUI) for Metasploit frame work.</p><p>Before starting Metasploit frame work with command msfconsole run the command service <strong>postgresql start</strong> it makes the Metasploit to run faster as it is using the database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/370/1*WqeX1Z52OryB2HGRcaB7wg.jpeg" /></figure><p>We are going to discuss the structure of Metasploit frame work. What is msfconsole, msfvenom, nopes, exploits, encoders &amp; payloads etc.</p><ul><li><strong>msfconsole</strong>: is the primary interface to Metasploit framework and used to run msf</li><li><strong>msfvenom</strong>: This module is used to create the payloads/meterpreter shell/backdoors</li><li><strong>msfupdate</strong>: This command is used to update the Metasploit framework</li></ul><pre>kali@kali:~$ cd /usr/share/metasploit-framework/<br>kali@kali:/usr/share/metasploit-framework$ ls<br>app     db             Gemfile.lock                  modules     msfdb            msfrpcd    msf-ws.ru  ruby             script-recon  vendor<br>config  documentation  lib                           msfconsole  msf-json-rpc.ru  msfupdate  plugins    script-exploit   scripts<br>data    Gemfile        metasploit-framework.gemspec  msfd        msfrpc           msfvenom   Rakefile   script-password  tools<br>kali@kali:/usr/share/metasploit-framework$</pre><h3>modules</h3><p>All the Metasploit exploits/payloads/auxiliary<strong>/</strong>encoders etc are present in module folder. Allmost all of our interaction with Metasploit will be through it modules. All the modules are in separate directories according to their purpose. An overview of various modules is below.</p><p><strong>exploits</strong></p><p>Exploits are used to target the vulnerable machine. We can open the exploit/any module with vi/nano/cat inorder to view the code.</p><p><strong>payloads</strong></p><p>There are 3 type of payloads used to send to victim i.e backdoors.</p><ol><li><strong>singles:</strong> They are smaller program used to run just one/one time action.</li><li><strong>stagers</strong>: They can be use to deliver some another payload.</li><li><strong>stages</strong>: They are larger programs used to perform some actions after exploiting. i.e. meterpreter, which is used to perform key logging, bypass antivirus after exploiting the target.</li></ol><p><strong>auxiliary</strong></p><p>This module contain programs which are just scanners used to scan the targets. Sometime this module is also used to brute force the target.</p><p><strong>encoders</strong></p><p>Used to bypass the antivirus. They change the look of code and antivirus database cannot recognize it.</p><p><strong>post</strong></p><p>Tools/programs used after we exploit the target. For example we send the meterpreter which is a reverse shall used to send the post exploitation programs/tool used for password gathering/cookies gathering of any browser.</p><p><strong>nops</strong></p><p>known as no-operations. Used in assembly language. They are use to make the payload size consistent. The practical importance is instruction jumps</p><pre>kali@kali:/usr/share/metasploit-framework/modules$ ls<br>auxiliary  encoders  evasion  exploits  nops  payloads  post</pre><p>Let see how we can navigate through this framework.</p><p>We can search and use the relevant exploit/module as shown below.</p><p><strong>Search exploit-name: </strong>This is the command to search exploit in Metasploit<br><strong>Use exploit-name: </strong>Command to use any module<br><strong>Show options: </strong>To check the options available with this exploit</p><pre>msf6 &gt;<br>msf6 &gt; search ssh<br>Matching Modules<br>================<br>   #   Name                                                        Disclosure Date  Rank       Check  Description<br>   -   ----                                                        ---------------  ----       -----  -----------<br>   0   exploit/linux/http/alienvault_exec                          2017-01-31       excellent  Yes    AlienVault OSSIM/USM Remote Code Execution<br>   1   auxiliary/scanner/ssh/apache_karaf_command_execution        2016-02-09       normal     No     Apache Karaf Default Credentials Command Execution<br>   2   auxiliary/scanner/ssh/karaf_login                                            normal     No     Apache Karaf Login Utility<br>   3   exploit/apple_ios/ssh/cydia_default_ssh                     2007-07-02       excellent  No     Apple iOS Default SSH Password Vulnerability<br>   4   exploit/unix/ssh/arista_tacplus_shell                       2020-02-02       great      Yes    Arista restricted shell escape (with privesc)<br>   5   exploit/unix/ssh/array_vxag_vapv_privkey_privesc            2014-02-03       excellent  No     Array Networks vAPV and vxAG Private Key Privilege Escalation Code Execution<br>   6   exploit/linux/ssh/ceragon_fibeair_known_privkey             2015-04-01       excellent  No     Ceragon FibeAir IP-10 SSH Private Key Exposure<br>   7   auxiliary/scanner/ssh/cerberus_sftp_enumusers               2014-05-27       normal     No     Cerberus FTP Server SFTP Username Enumeration<br>   8   auxiliary/dos/cisco/cisco_7937g_dos                         2020-06-02       normal     No     Cisco 7937G Denial-of-Service Attack<br>   9   auxiliary/admin/http/cisco_7937g_ssh_privesc                2020-06-02       normal     No     Cisco 7937G SSH Privilege Escalation<br>   10  auxiliary/scanner/http/cisco_firepower_login                                 normal     No     Cisco Firepower Management Console 6.0 Login<br>   11  exploit/linux/ssh/cisco_ucs_scpuser                         2019-08-21       excellent  No     Cisco UCS Director default scpuser password</pre><pre>msf6 &gt; use auxiliary/scanner/ssh/ssh_version<br>msf6 auxiliary(scanner/ssh/ssh_version) &gt;<br>msf6 auxiliary(scanner/ssh/ssh_version) &gt; show options<br>Module options (auxiliary/scanner/ssh/ssh_version):<br>   Name     Current Setting  Required  Description<br>   ----     ---------------  --------  -----------<br>   RHOSTS                    yes       The target host(s), range CIDR identifier, or hosts file with syntax &#39;file:&#39;<br>   RPORT    22               yes       The target port (TCP)<br>   THREADS  1                yes       The number of concurrent threads (max one per host)<br>   TIMEOUT  30               yes       Timeout for the SSH probe<br>msf6 auxiliary(scanner/ssh/ssh_version) &gt;</pre><p><strong>Show targets: </strong>To check the available targets for this exploits.</p><pre>msf6 exploit(linux/ssh/cisco_ucs_scpuser) &gt; show targets<br>Exploit targets:<br>   Id  Name<br>   --  ----<br>   0   Cisco UCS Director &lt; 6.7.2.0<br>msf6 exploit(linux/ssh/cisco_ucs_scpuser) &gt;</pre><p><strong>Show info: </strong>To check the available info of the exploit. For detailed study about the exploit link is given in the details of info command output.</p><pre>msf6 exploit(linux/ssh/cisco_ucs_scpuser) &gt; show info<br>       Name: Cisco UCS Director default scpuser password<br>     Module: exploit/linux/ssh/cisco_ucs_scpuser<br>   Platform: Unix<br>       Arch: cmd<br> Privileged: No<br>    License: Metasploit Framework License (BSD)<br>       Rank: Excellent<br>  Disclosed: 2019-08-21<br>Provided by:<br>  Pedro Ribeiro &lt;pedrib@gmail.com&gt;Available targets:<br>  Id  Name<br>  --  ----<br>  0   Cisco UCS Director &lt; 6.7.2.0<br>Check supported:<br>  No<br>Basic options:<br>  Name      Current Setting  Required  Description<br>  ----      ---------------  --------  -----------<br>  PASSWORD  scpuser          yes       Password to login with<br>  RHOSTS                     yes       The target host(s), range CIDR identifier, or hosts file with syntax &#39;file:&#39;<br>  RPORT     22               yes       The target port<br>  USERNAME  scpuser          yes       Username to login with<br>Payload information:<br>Description:<br>  This module abuses a known default password on Cisco UCS Director.<br>  The &#39;scpuser&#39; has the password of &#39;scpuser&#39;, and allows an attacker<br>  to login to the virtual appliance via SSH. This module has been<br>  tested with Cisco UCS Director virtual machines 6.6.0 and 6.7.0.<br>  Note that Cisco also mentions in their advisory that their IMC<br>  Supervisor and UCS Director Express are also affected by these<br>  vulnerabilities, but this module was not tested with those products.</pre><p><strong>Show payloads: </strong>If you want to deliver the payload with this module. Check the available payloads for this exploit.</p><pre>msf6 exploit(linux/ssh/cisco_ucs_scpuser) &gt; show payloads<br>Compatible Payloads<br>===================<br>   #  Name                       Disclosure Date  Rank    Check  Description<br>   -  ----                       ---------------  ----    -----  -----------<br>   0  payload/cmd/unix/interact                   normal  No     Unix Command, Interact with Established Connection<br>msf6 exploit(linux/ssh/cisco_ucs_scpuser) &gt;</pre><p><strong>Set payload: </strong>Set the payload with exploit.<br><strong>Show options: </strong>Now and additional thing which is visible in show options is the payload which is set.</p><pre>msf6 exploit(linux/ssh/cisco_ucs_scpuser) &gt; set payload payload/cmd/unix/interact<br>payload =&gt; cmd/unix/interact<br>msf6 exploit(linux/ssh/cisco_ucs_scpuser) &gt;<br>msf6 exploit(linux/ssh/cisco_ucs_scpuser) &gt;<br>msf6 exploit(linux/ssh/cisco_ucs_scpuser) &gt; show options<br>Module options (exploit/linux/ssh/cisco_ucs_scpuser):<br>   Name      Current Setting  Required  Description<br>   ----      ---------------  --------  -----------<br>   PASSWORD  scpuser          yes       Password to login with<br>   RHOSTS                     yes       The target host(s), range CIDR identifier, or hosts file with syntax &#39;file:&#39;<br>   RPORT     22               yes       The target port<br>   USERNAME  scpuser          yes       Username to login with<br>Payload options (cmd/unix/interact):<br>   Name  Current Setting  Required  Description<br>   ----  ---------------  --------  -----------<br>Exploit target:<br>   Id  Name<br>   --  ----<br>   0   Cisco UCS Director &lt; 6.7.2.0<br>msf6 exploit(linux/ssh/cisco_ucs_scpuser) &gt;</pre><p>Set the local host <strong>LHOST</strong> and local port <strong>LPORT . </strong>We can set it like this.<br>Now we can run this exploit with payload against the vulnerable system.</p><pre>msf6 exploit(linux/ssh/cisco_ucs_scpuser) &gt; show targets<br>Exploit targets:<br>   Id  Name<br>   --  ----<br>   0   Cisco UCS Director &lt; 6.7.2.0<br>msf6 exploit(linux/ssh/cisco_ucs_scpuser) &gt;</pre><p><strong>help</strong>: help command will give us the available commands in Metasploit along with their descriptions. Output of help command is pasted below.</p><pre>msf6 &gt; help<br>Core Commands<br>=============<br>    Command       Description<br>    -------       -----------<br>    ?             Help menu<br>    banner        Display an awesome metasploit banner<br>    cd            Change the current working directory<br>    color         Toggle color<br>    connect       Communicate with a host<br>    debug         Display information useful for debugging<br>    exit          Exit the console<br>    features      Display the list of not yet released features that can be opted in to<br>    get           Gets the value of a context-specific variable<br>    getg          Gets the value of a global variable<br>    grep          Grep the output of another command<br>    help          Help menu<br>    history       Show command history<br>    load          Load a framework plugin<br>    quit          Exit the console<br>    repeat        Repeat a list of commands<br>    route         Route traffic through a session<br>    save          Saves the active datastores<br>    sessions      Dump session listings and display information about sessions<br>    set           Sets a context-specific variable to a value<br>    setg          Sets a global variable to a value<br>    sleep         Do nothing for the specified number of seconds<br>    spool         Write console output into a file as well the screen<br>    threads       View and manipulate background threads<br>    tips          Show a list of useful productivity tips<br>    unload        Unload a framework plugin<br>    unset         Unsets one or more context-specific variables<br>    unsetg        Unsets one or more global variables<br>    version       Show the framework and console library version numbers</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=50c443777288" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Future Of Networking: Transitioning From Bare Metal To The Cloud]]></title>
            <link>https://medium.com/@ahtashamahsan/the-future-of-networking-transitioning-from-bare-metal-to-the-cloud-df92df75e170?source=rss-6fdddcd15b13------2</link>
            <guid isPermaLink="false">https://medium.com/p/df92df75e170</guid>
            <category><![CDATA[future-of-networking]]></category>
            <category><![CDATA[dns]]></category>
            <category><![CDATA[bare-metal-networking]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[cloud]]></category>
            <dc:creator><![CDATA[Ahtasham Ahsan]]></dc:creator>
            <pubDate>Mon, 05 Feb 2024 11:16:45 GMT</pubDate>
            <atom:updated>2024-02-05T11:16:45.059Z</atom:updated>
            <content:encoded><![CDATA[<p>Networking has always been a fundamental component of the IT infrastructure, enabling communication and connectivity between systems and users. However, the landscape of networking is undergoing a significant transformation as organizations shift from traditional bare-metal setups to cloud-based networking solutions. In this article, we will explore the future of networking and the reasons behind this shift.<br><strong>The Traditional Bare Metal Networking Challenges:</strong><br>Historically, networking involved setting up and managing physical infrastructure, including switches, routers, and cables. This approach posed several challenges for organizations, such as limited scalability, high maintenance costs, complex configurations, and long lead times for provisioning and deployment. Additionally, managing and securing a vast network infrastructure required specialized skills and resources.<br><strong>The Rise of Cloud Networking:</strong><br>Cloud computing emerged as a game-changer, offering a flexible, scalable, and cost-effective alternative to bare-metal networking. With cloud networking, organizations can leverage virtualized networking components and services provided by cloud service providers (CSPs) to build their network infrastructure.<br><strong>Benefits of Cloud Networking:</strong><br><strong>Scalability</strong>: Cloud networking provides on-demand scalability, allowing organizations to rapidly adjust their network capacity based on fluctuating demands. This agility enables businesses to scale up or down seamlessly, supporting growth and ensuring optimal performance.<br><strong>Cost Efficiency:</strong> Cloud networking eliminates the need for upfront infrastructure investments and reduces ongoing operational costs. Organizations pay for the networking resources they consume on a usage-based model, avoiding overprovisioning and only paying for what they need.<br><strong>Flexibility and Agility:</strong> Cloud networking offers unprecedented flexibility, enabling organizations to provision and configure network resources programmatically using APIs. This automation facilitates rapid deployment, streamlines network management, and supports DevOps practices.<br><strong>Global Reach:</strong> Cloud service providers operate data centers in multiple regions worldwide, enabling organizations to build distributed and globally interconnected networks effortlessly. This global reach enhances connectivity, improves latency, and supports international operations.<br><strong>Security and Compliance:</strong> Cloud networking provides robust security features, including advanced firewalls, encryption, and identity and access management. Cloud providers adhere to security standards and certifications, ensuring data protection and compliance with regulatory requirements.<br><strong>Network Services and Integration:</strong> Cloud networking platforms offer a wide range of network services, such as load balancing, content delivery networks (CDNs), and distributed denial-of-service (DDoS) protection. Integration with other cloud services, such as compute and storage, simplifies the management and orchestration of complex application architectures.</p><p><strong>The Future of Networking:</strong><br>As organizations continue to embrace the cloud, the future of networking lies in a hybrid and multi-cloud approach. Hybrid networking combines on-premises infrastructure with cloud-based networks, enabling seamless connectivity and workload mobility between environments. Multi-cloud networking extends this concept, allowing organizations to leverage multiple cloud providers for different services, workloads, or geographic regions.<br>In this future landscape, software-defined networking (SDN) and network function virtualization (NFV) will play crucial roles. SDN separates the network control plane from the underlying hardware, providing centralized network management and programmability. NFV virtualizes network functions, such as firewalls, routers, and load balancers, allowing them to be deployed as software instances, further enhancing agility and flexibility.<br><strong>Conclusion:</strong><br>The transition from bare-metal networking to cloud-based networking represents a paradigm shift that brings unparalleled benefits in terms of scalability, cost efficiency, flexibility, and security. Cloud networking empowers organizations to build resilient, globally interconnected networks that adapt to changing business needs. Embracing the future of networking through cloud adoption, hybrid connectivity, and software-defined approaches will enable businesses to thrive in the dynamic and interconnected digital landscape of tomorrow.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=df92df75e170" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[INTRODUCTION TO SD-WAN]]></title>
            <link>https://medium.com/@ahtashamahsan/introduction-to-sd-wan-2e9483351d1a?source=rss-6fdddcd15b13------2</link>
            <guid isPermaLink="false">https://medium.com/p/2e9483351d1a</guid>
            <category><![CDATA[wan]]></category>
            <category><![CDATA[sd-wan]]></category>
            <category><![CDATA[wide-area-network]]></category>
            <dc:creator><![CDATA[Ahtasham Ahsan]]></dc:creator>
            <pubDate>Mon, 05 Feb 2024 11:12:26 GMT</pubDate>
            <atom:updated>2024-02-05T11:12:26.503Z</atom:updated>
            <content:encoded><![CDATA[<h4><strong>Definition of SD WAN</strong></h4><p>SD WAN stands for Software Defined Wide Area Network. The term software means WAN is programmatically configured and managed. WANs are used to connect LANs of remote locations. Wide area network (WAN) is provided by service provider. Without Wide Area Networks, LANs are isolated networks. WAN technologies are divided into two categories;</p><ul><li><strong>Public WANs</strong></li><li><strong>Private</strong> <strong>WANs</strong>.</li></ul><p>Private WANs provides security and confidentiality but are expensive whereas Public WAN are less expensive. WAN technologies are shown in figure below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/725/1*YeGC2rF4pNub9pxCDTBvhg.jpeg" /></figure><p>SD-WAN with Application Aware Routing can measure and monitor the performance of multiple services in a hybrid network. It uses application routing to offer more granular control of where and when an application uses a specific service, allowing better use of the overall network. SD-WAN provides dynamic application-aware capabilities, which enables different types of traffic to be intelligently directed across the WAN based on the needs of each application.</p><p>SD-WAN optimize MPLS WAN solutions (high priority traffic) with public internet (lower priority traffic) or in some cases public internet fully replacing MPLS WAN links enabling more efficient use of available bandwidth.</p><p>The creation of a SD WAN means you can utilize different types of internet connection and even different providers, using what is available in any given location.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1017/1*1wbUxprJCTrMOjGM2_A2UA.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2e9483351d1a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Perimeter Security Vs. Zero Trust: A Comparative Analysis Of Network Security Approaches]]></title>
            <link>https://medium.com/@ahtashamahsan/perimeter-security-vs-zero-trust-a-comparative-analysis-of-network-security-approaches-bad5002ea23e?source=rss-6fdddcd15b13------2</link>
            <guid isPermaLink="false">https://medium.com/p/bad5002ea23e</guid>
            <category><![CDATA[ztna]]></category>
            <category><![CDATA[network-security]]></category>
            <category><![CDATA[zero-trust]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[perimeter-security]]></category>
            <dc:creator><![CDATA[Ahtasham Ahsan]]></dc:creator>
            <pubDate>Mon, 05 Feb 2024 11:03:23 GMT</pubDate>
            <atom:updated>2024-02-05T11:03:23.845Z</atom:updated>
            <content:encoded><![CDATA[<p>In the realm of cybersecurity, organizations employ various strategies to safeguard their computer networks and data. Two prominent approaches, perimeter security and zero trust, aim to protect network resources by different means. This article provides a comprehensive explanation of these two methods.</p><p><strong>Perimeter Security:</strong> Perimeter security represents a traditional network security approach centered around establishing a robust boundary around the network. The core concept is to create a secure perimeter using tools like firewalls and network security devices to shield the internal network from external threats. By implementing these security measures, the perimeter acts as a filter, allowing authorized communication while blocking unauthorized access attempts. This approach assumes that once a user or device gains entry into the network perimeter, they can be trusted.</p><p>Advantages of perimeter security include its simplicity and ease of implementation. It provides a clear boundary and separation between the trusted internal network and the untrusted external network. However, the evolution of cloud computing, remote work, and mobile devices has rendered the traditional network perimeter more porous and challenging to define. Additionally, once a threat successfully breaches the perimeter defenses, it can move freely within the internal network, potentially causing substantial damage.</p><p><strong>Zero Trust:</strong> Zero trust represents a modern security framework and mindset that challenges the notion of inherent trust within the network. It operates on the principle that no user or device should be automatically trusted, regardless of their location inside or outside the network perimeter. In the zero trust model, each user, device, and network resource is treated as potentially untrusted, and access to resources is granted based on stringent authentication, authorization, and continuous verification.</p><p>Zero trust focuses on thoroughly validating and verifying the identity and security posture of every user and device seeking network resource access. It utilizes techniques like multi-factor authentication, network segmentation, micro-segmentation, encryption, and continuous monitoring to ensure that only authorized entities can access specific resources. Even after access is granted, zero trust maintains constant monitoring and evaluation of user and device behavior to detect and respond to anomalies or security threats effectively.</p><p>The advantages of zero trust include an enhanced security posture, particularly in modern network environments where users and devices are no longer confined within a well-defined perimeter. It mitigates the risk of lateral movement within the network, limits the impact of potential breaches, and provides granular control over resource access. However, implementing zero trust requires advanced technologies, robust identity and access management systems, and a comprehensive understanding of the network environment.</p><p><strong>Conclusion:</strong> In conclusion, perimeter security and zero trust are two distinct approaches to network security. Perimeter security focuses on securing the network perimeter and assumes trust once users or devices are inside. On the other hand, zero trust challenges the notion of trust and employs strict authentication, authorization, and continuous monitoring for all users and devices, regardless of their location. Both approaches have their merits and considerations, but zero trust offers a more dynamic and granular security approach suitable for modern network environments. Organizations must carefully evaluate their specific needs and network landscape to determine the most effective security strategy.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bad5002ea23e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>