nerdexam
EC-Council

412-79V10 · Question #63

What is the objective of the following bash script? 1 #!/bin/bash 2 !put clear 3 !put host identification 4 echo "Please enter the scan range." 5 echo "Here you are going to perform an Nmap scan for…

The correct answer is A. It gives a list of IP addresses that have an FTP port open. See the full explanation below for the reasoning.

Question

What is the objective of the following bash script? 1 #!/bin/bash 2 !put clear 3 !put host identification 4 echo "Please enter the scan range." 5 echo "Here you are going to perform an Nmap scan for identification for live hosts with FTP port open." 6 read ip_range 7 nmap -p 21 $ip_range -oG out.txt 8 cat out.txt | cut -d":" -f2 > f1 9 cat out.txt | cut -d" " -f2 > open.txt 10 nmap -p 21 $ip_range 11 nmap -p 21 <get open.txt -oG final.txt 12 cat final.txt | cut -d":" -f2 > f2 13 echo " " 14 echo "Nmap has performed a scan to identify the hosts which have FTP port open on them. They are:" 15 cat fip.txt | cut -d" " -f2 16 echo

Options

  • AIt gives a list of IP addresses that have an FTP port open
  • BIt checks if a given host has the ftp port open
  • CIt checks if a target host has the FTP port open and quits
  • DIt checks if an FTP port on a target machine is vulnerable to attacks

How the community answered

(27 responses)
  • A
    74% (20)
  • B
    7% (2)
  • C
    15% (4)
  • D
    4% (1)

Community Discussion

No community discussion yet for this question.

Full 412-79V10 Practice