Bird
Raised Fist0
Cybersecurityknowledge~10 mins

Scanning and enumeration in Cybersecurity - Interactive Code Practice

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to identify the tool used for scanning open ports.

Cybersecurity
The command 'nmap [1] 192.168.1.1' is used to scan open ports on a target.
Drag options to blanks, or click blank then click option'
A-p
B-sS
C-v
D-o
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-p' which specifies ports but does not perform the scan type.
Using '-v' which increases verbosity but does not scan.
Using '-o' which is for output options.
2fill in blank
medium

Complete the sentence to describe enumeration.

Cybersecurity
Enumeration is the process of [1] information about a target system after scanning.
Drag options to blanks, or click blank then click option'
Agathering detailed
Bignoring
Cdeleting
Dhiding
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing 'ignoring' which is the opposite of enumeration.
Choosing 'hiding' or 'deleting' which are unrelated actions.
3fill in blank
hard

Fix the error in the command to perform a UDP scan.

Cybersecurity
nmap [1] 192.168.1.1
Drag options to blanks, or click blank then click option'
A-sS
B-sN
C-sU
D-sT
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-sS' which is for TCP SYN scans.
Using '-sT' which is a TCP connect scan.
Using '-sN' which is a TCP null scan.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps services to their port numbers if the port is less than 1024.

Cybersecurity
services = { [1]: [2] for [1], [2] in service_list if [2] < 1024 }
Drag options to blanks, or click blank then click option'
Aservice
Bport
Cservice_list
Dport_number
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'service_list' as a key or value which is a list, not a single item.
Using 'port_number' which is not defined in the loop.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps uppercase usernames to their IPs if the IP is not empty.

Cybersecurity
user_ips = { [1]: [2] for [3], [2] in user_data.items() if [2] != '' }
Drag options to blanks, or click blank then click option'
Ausername.upper()
Bip
Cusername
Duser_data
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'user_data' as a loop variable instead of the dictionary.
Not converting username to uppercase for the key.
Using the wrong variable names in the loop.

Practice

(1/5)
1. What is the main purpose of scanning in cybersecurity?
easy
A. To find active devices and open ports on a network
B. To collect detailed user account information
C. To encrypt data during transmission
D. To block unauthorized access automatically

Solution

  1. Step 1: Understand scanning basics

    Scanning is used to detect which devices are active and which ports are open on a network.
  2. Step 2: Differentiate from enumeration

    Enumeration goes deeper to gather detailed info, but scanning is about discovery.
  3. Final Answer:

    To find active devices and open ports on a network -> Option A
  4. Quick Check:

    Scanning = Finding devices and ports [OK]
Hint: Scanning finds devices and ports first, enumeration follows [OK]
Common Mistakes:
  • Confusing scanning with enumeration
  • Thinking scanning encrypts data
  • Assuming scanning blocks access
2. Which of the following is the correct syntax to run a basic port scan using the Nmap tool?
easy
A. nmap scan 192.168.1.1 -open
B. nmap -sS 192.168.1.1
C. scan -nmap 192.168.1.1
D. nmap --list-ports 192.168.1.1

Solution

  1. Step 1: Identify correct Nmap command format

    The correct Nmap syntax for a TCP SYN scan is nmap -sS [target].
  2. Step 2: Check options for errors

    Options like 'scan' or '--list-ports' are incorrect or invalid in this context.
  3. Final Answer:

    nmap -sS 192.168.1.1 -> Option B
  4. Quick Check:

    Nmap SYN scan = nmap -sS [IP] [OK]
Hint: Nmap SYN scan uses -sS flag before target IP [OK]
Common Mistakes:
  • Using invalid flags like --list-ports
  • Placing options after IP incorrectly
  • Confusing scan command syntax
3. Consider this Nmap output snippet:
PORT     STATE SERVICE
22/tcp   open  ssh
80/tcp   open  http
443/tcp  closed https

What does this output tell you about port 443?
medium
A. Port 443 is closed and not accepting connections
B. Port 443 is filtered by a firewall
C. Port 443 is open and accepting connections
D. Port 443 is in an unknown state

Solution

  1. Step 1: Read port state from output

    The output shows port 443/tcp as 'closed', meaning it is not open for connections.
  2. Step 2: Understand port states

    'Closed' means the port is reachable but no service is listening; 'filtered' would mean blocked by firewall.
  3. Final Answer:

    Port 443 is closed and not accepting connections -> Option A
  4. Quick Check:

    Port 443 state = closed means no connection [OK]
Hint: Closed port means reachable but no service listening [OK]
Common Mistakes:
  • Confusing closed with filtered
  • Assuming closed means open
  • Ignoring port state labels
4. You run an enumeration command but get no detailed user info. Which of these is the most likely cause?
medium
A. The target device is offline
B. The network cable is unplugged
C. You used scanning instead of enumeration
D. The enumeration tool lacks proper permissions

Solution

  1. Step 1: Analyze why enumeration fails

    Enumeration requires permissions to access detailed info; without them, it returns nothing.
  2. Step 2: Eliminate other options

    If the device was offline or cable unplugged, scanning would fail too; scanning vs enumeration is about info depth, not success.
  3. Final Answer:

    The enumeration tool lacks proper permissions -> Option D
  4. Quick Check:

    Permissions needed for enumeration details [OK]
Hint: No info? Check permissions for enumeration tool [OK]
Common Mistakes:
  • Confusing scanning failure with enumeration failure
  • Ignoring permission requirements
  • Assuming device offline without checking
5. You want to create a report listing all active devices and their open ports on a network, then gather usernames from those devices. Which sequence of actions is best?
hard
A. Run enumeration first, then scanning
B. Only run enumeration since it finds devices and usernames
C. Run scanning to find devices and ports, then enumeration for usernames
D. Only run scanning since it finds all info needed

Solution

  1. Step 1: Understand scanning and enumeration roles

    Scanning finds active devices and open ports; enumeration collects detailed info like usernames.
  2. Step 2: Determine correct order

    You must scan first to identify targets, then enumerate those targets for detailed info.
  3. Final Answer:

    Run scanning to find devices and ports, then enumeration for usernames -> Option C
  4. Quick Check:

    Scan first, then enumerate details [OK]
Hint: Scan to find devices, enumerate for details next [OK]
Common Mistakes:
  • Reversing scanning and enumeration order
  • Assuming scanning finds usernames
  • Skipping scanning step