<?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>DEV Community: Mario Mejia</title>
    <description>The latest articles on DEV Community by Mario Mejia (@jmariomejiap).</description>
    <link>https://dev.to/jmariomejiap</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%2F588551%2F3879bd62-ed9a-4db5-ba6b-bd691d65b623.jpeg</url>
      <title>DEV Community: Mario Mejia</title>
      <link>https://dev.to/jmariomejiap</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jmariomejiap"/>
    <language>en</language>
    <item>
      <title>Use Nmap for faster discovery in Cloud Migrations</title>
      <dc:creator>Mario Mejia</dc:creator>
      <pubDate>Thu, 25 Mar 2021 21:41:37 +0000</pubDate>
      <link>https://dev.to/tidalcloud/use-nmap-for-faster-discovery-in-cloud-migrations-5857</link>
      <guid>https://dev.to/tidalcloud/use-nmap-for-faster-discovery-in-cloud-migrations-5857</guid>
      <description>&lt;p&gt;When starting a cloud migration project, one of the most important and often challenging parts is to have an accurate understanding of what you are trying to migrate. Over time, companies start new projects, which means creating new infrastructure, adding servers, databases, etc. This is a normal part of the development cycle. However, despite best efforts, inventories get out of sync. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;“We have 5 inventories and lists of servers, but we don’t trust any of them.”&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Imagine this simple scenario where a database needs to be migrated from location A to location B. After it is done, the old database in location A must be decommissioned and the infrastructure inventory must be updated. It is not uncommon, that after the migration is finished, the inventory - a CMDB, ops tool or often: an excel file - is adjusted to add the new server and database instance, but no one ever removes the old database from the source inventory. &lt;/p&gt;

&lt;p&gt;Now imagine that type of change occurring many times over the years and it doesn’t take long to realize why people don’t trust their inventory.  Inventory is increasingly becoming ephemeral.&lt;/p&gt;

&lt;h3&gt;
  
  
  Solution
&lt;/h3&gt;

&lt;p&gt;At Tidal Migrations, we empower companies to drive faster cloud migrations with rapid discovery and assessment of their application portfolio. In addition to our own tools, people can use 3rd party tools that they might already have installed via Tidal Migrations API integrations. Today, people can also leverage the widely used &lt;a href="https://nmap.org/" rel="noopener noreferrer"&gt;Nmap&lt;/a&gt; utility to perform exhaustive host discovery and reconcile their infrastructure inventory.&lt;/p&gt;

&lt;p&gt;What is &lt;strong&gt;Nmap&lt;/strong&gt;? &lt;br&gt;
Nmap is a free and open-source network scanner used by security researchers, network administrators, and migration experts alike. It can be used to discover services running on single hosts, as well as vast networks that contain hundreds of thousands of devices across a multitude of subnets.&lt;/p&gt;

&lt;p&gt;Nmap scans a network by sending packets to system network ports, then it analyzes their responses to figure out what ports are open, closed, or filtered by a firewall.  As a result, Nmap can identify devices and services running on a network without you needing to deploy agents or request permissions to servers via SSH or WinRM, etc. &lt;/p&gt;

&lt;p&gt;In addition to infrastructure reconciliation, scanning your network with Nmap can alert you to known security vulnerabilities. For example, it might identify older software that can be exploited by bad actors, as well as providing you with an opportunity to close open ports that shouldn’t be accessible in the first place. &lt;/p&gt;

&lt;p&gt;At Tidal Migrations, we have built capabilities to leverage the output generated by Nmap and send it to our Platform where our users can assess their data, update their inventory, and facilitate their cloud migration journey.&lt;/p&gt;


  &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F47mdr9qacwid2kqzfwzm.png" alt="Host Disovery view"&gt;Nmap integrates directly with Tidal Migrations to help you on getting an accurate inventory for your cloud migration project.
  

&lt;h3&gt;
  
  
  How to Use Nmap
&lt;/h3&gt;

&lt;p&gt;You can find the official binary packages for all major operating systems (Linux, Windows, Mac OS) at &lt;a href="https://nmap.org/" rel="noopener noreferrer"&gt;Nmap’s website&lt;/a&gt;, and while there is a &lt;a href="https://nmap.org/zenmap/" rel="noopener noreferrer"&gt;GUI option&lt;/a&gt; to download, here we will cover how to use the CLI version together with Tidal Migrations.&lt;/p&gt;

&lt;p&gt;Nmap offers a wide range of scanning utilities, such as port scanning, host discovery, service version detection to name a few. The &lt;a href="https://nmap.org/docs.html" rel="noopener noreferrer"&gt;documentation&lt;/a&gt; is very extensive and easy to follow.&lt;/p&gt;

&lt;p&gt;Once Nmap has been installed, you can run &lt;em&gt;nmap -h&lt;/em&gt; at the command prompt at any time. It will display your current version, as well as a breakdown of its commands.&lt;/p&gt;

