HỌC VIỆN KỸ THUẬT MẬT MÃ
KHOA AN TỒN THƠNG TIN
THỰC HÀNH
AN TỒN MẠNG MÁY TÍNH
Bài thực hành Lab 02 :
BẢO VỆ AN TOÀN MẠNG SỬ DỤNG TƯỜNG
LỬA PFSENSE
Giảng viên hướng dẫn: Trần Sỹ Nam
Sinh viên thực hiện: Lê Hoàng Đại Thắng - AT150651
Hà Nội, 2-2022
MỤC LỤC
I) Chuẩn bị bài thực hành
II) Thực hành
I . Chuẩn bị bài thực hành
•
•
•
•
1 Tường lửa pfsense 3 card mạng : 192.168.88.107,10.10.10.1, 20.10.10.1
1 Client Win8 : 10.10.10.2
1 máy Client dmz server 2012 : 20.10.10.2
1 máy chủ Windowserver 2012 : 10.10.10.3/24
II. Thực hành
Cài đặt thành công pfsense:
cal Database)
FreeBSD/aMd64 (pfSense.hoMe.arpa) (ttpvA)
UMnare Uirtual Machine - Netyate Device ID: ddd8262866Icb2a2e8af
Enter
an option:
I
UelcoMe
to píSense
2.5.2-RELEASE
(atid64) OII píSense
U
LA
A
(wan)
(lan)
(opt 1)
-> HMA
-> e«l
-> BM2
->
->
->
P
Tiếp tục đăng
nhập pfsense trên win 8:
8) Logout (SSH onlp)
1)
2)
3)
4)
5)
6)
7)
8)
Assign lnterfaces
Set interface(s) IP address
Reset webConfigurator passHord
Reset to ĩactorp deĩaults
Reboot spsteM
Halt spsteM
Ping host
Shell
v
v
v
4
192.168.88.187/24
18.18.10.1/24
28.18.18.1/24
9) pfTop
18) Eilter Logs
11) Restart nebConíigurator
12) PHI’ Shell ♦ pfSense tools
13) Update froM console
14) Enable Secure Shell (sshd)
15) Restore recent configuration
16) Restart PHP-FPM
Sau khi đăng nhập thành cơng:
Cấu hình ip:
Kiểm tra kết nối mạng:
<- Oi google.com/search?q=morelux8íoq=morelux8íaqs=chrome..69i57.2343j0j18tsourceid=chrome8íie=UTF-8
Google
X a I Q,
morelux
Q. Tát cả (3 Hình ảnh (g) Tin tức ợ Mua sắm : Thí
Khoảng 243.000 kẻt q (0.72 giây)
▼
KHU ĐƠ THỊ
GELEXIMCLÊ...
Thiết Kế Nội Thất Morelux I Thương hiệu nội t
Công ty cố phần kiến trúc nội thắt MORELUX là đơn vị đi đầu tror
nội thất dòng sàn phẫm gỗ tự nhiên cao cắp với...
Thi Cơng Nội Thất Gỗ óc Chó
CĨNG TY CỔ PHÂN KIẾN TRÚC NỘI THẲT MORELUX SỜ hũ
You can get IP settings assgned automatically lí your
netvvork
supports this capability. othérvdse, you need to ásk your
network
admlmstrator Í0f the appropriate IP setbngs.
Ị Obtain an IP address automatically
Hyundai A^hánhis
Khu Đơ thị Q Q
GELEXIMCĨV
©Use the following IP address:
Sản phẩm
IP address:
Mời bạn đến tham quan showroom Morelux tại địa chỉ: 31D4 kn
ội Thất Morelux
Subnet mask:
Giới Thiệu
Detault gateway:
Công Ty cổ Phàn Kiến Trúc và Nội Thắt Morelux được biết đếr
đánh giá trên Google
(■ , Obtain DNS server address
automaticalty
Tủ Trang Trí TT01
Mau tù trang tri hiện đại có thẻ dễ dàng bài tri trong mọi không
Cãc kết quà khác từ morelux.vn »
lát ờ Việt Nam
• Use the following DNS server addresses
Preterred
DNS
server:
Altemate
DNS
server:
> . > Interior Design studk) ▼
Nội Thất Morelux - Home I Facebook
Q Validate settĩngs upon
ễt
ch vụ: Thơng tin báo giá trực tuyến Dịch vụ tại
eleximco, Đ. Lê Trọng Tắn, Dương Nội, Hà Đơng,
Advanced
.
Cancel
g cửa • Mờ cửa vào 8:00 Th 6
>816 688
Lịch hẹn: morelux.vn
Nội Thất Morelux: Thiết Kẻ & Thi Cơng Kiên Trúc - Nội Thát Gỗ óc Chó D4 -31 Khu D, KĐT
Geleximco, Đ Lê Trọng Tán, p Dương Nội, Q Hà Đông, Tp. Hà Nội,
Windowserver:
I.MC.OOOROCH
RS
Indudmg resuhs f(M bn tưc
Do yov w»nt rvsuts oniy fot «n
luc?
VnExpress - Báo tiếng Việt nhièu người xem nt
https //vnexptess net •
vnEiproit an tức mối nn.1i ■ Inống an nnann s cnlnn xâc đưor rflp nnA’ rV)Ể
tức onime v£i Nam s Tnố
nóng nhát trong ngAv -vỏ
ĩhéGiởi
ỉm thè g»i Oọc bao vnLxptess cap nháp
Giải Trí
VnLxpre&s Già kI Chuyt|
m tức thè tjtoi nóng inát, moi nnát 24h
Thời Sự
Bin tm tno SƯ mớ nnât 24n nơnq
trong
nôv nồm nav câc .ăn aê ưonq nước
Ihé Ihao
Tm Thẻ Thao 24hmứi nnát oàn tm thẻ
thao
24/7 nởm nav. xerr fcfi thi dáu. ninh
255 . 255 . 255 0
(*háp Luật
Tm tức Phảữ lưítb
Un phào luâ: an
rar
linluc.vn - ĩ rang tin điện tử Online cập nhật tin mởi nhát
L
https ■Tintuc vn •
—
TlnTuc vn Trang tm (Mn tủ onkne cap nnãt an nhanh mới nõng nhát diên ra về: k I
Chinh m. xà nât. thẻ gtới giào duc thê mao vân hoa,
SOHA - Tin tửc, tin nhanh VN, Tóc độ, Tin cậy I soha.vn
https />'S0he vn •
Như vậy 2 client đều kết nối mạng thành
công.
18
a. Chặn toàn bộ máy trong mạng LAN:
Firewall / Rules / LAN
= LiíL LU
The changes have been applied successíully. The firewaII rules are now reloading in the background
Moniỉor the íilter reload pcogress.
Q
Ploating WAN LAN OPT1
Rules (Drag to Change Order)
□
States
✓ 3/5.24MiB
Protocol
*
Source
Port Destinatlon
*
* LAN Address
Por
t
Gatewa
y
443
*
Queue Schedule
Descriptlon
*
Anti-Lockout Rule
80
□
□
o
X 0/0 B
IPv4*
10.10.10.2
* ChanMXH
*
*
none
X 80/120.24 MlB
IPv4*
LAN net
**
*
*
none
Sau đó kiểm tra xem có vào được mạng hay khơng:
Dault allokv LAN to any rule
Actions
0
Nh ư v ậ y c ả 2 máy đ ã không th ể truy đượ c internet.
b. Chặn 1 máy
Sau khi chặn máy 10.10.10.2
Server vẫn vào được mạng:
Firewall/ Rules/ LAN
= IM @ ©
The changes have been applied successíully. The fìrewall rules are now reloading in the background.
Monitor the tìlter reload progress.
Eloating WAN LAN 0PT1
Rules (Drag to Change Order)
□
States
s/ 9 /7.93 MiB
Protocol
*
Source
*
Po
rt
*
Destinatlon
LAN Address
Por
t
44
3
Gatewa
y
Queu
e
*
*
Schedul
e
Description
Actions
Anti-Lockout Rule
ẽ
80
□
□
X 0/0B
0/120.35 MiB
IPv4*
10.10.10.2
*
*
*
*
none
IPv4*
LAN net
*
*
*
*
none
J Add I 1 Add I [JỊJ Delete IQ Save
A/0QĨÕ
Deíault allovv LAN to any rule
c. Chặn không cho phép truy cập facebook
Lấy địa chỉ ip facebook_______________________
C:\Users\manhq>ping facebook.com
Pinging facebook.com [31.13.77.35] with 32 bytes of data:
Reply from 31.13.77.35: bytes=32 time=23ms TTL=54
Replý from 31.13.77.35: býtes=32 time=22ms TTL=54
Reply from 31.13.77.35: bytes=32 time=23ms TTL=54
Replý from 31.13.77.35: býtes=32 time=23ms TTL=54
Ping statistics for 31.13.77.35:
Packets: Sent = 4, Received - 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 22ms< Maximum - 23ms, Average - 22ms
c:\Users\manhq>_
Ip Facebook: 31.13.77.35, ta sẽ thiết lập luật chặn:
Chặn thành công:
c:\Users\manhq>ping facebook.com
Pinging facebook.com [31.13.77.35] with 32 bytes of data:
Reply from 31.13.77.35: bytes=32 time=23ms TTL=54
Replý from 31.13.77.35: bytes=32 tỉme=22ms TTL=54
Reply from 31.13.77.35: bytes=32 time=23ms TTL=54
Reply from 31.13.77.35: bytes=32 tỉme=23ms TTL=54
Ping statistics for 31.13.77.35:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 22ms, Maximum = 23ms, Average = 22ms
c:\Users\manhq>ping facebook.com
Ping request could not find host facebook.com. Please check the name and try again.
C:\Users\manhq>ping facebook.com
Pinging facebook.com [31.13.77.35] with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
d. Chặn web với Aliase
Khi chưa chặn thì vào bình thường
VNỊ^^X PRESS
Thứ bày. 26/2/2022
0 Mới nhái ÍẼ| International Tim kiếm Q X Đăng nhâ|
A Thời sự Góc nhìn Thê giới Video Podcasts Kinh doanh Khoa học Giãi trĩ Thi thao Pháp luật Giáo dục Sức khoe ĐỜI sóng Du lỊCh số hóa Xe Ý kién T
Thủ tướng yêu cầu
sẳn sàng đưa cơng
TỐN TU
VÀ
CAC BỆNH T’ÉU HOA TMƯONO GẬP
o NHIỄM KHUẨN HP DẠ DÀY
© TRÀO NGƯỢC DẠ DÀY THỰC OUÃN
33 Command Prompt
© VIẼM LT DẠ DÀY DẠI TRÂNG
hicrost Windows [Version 10.0.19044.1526]
(c) Microsoớt Corporation. All rights reserved.
â XUT HUYT D DY
:\Users\ôanhq>ping vnexpress.net
Pinging vnexpress.net [111.65.250.2] with 32 bytes of data:
Repĩy í rom 111.65.258.2: bytes-32 ã
tme-2ms TTL-55
Replý ớ rom 111.65.250.2: býtes-32
tine-2ôs TTL-55
Replý froô 111.65.250.2: býtes-32
Replý í rom 111.65.258.2: býtes-32
Ping statistics for 111.65.258.2:
Packets: Sent - 4, Received • .
4, Lost - 0 (6% loss).
Approximate round trip tines in laillỉ-seconds:
Minimum - 2ms, Maximum - 2«s, Average - 2ms
:\Users\«wnhq>,
Bắt đơng sản
hch chở 39 người từ đảo Củ Lao
Chàm vào bị bi sóng đánh chim
trén biẻn cửa Đai. 13 người chét. 5
Tạo Aliase để chặn vnexpress.net
Sau đó lập rules để chặn
■■■■■LI .
Thanh tra các dự án điện
phát triển trong 10 năm
qua
Bảo hiểm
CapitalLand sẽ làm dự án
một tỷ USD tại Bấc Giang
Tảo đoàn nãv nohiẻn cữu ouv
Source
Destination
Extra
□ Invertmatch
Actlon
Sìngle host or alias
*
Block
10.10.10.2
/,
V
V
Choose what to do with packets that match the criteria specihed belovv.
Single host or alias
ChanMXH
Destination □ Invertmatch
Options
Hlnt the ditíerence between block and reject is that whh reịect, a packet (TCP RST or ICMP port unreachable for UDP) ìs retumed to the sender,
vvhereas with block the packet is dropped silently. In either case. the original packet is discarded.
Chặn thành công
Disabled
SB Command Prompt
□ Disable this rule
Set this option to disable this rule vvithout removing it fran the list.
Intertace
LAN
IPv4
Address Pamily
—
V
Choose the interíace írom which packets must come to match this rule.
licrosoít windows [Version 10.0.19044.1526]
(c) Microsoít Corporation. All rights reserved.
□X
V
Select the Internet Protocol version this rule applies to.
":\Users\manhq>ping vnexpress.net
Any
V
Choose which
IP protocol
this rule should
match.
’inging vnexpress.net [111.65.250.2]
with
32 bytes
of data:
Protocol
ĩeply írom 111.65.250.2: bytes-32 time-2ms TTL-55
3eplý from 111.65.250.2: bytes=32 time-2ms TTL-55
leplý from 111.65.250.2: bytes-32 time=2ms TTL-55
3eply from 111.65.250.2: bytes=32 time=2ms TTL=55
’ing statistics for 111.65.250.2:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
ipproximate round trip times in milli-seconds:
Minimum - 2ms, Maximum = 2ms, Average • 2ms
C:\Users\manhq>
’inging vnexpress.net [111.65.250.2] with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
e. Schedules
Thêm schedule
®sense
System ▼
Interíaces ’
Firewall ’
Services ’
VPN T
Status ’
Diagnostics ’
'o
Help -
COMMUMITY
c+
EDrTIOM
MARNING: The 'admirí account password IS set to the detault value. Change the passnord in the User Manager.
Firewall / Schedules
&
Schedules
Na me
Range: Dale ỉ Times! Na me
Description
ptSense developed and mamid Netgate ESF2004’20 Vĩevvlicense.
Actions
Chỉ làm việc trong tuần trong khoảng thời gian đã đặt
Schedule Intormation
Schedule Name Lam viec quy cu
The name of the schedule may only consist of the characters ‘e-z, A-Z. 0-9 and
Descriptíon
A descriptKNì may be entered here for administrative retence (not parsed).
Month February_22
V
February_2022
Mo
n
7
1
4
21
Tue
W
od
1
2
8
9
15
22
Th
Fn
Sat
3
4
5
1
1
u
0
1
6
1
1
2
3
1
20
9
2
4
13
2
8
2
6
1
1
7
Sun
5
2
27
6
28
Click rĩdividual date to select thai date only. Click the appropriate
weekday Header lo select all occurrences of that weekday
Tim
e
8
V
Siart Hrs
00
V
[18_____________
Start Míns
Siop Hrs
V
59
Stop
Mi
Thêm vào rule và kiểm tra
1
1
^^SGIISG System ’ Interíaces ▼ Firewall
0^1
Services ’ VPN ▼ Status ▼ Diagnostics ’ Help ▼
CỮMMUNITY EữlTION
WARNING; The 'admirí account password is set to the deíaLih value. Change the passttữrd in the User Manager.
Firewall / Schedules
©
1 Schedules
Name
Range: Date / Times / Name
Congviec
Description
Actions
Mon-Fri/7:00-17:00/
© Indicates that the schedule is currently active.
Firewall / Rules / LAN
5 IM 1=1 ©
The changes have been applied successíully The firewall rules are now reloading in the background.
Monitor the íilter reload progress.
Floating WAN LAN 0PT1
Rules (Drag to Change Order)
□
States
Protocol
14/11.75 MÍB
*
Source
*
Port
*
Destination
LAN Address
Por
t
Gatewa
y
*
Queu
e
*
*
*
none
*
*
443
Schedule
Description
Anti-Lockout Rule
80
□
□
o
X
0 /87 KiB
IPv4*
LAN net
X
0/0B
IPv4*
10.10.10.2
IPv4*
LAN net
v
'
5/13240 MiB
Thành cơng
*
31.13.77.35
ChanMXH
*
*
none
none
( Congviec
Dault allow LAN to any rule
J Add 1 Add 1 QỊ] Deiete 1 Q Save
Actions
ộ
4-
Bạn chưa kết nối
ơ Q gooộle.com
Và thê giđí mang sé khống còn như vậy nửa néu thiêu ban Hây đưa ban quay trđ lai tí ực tun'
Thtfì
•
Kiếm tra cáp mạng, modem và bộ đinh tưyén của bạn
•
Kết nối I91 mộng khơng dây của bạn
•
Chạy Chãn đốn Mạng Wìndows
ONS PftOB£ F'*aSKÍ> NO INTERMĨ
Bạn muốn chơi trò chơi trong khi chờ đợi? Khởi chay trị chai
f. Giới hạn băng thơng
By Interíace
By Queue
Limiters
Wizards
D dowload
Enable □ Ẽnable limiter and rts children
lf "source’ or "destination* slots is chosen a dynamic pipe with the bandwidth, delay, packet loss and queue size given above will be
Name
upload
Mbit/S
none
created for each source/destination IP address encountered, respectively.
This makes it possible to easily speciíy
bandwidth limits
per host or subnet.
Bandvvidth
Bandwidth
Mask
None
IPv4 mask bits
255.255.255.255/?
Thêm vào rules và kiêm tra lại
128
Bw type
Schedule
IPv6 mask bits
This does NOT prevent the rule trom beíng overwritien on slave
VLAN
Prlo
none
V
Choose 802.1 p priority to match on.
VLANPrioSet
V
none
Choose 802.1 p prkxity to apply.
Schedule
none
V
Leave as 'none' 10 leave the rule enabied all the time.
Gateway
Delault
V
Leave as deíault to use the System routing table. Or choose a gateway 10 utilize policy based routing.
Gateway selection is not valid for 1PV4+IPV6’ address íamtíy
In/Outpipe upload
V I dowload
2
Choose the Out queue/virtual interíace only if In is also setected The Out selection is applied lo traííic leaving the interíace vvhete the rule is ơeated,
the In selection IS applied lo traííic corrnng mto the chosen rteríace.
11 creattng a Aoanng rule, li the direction IS In then the same rules apply, lí the direction IS Out the seiectiỡns are reversed, Out IS tor Incomlng and In is
for outgoing
Ackqueue / Oueue none
v rone
Choose the Acknowledge Queue only if there is a selected Quetie
Rule Iníormation
Tracking ID 0100000101
Băng thơng khơng vượt q 5mb
Cấu hình dmz
Tạo index.html
'
Firewall / NAT / Port Forward
Port Forward
□
□
Outbound NPt
Intertace Protocol Source Address Source Ports Dest. Address Dest. Ports NATIP
■M' xĩ WAN TCP *
*
NAT Ports Descrlption Actions
WAN address 80 (HTTP) 20.10.10.2
80 (HTTP)
/'ĐỄ
Logand
► Pass
Linked rule
—
------- lỉtìvopypatn
.
Copy Paite
Move Copy Delete Rename New
0 Pa5te íhortcut to • to •
.
tasy access ’
tolder
—— i/ỊEOrt
Propertiei
.
D
>ciect none
—
Invert selection
u
• T [ 1 ► ThisPC ► Locil Oisk (C:)
Cí
. r______Name
ravorites
■ Desktop
321 index.html
• Dovvnloads
Recent places
File Edit Pormat Vĩew Help
1 Nguyên Manh Quan
1 AT150644
^ioc vien ki thuat mat ma
index.html - Notepad
_□X
1
:•» ThisPC
*ií Network
1 <[
1 Item 1 ittm selected 49 bytes
Thành cơng
Cấu hình NAT web Server
Ị> 1 J