02 [Cybersecurity hands-on](https://logicpacks.io/learn/cyber) · Lesson 2 of 10 · lab

# Networking basics and nmap against the lab

IP addresses, ports and services, then map your practice targets with nmap.

Roman Urdu: IP, ports aur services samjho, phir nmap se apne practice targets ka naqsha banao.

## Video transcript

You cannot defend, or test, what you have not found. So every real assessment starts with recon: mapping what is there.

Every machine on a network has an address. Think of it as a building. Ports are its numbered doors. Behind an open door, a service is listening: a web server, a remote login, a database.

A port scanner, like nmap, knocks on each door and notes the answer. Open: a service answered. Closed: nothing is there. Filtered: a firewall dropped the knock.

Recon goes in two steps. First, find the practice hosts, and check that each one answers. Then pick one, and list its open ports, and which service and version sits behind each. Old versions are where known bugs live.

One rule before anything else. Scanning is knocking on someone's doors. Only scan systems you own, or have written permission to test. The practice lab is yours to scan.

So: find it first, then test it. In the lab, you find the three practice hosts, then list the open ports and services on the target.

[Video file (MP4, 1 min 15 s, 2.9 MB)](https://logicpacks.io/learn/media/cyber/networking-and-nmap/lesson.mp4) · [Captions (WebVTT)](https://logicpacks.io/learn/media/cyber/networking-and-nmap/lesson.vtt)

Rules: Only test systems you own or have written permission to test. Everything in this track runs against practice targets inside your own machine. Scanning or attacking anyone else’s system without permission is a crime in most countries.

## Goal

Find the three practice hosts and list the open ports and services on target.lab.

## Why it matters

You cannot defend or test what you have not found. Recon is the first step of every real assessment.

## Your machine · learn-cyber · lab cyber-02

First time: make your course machine from any terminal (Mac, Linux and Windows 10+ all have ssh). Your ssh key is your login; a new key picks a handle and accepts the terms first.

```sh
ssh -t -p 2200 m.logicpacks.io new cyber --name learn-cyber
```

After that, come back to the same machine any time. Your files are still there:

```sh
ssh -t -p 2200 learn-cyber@m.logicpacks.io
```

To use the terminal in this page, sign this browser in once: run this and open the link it prints.

```sh
ssh -p 2200 m.logicpacks.io web
```

All your machines in the browser: [logicpacks.io/m](https://logicpacks.io/m). A guest key gets one machine: if you already use it for something else, `rm` that one or link a free account (3 machines). How machines work, credits and terms: [logicpacks.io/machines](https://logicpacks.io/machines)

## Step by step

1.  Start the practice targets (about 20 seconds; Juice Shop is the slowest).
    
    ```sh
    lab start
    ```
    
    ```sh
    lab status
    ```
    
    Diagram: a scanner knocks on the ports of a host and gets one of three answers. Open: a service answered. Closed: nothing is there. Filtered: a firewall dropped the knock.
    
    A port scan is knocking on doors: each port answers open, closed or filtered. Only scan what you own or are allowed to test.
    
2.  The targets live inside your machine on their own addresses (127.66.0.10-12), so nothing you scan leaves it. See how the names resolve.
    
    ```sh
    getent hosts target.lab dvwa.lab juice.lab
    ```
    
3.  Find which of them are up (a ping sweep, no port scan).
    
    ```sh
    nmap -sn 127.66.0.10-12
    ```
    
4.  Scan the 1,000 most common ports on the target. (`nmap -p- ${T}` checks all 65,535; it takes about a minute and a half on a small machine.)
    
    ```sh
    nmap target.lab
    ```
    
5.  Ask each open port what is running and which version, and save it. Lesson 8 uses it.
    
    ```sh
    mkdir -p ~/scans && nmap -sV -p 22,80,3000,3306 target.lab -oN ~/scans/target.txt
    ```
    

## Check my work

Run this in your machine. It checks your work and prints PASS, or FAIL with a hint about what is missing.

```sh
lab check cyber-02
```

[Previous : Linux and your own machine](https://logicpacks.io/learn/cyber/linux-and-your-machine) [Next : Web app basics and an intercepting proxy](https://logicpacks.io/learn/cyber/web-basics-and-proxy)

---

Canonical URL: https://logicpacks.io/learn/cyber/networking-and-nmap

Developed by TechRealm (techrealm.online), the software team. Operated by Al Jash Trading (Establishment), Abu Dhabi, since 1994, the legal entity that hosts and is responsible for the service. Economic licence CN-1030597, Abu Dhabi Registration Authority. Address: Office 5, Bani Yas West 4, Bani Yas, Abu Dhabi, UAE. Website: https://aljashtrading.com. Contact: hello@logicpacks.io, security@logicpacks.io, WhatsApp +1 713 632 2262 (https://wa.me/17136322262).

Machine-readable index: [/llms.txt](https://logicpacks.io/llms.txt). Plain facts: [/about.md](https://logicpacks.io/about.md). Safety: [/safety.md](https://logicpacks.io/safety.md).