&lt;p&gt;Its command structure is as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nmap &lt;span class="o"&gt;[&lt;/span&gt; &amp;lt;Scan Type&amp;gt; ...] &lt;span class="o"&gt;[&lt;/span&gt; &amp;lt;Options&amp;gt; &lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt; &amp;lt;target specification&amp;gt; &lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Nmap has sensible defaults, so the most basic command will yield results right away. Simply provide a target, single IP, hostname or a range of IPs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nmap 192.168.1.1-254 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A common scan type is Host Discovery via ICMP Echo (aka “ping”).  To do this, you can use &lt;code&gt;-sn&lt;/code&gt; to disable port scanning:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nmap &lt;span class="nt"&gt;-sn&lt;/span&gt; 192.168.1.0/24              &lt;span class="c"&gt;# Ping sweep a subnet&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And if you’re curious about how your range expressions are evaluated, you can use &lt;code&gt;-sL&lt;/code&gt; to list targets only, without scanning them at all:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nmap &lt;span class="nt"&gt;-sL&lt;/span&gt; 192.168.1.1-3,10-20         &lt;span class="c"&gt;# No Scan. List targets only &lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To say there are a lot of scan types you can run using Nmap is an understatement. In addition to the built-in flags, there is also an entire ecosystem of extensions and plugins that scanning experts employ in those hard to scan environments. To keep this blog from becoming War and Peace, I will share &lt;strong&gt;two&lt;/strong&gt; of my favorite commands to get you started right away.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nmap &lt;span class="nt"&gt;-T2&lt;/span&gt; 192.168.1.0-127
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;-T&lt;/strong&gt;  - Timing mode.  Adjusting the frequency of packets being sent can be used to evade or comply with some of the rules in firewalls or IDS. &lt;br&gt;
When running Nmap in timing mode, you must use either "Paranoid", "Sneaky", "Polite", "Normal", "Aggressive", "Insane" or a number from 0 (Paranoid) being the slowest, waiting 5 minutes between sending each probe to 5 (Insane) which will be easily detectable.&lt;/p&gt;

&lt;p&gt;To more efficiently scan your network, limit yourself to the known ports for common web applications and databases. Also, save your output as XML so you can incorporate the results into your migration planning.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nmap &lt;span class="nt"&gt;-sS&lt;/span&gt; &lt;span class="nt"&gt;-p80&lt;/span&gt;,443,8080,8443,1433,1521,27017 10.0.0.0/24 &lt;span class="nt"&gt;-oX&lt;/span&gt; my_network_scan.xml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;-sS&lt;/strong&gt; - enables TCP SYN Stealth port scan.&lt;br&gt;
&lt;strong&gt;-p&lt;/strong&gt; - lets you specify the ports you are interested in, therefore improving your scan speed.&lt;br&gt;
&lt;strong&gt;-oX&lt;/strong&gt; - generates an XML file with the output of the scan.&lt;/p&gt;

&lt;p&gt;It is possible to combine a Nmap command and our Tidal Migration integration in just one step.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnyd4dncs3vsgpghz7l0i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnyd4dncs3vsgpghz7l0i.png" alt="Nmap - Tidal Migrations"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let’s break this example into two parts. &lt;br&gt;
To start, Nmap is going to scan an IP Address and its range, the &lt;code&gt;-sV&lt;/code&gt; flag indicates Service and Version detection on open ports, and &lt;code&gt;-oX&lt;/code&gt; declares that we want the output in  XML format.&lt;br&gt;
After the scan is completed, our CLI &lt;a href="https://tidalmigrations.com/tidal-tools/" rel="noopener noreferrer"&gt;Tidal Tools&lt;/a&gt; will pick up the output and send it to your Tidal Migrations account where you can continue your discovery process.&lt;/p&gt;

&lt;h3&gt;
  
  
  Summary
&lt;/h3&gt;

&lt;p&gt;Whether you are migrating to the cloud today or just preparing your infrastructure for a future shift. Having a solid understanding of your current inventory and infrastructure is a must.&lt;/p&gt;

&lt;p&gt;After this brief introduction to Nmap, its capabilities, and how to use it, I hope you feel encouraged to use this tool in your cloud migration journey. There is plenty of information on its official website, and a strong community backing it up. &lt;/p&gt;

&lt;p&gt;Happy discovery :)&lt;/p&gt;

&lt;p&gt;-&lt;em&gt;&lt;a href="https://www.linkedin.com/in/mario-mejia" rel="noopener noreferrer"&gt;Mario Mejia&lt;/a&gt;&lt;/em&gt;&lt;br&gt;
Senior Software Engineer, Tidal Migrations&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Want to know more about Tidal Migrations?&lt;/em&gt;&lt;br&gt;
&lt;em&gt;&lt;a href="https://tidalmigrations.com/tour/" rel="noopener noreferrer"&gt;Tidal Migrations&lt;/a&gt; is a cloud migration tool that gives you this application inventory, discovery, and assessment all in one place. Delivered as a SaaS platform, you can import your spreadsheets or deploy our tools and get moving today. Results in minutes, not months. Migrate with confidence.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>nmap</category>
      <category>cloudmigration</category>
      <category>cloud</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
