SNHU - Closing Ports and Unnecessary
Services
Introduction
Objective
CompTIA Network + Domain:
Domain 3: Network Security
CompTIA Network + Objective:
Objective 3.1: Compare and contrast common network vulnerabilities and threats
Overview
In this lab, you will secure the pfSense Firewall by removing insecure and unneeded
protocols.
firewall
A firewall can block traffic or redirect traffic to hosts on the internal network.
pfSense is an open source firewall that uses a BSD-based firewall.
SSH
Secure shell uses port 22 and encrypts traffic, which typically provides a
terminal interface.
nmap
an open source and free scanner that allows you to determine open ports on a
remote host
zenmap
a GUI port scanner that is a front end for the free and open source Nmap
scanner
ping
an operating system utility that allows you to test for TCP/IP connectivity
between hosts
Scanning for Open Ports
Key
Term
Description
Click on the Internal Kali 2 Linux icon on the topology.
1
After the machine boots up, type
root
for the Username. Then click the Next button.
2
Note: If the Kali 2 machine is displaying the time instead of the log on screen, press
Enter.
For the Password, type
toor
(root spelled backwards) and click the Sign In button.
3
root@kali2:~#
nmap -sT 192.168.12.11
Click the black and white icon (second from the top) to launch the Linux terminal.
4
Type the following nmap command to scan the Windows Server for open ports. Then
press Enter.
5
root@kali2:~#
zenmap
Type the following command and press Enter to start Zenmap.
6
Type
192.168.12.11
in the Target box and then click Scan.
7
Note: The Zenmap scan will take up to 5 minutes to complete and will then display
the words Nmap done.
Click on the Ports / Hosts tab. Review the open ports along with each Protocol,
Service and Version detail.
8
Select Scan from the Zenmap's menu bar and then select Quit to close Zenmap.
9
For Unsaved changes, click on Close anyway.
10
root@kali2:~#
exit
Connecting to the Open Ports and Services Using Telnet and
FTP
To leave the terminal session, type
exit
. Then press Enter.
11
Click the black and white icon (second from the top) to relaunch the Linux terminal.
1
The first port open was 7. Type the following command and press Enter to connect
to port 7.
2
root@kali2:~#
telnet 192.168.12.11 7
Type
hello world
, then press Enter.
Use the Escape Character by simultaneously pressing both the "Control" and "5" (Control-
5) keys. Then press Enter.
At the telnet prompt, type
quit
, and then press Enter.
telnet>
quit
root@kali2:~#
telnet 192.168.12.11 9
Again press both the Control-5 keys, then press Enter.
At the telnet prompt, type
quit
, and then press Enter.
telnet>
quit
Note: When using the Escape character command (Control-5).
The next port open was 9. Type the following command and press Enter to connect
to port 9.
3
root@kali2:~#
telnet 192.168.12.11 13
root@kali2:~#
telnet 192.168.12.11 17
The next port open was 13. Type the following command and press Enter to connect
to port 13.
4
The next port open was 17. Type the following command and press Enter to connect
to port 17.
5
The next port open was 19. Type the following command and press Enter to connect
to port 19.
6
root@kali2:~#
telnet 192.168.12.11 19
Click on File in the terminal menu, and then select Close Terminal.
7
Click the black and white icon (second from the top) to launch the Linux terminal.
8
root@kali2:~#
ftp 192.168.12.11
Type
ftp
for the Name. Then press Enter.
For the Password, type
password
and press Enter.
Type ftp>
ls
to list the files. Then press Enter.
Type ftp>
get hi.txt
and press Enter to get the file.
Type ftp>
bye
and press Enter to leave the session.
The next port open was 21. Type following command and press Enter to connect to
port 21.
9
Note: The password will not be displayed for security reasons.
root@kali2:~#
telnet 192.168.12.11
Log into the remote Windows Server as
administrator
, then press Enter. For the
password, type
P@ssw0rd
and the press Enter.
root@kali2:~#
exit
Type the following command and press Enter to connect to the Windows server
using telnet.
10
Note: The password will not be displayed for security reasons.
To disconnect from the remote host, type exit and press Enter.
11
root@kali2:~#
telnet 192.168.12.11 25
Type
quit
and press Enter to leave the session.
root@kali2:~#
telnet 192.168.12.11 80
Type
HEAD / HTTP/1.0
and press Enter twice.
The next port open was 25. Type following command and press Enter to connect to
port 25.
12
The next port open was 80. Type following command and press Enter to connect to
port 80.
13
root@kali2:~#
exit
Closing Unnecessary Ports and Services
root@kali2:~#
nmap 192.168.12.11 -p 7-19
To leave the terminal session, type
exit
and press Enter.
14
Click the black and white icon (second from the top) to launch the Linux terminal.
1
Type the following command and press Enter to scan the Windows machine for
open ports.
2
Click on the Internal 192.168.12.11 Windows Server icon on the topology.
3
After the machine boots up, click on the Send Ctrl+Alt+Delete button.
4
Log in as Administrator with the password of
P@ssw0rd
, then press Enter.
5
Click on the Start button and then click the Command Prompt shortcut.
6
C:\Users\Administrator\>
services.msc
Type the following command and press Enter, to bring up to Services console.
7
Scroll down to Simple TCP/IP Services and double-click on the service.
8
In the Startup type drop down box, select Disabled and then click Stop. Click OK.
9
root@kali2:~#
nmap 192.168.12.11 -p 7-19
root@kali2:~#
nmap 192.168.12.11 -p 21
Click on the Internal Kali 2 icon on the topology. Type the following command and
press Enter, to scan the Windows machine for open ports.
10
Type the following command to scan the Windows machine for an open port. Then
press Enter.
11
Click on the Internal 192.168.12.11 Windows Server icon on the topology. Scroll to
Microsoft FTP Service and double-click on the service.
12
In the Startup type drop down box, select Disabled and click Stop. Then click OK.
13
root@kali2:~#
nmap 192.168.12.11 -p 21
Click on the Internal Kali 2 icon on the topology. Type the following command to
again check port 21. Then press Enter.
14
root@kali2:~#
nmap 192.168.12.11 -p 23
Type the following command and press Enterto scan the Windows machine for an
open port.
15
Click on the Internal 192.168.12.11 Windows Server icon on the topology. Scroll down
to Telnet and double-click on the service.
16
In the Startup type drop down box, select Disabled and click Stop. Then click OK.
17
root@kali2:~#
nmap 192.168.12.11 -p 23
Click on the Internal Kali 2 icon on the topology. Type the following command to
again check port 23. Then press Enter.
18
Type the following command and press Enter to scan the Windows machine for an
open port.
19
root@kali2:~#
nmap 192.168.12.11 -p 25
Click on the Internal 192.168.12.11 Windows Server icon on the topology. Scroll up to
Simple Mail Transfer Protocol and double-click on the service.
20
In the Startup type drop down box, select Disabled and click Stop. Then click OK.
21
root@kali2:~#
nmap 192.168.12.11 -p 25
Click on the Internal Kali 2 icon on the topology. Type the following command and
press Enter to check for the IP Address of the system.
22
Type the following command to scan the Windows machine for an open port. Then
press Enter.
23
root@kali2:~#
nmap 192.168.12.11 -p 80
Click on the Internal 192.168.12.11 Windows Server icon on the topology. Scroll down
to the bottom and double-click on the World Wide Web Publishing Service.
24
In the Startup type drop down box, select Disabled and click Stop. Then click OK.
25
root@kali2:~#
nmap 192.168.12.11 -p 80
root@kali2:~#
exit
Click on the Internal Kali 2 icon on the topology. Type the following command and
then press Enter.
26
To leave the terminal session, type
exit
. Then press Enter.
27
© 2022 - Infosec Learning INC. All Rights Reserved.
Close all open windows using the X in the upper-right corner of the screen.
28
Note: Press the STOP button to complete the lab.