{"id":36,"date":"2021-02-25T16:26:55","date_gmt":"2021-02-25T16:26:55","guid":{"rendered":"https:\/\/cas.cybercop-training.ch\/?page_id=36"},"modified":"2021-05-31T14:22:28","modified_gmt":"2021-05-31T14:22:28","slug":"scanning-with-nmap","status":"publish","type":"page","link":"https:\/\/cas.cybercop-training.ch\/index.php\/scanning-with-nmap\/","title":{"rendered":"Scanning with nmap"},"content":{"rendered":"<h2>1. Task Decription<\/h2>\n<blockquote>\n<p>Nmap (Network Mapper) is a free and open-source network scanner which is used to discover hosts and<br \/>\nservices on a computer network by sending packets and analyzing the responses.<br \/>\nNmap provides a number of features for probing computer networks, including host discovery and service and<br \/>\noperating system detection. These features are extensible by scripts that provide more advanced options.<\/p>\n<\/blockquote>\n<p>After you did some practice exercises with nmap, please answer the following questions:<\/p>\n<ol>\n<li>which host(s) are vulnerable for the EternalBlue vulnerability?<\/li>\n<li>what is the nmap command for a full tcp scan?<\/li>\n<li>what is the nmap command for a syn scan?<\/li>\n<li>what is the nmap command for a half-open scan?<\/li>\n<li>how do you find out the OS version of your targets?<\/li>\n<li>explain the idea\/purpose of the nmap scripting engine?<\/li>\n<li>list every nmap script you could use in your nmap scan?<\/li>\n<li>during the running nmap scan; how can you access the nmap stats (of a<br \/>\nrunning scan)?<\/li>\n<\/ol>\n<h2>2. Answers and Solution<\/h2>\n<ol>\n<li><code>nmap -n -Pn -p 445 --script smb-vuln-ms17-010 -iL targets.txt -oA nmap_script_eternalblue<\/code><\/li>\n<\/ol>\n<p><img decoding=\"async\" src=\"https:\/\/cas.cybercop-training.ch\/wp-content\/uploads\/2021\/02\/nmap_1.png\" alt=\"\" \/><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cas.cybercop-training.ch\/wp-content\/uploads\/2021\/02\/nmap_2.png\" alt=\"\" \/><\/p>\n<p>The vulnerable host is <code>152.96.6.249<\/code><\/p>\n<ol start=\"2\">\n<li>\n<p>A full tcp scan can be done with the following command: (also known as TCP connect scan)<\/p>\n<blockquote>\n<p><code>nmap -sT -iL targets.txt<\/code><\/p>\n<\/blockquote>\n<\/li>\n<li>\n<p>A syn scan can be done with the following command:<\/p>\n<\/li>\n<\/ol>\n<blockquote>\n<p><code>nmap -sS -iL targets.txt<\/code><\/p>\n<\/blockquote>\n<ol start=\"4\">\n<li>It&#8217;s the syn scan and it can be done with the command above.<\/li>\n<\/ol>\n<blockquote>\n<p>A TCP Half Open Scan determines if a port is open by performing the first half of a three-way<br \/>\nhandshake. It is also referred as the SYN scanning. In SYN scanning, the hostile client or<br \/>\nattacker attempts to set up a TCP\/IP connection with a server at every possible port. This is<br \/>\ndone by sending a SYN (synchronization) packet, as if to initiate a three-way handshake, to<br \/>\nevery port on the server.<\/p>\n<\/blockquote>\n<ol start=\"5\">\n<li>OS Detection can be done with the following command:<br \/>\n<blockquote>\n<p><code>nmap -O -iL targets.txt<\/code><\/p>\n<\/blockquote>\n<\/li>\n<\/ol>\n<p>The command line switch -A detect OS and services.<\/p>\n<ol start=\"6\">\n<li>\n<p>The idea behind the nmap scripting engine is to expand the functionality of nmap as a good security<br \/>\nscanner. The scripts are able to perform a wide range of security related testing and discovery<br \/>\nfunctions.<\/p>\n<\/li>\n<li>\n<p>To locate the nse scripts I use the following command in terminal:<\/p>\n<blockquote>\n<p>locate nse | grep script<\/p>\n<\/blockquote>\n<\/li>\n<\/ol>\n<p>This give me about 600 scripts back. (I did count that with cyberchef)<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cas.cybercop-training.ch\/wp-content\/uploads\/2021\/02\/nmap_3.png\" alt=\"\" \/><\/p>\n<ol start=\"8\">\n<li>It&#8217;s by entering the return key<\/li>\n<\/ol>\n<p><img decoding=\"async\" src=\"https:\/\/cas.cybercop-training.ch\/wp-content\/uploads\/2021\/02\/nmap_4.png\" alt=\"\" \/><\/p>\n<h2>3. Further Learnings<\/h2>\n<p>I didn&#8217;t know awk before. Really cool \ud83d\ude42<\/p>\n<p><a href=\"https:\/\/www.geeksforgeeks.org\/awk-command-unixlinux-examples\/\">https:\/\/www.geeksforgeeks.org\/awk-command-unixlinux-examples\/<\/a><\/p>\n<p>PDF Report<br \/>\n<a href=\"https:\/\/cas.cybercop-training.ch\/wp-content\/uploads\/2021\/02\/nmap_scanning1.pdf\" class=\"mtli_attachment mtli_pdf\" title=\"nmap_scanning#1\">nmap_scanning#1<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. Task Decription Nmap (Network Mapper) is a free and open-source network scanner which is used to discover hosts and services on a computer network by sending packets and analyzing the responses. Nmap provides a number of features for probing computer networks, including host discovery and service and operating system detection. These features are extensible [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-36","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/cas.cybercop-training.ch\/index.php\/wp-json\/wp\/v2\/pages\/36","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cas.cybercop-training.ch\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/cas.cybercop-training.ch\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/cas.cybercop-training.ch\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cas.cybercop-training.ch\/index.php\/wp-json\/wp\/v2\/comments?post=36"}],"version-history":[{"count":6,"href":"https:\/\/cas.cybercop-training.ch\/index.php\/wp-json\/wp\/v2\/pages\/36\/revisions"}],"predecessor-version":[{"id":1342,"href":"https:\/\/cas.cybercop-training.ch\/index.php\/wp-json\/wp\/v2\/pages\/36\/revisions\/1342"}],"wp:attachment":[{"href":"https:\/\/cas.cybercop-training.ch\/index.php\/wp-json\/wp\/v2\/media?parent=36"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}