-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path5dayproject.html
More file actions
1407 lines (1171 loc) · 46.2 KB
/
5dayproject.html
File metadata and controls
1407 lines (1171 loc) · 46.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SOC Analyst - 5-Day Firewall & Log Analysis Plan</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 100%);
color: #f0f0f0;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
padding: 40px;
line-height: 1.8;
}
.container {
max-width: 1200px;
margin: 0 auto;
background: rgba(22, 22, 36, 0.95);
padding: 50px;
border-radius: 15px;
box-shadow: 0 10px 50px rgba(0, 255, 255, 0.1);
}
h1 {
color: #00ffff;
font-size: 3em;
font-weight: bold;
text-align: center;
margin-bottom: 20px;
text-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}
h2 {
color: #00ffff;
font-size: 2em;
font-weight: bold;
margin-top: 40px;
margin-bottom: 20px;
border-bottom: 3px solid #00ffff;
padding-bottom: 10px;
}
h3 {
color: #00d4ff;
font-size: 1.5em;
font-weight: bold;
margin-top: 30px;
margin-bottom: 15px;
}
h4 {
color: #ffd700;
font-size: 1.2em;
font-weight: bold;
margin-top: 20px;
margin-bottom: 10px;
}
p, li {
color: #ffffff;
font-weight: bold;
font-size: 1.1em;
}
.highlight {
color: #ffd700;
font-weight: bold;
background: rgba(255, 215, 0, 0.1);
padding: 2px 6px;
border-radius: 4px;
}
.goal-box {
background: rgba(0, 255, 255, 0.1);
border-left: 5px solid #00ffff;
padding: 20px;
margin: 30px 0;
border-radius: 8px;
}
.day-card {
background: rgba(0, 212, 255, 0.05);
border: 2px solid #00d4ff;
padding: 25px;
margin: 25px 0;
border-radius: 10px;
transition: transform 0.3s;
}
.day-card:hover {
transform: translateX(10px);
border-color: #ffd700;
}
code {
color: #00ff00;
background: rgba(0, 0, 0, 0.5);
padding: 4px 8px;
border-radius: 5px;
font-family: 'Consolas', 'Courier New', monospace;
font-size: 1em;
}
pre {
background: rgba(0, 0, 0, 0.7);
padding: 20px;
border-radius: 8px;
border-left: 4px solid #00ff00;
overflow-x: auto;
margin: 15px 0;
}
pre code {
background: transparent;
padding: 0;
}
ul {
margin-left: 30px;
margin-top: 15px;
margin-bottom: 15px;
}
li {
margin: 10px 0;
list-style-type: none;
position: relative;
padding-left: 25px;
}
li:before {
content: "▸";
color: #00ffff;
position: absolute;
left: 0;
font-size: 1.3em;
}
.deliverable {
background: rgba(255, 215, 0, 0.1);
border-left: 5px solid #ffd700;
padding: 15px;
margin: 20px 0;
border-radius: 6px;
}
.deliverable strong {
color: #ffd700;
font-size: 1.15em;
}
table {
width: 100%;
border-collapse: collapse;
margin: 25px 0;
background: rgba(0, 0, 0, 0.3);
border-radius: 8px;
overflow: hidden;
}
th {
background: rgba(0, 255, 255, 0.2);
color: #00ffff;
font-weight: bold;
padding: 15px;
text-align: left;
font-size: 1.15em;
}
td {
padding: 12px 15px;
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
color: #ffffff;
font-weight: bold;
}
.warning {
color: #ff6b6b;
font-weight: bold;
background: rgba(255, 107, 107, 0.1);
padding: 15px;
border-left: 5px solid #ff6b6b;
margin: 20px 0;
border-radius: 6px;
}
.success {
color: #51cf66;
font-weight: bold;
background: rgba(81, 207, 102, 0.1);
padding: 15px;
border-left: 5px solid #51cf66;
margin: 20px 0;
border-radius: 6px;
}
.intro {
text-align: center;
color: #ffffff;
font-size: 1.3em;
margin-bottom: 40px;
font-weight: bold;
}
.timeline {
color: #ff79c6;
font-weight: bold;
font-size: 1.1em;
}
.abbr {
color: #bd93f9;
font-weight: bold;
}
</style>
</head>
<body>
<div class="container">
<h1>🛡️ SOC Analyst Firewall Mastery</h1>
<p class="intro">5-Day Intensive Training Plan for loki</p>
<p class="intro timeline">March 8 - March 12, 2026</p>
<div class="goal-box">
<h3>🎯 Mission Objective</h3>
<p>By Day 5, you will be able to:</p>
<ul>
<li>Install, configure, and manage enterprise firewalls (Windows + Linux)</li>
<li>Set up centralized log collection using <span class="abbr">SIEM</span> tools</li>
<li>Detect network attacks from firewall logs</li>
<li>Block malicious IPs, ports, and geographical locations</li>
<li>Explain your SOC workflow confidently in job interviews</li>
</ul>
</div>
<h2>📚 Key Abbreviations & Terms</h2>
<table>
<tr>
<th>Term</th>
<th>Full Form / Meaning</th>
</tr>
<tr>
<td><span class="abbr">SOC</span></td>
<td>Security Operations Center — team that monitors and responds to security incidents</td>
</tr>
<tr>
<td><span class="abbr">SIEM</span></td>
<td>Security Information and Event Management — collects, analyzes, and alerts on security logs</td>
</tr>
<tr>
<td><span class="abbr">pfSense</span></td>
<td>Open-source firewall/router software based on FreeBSD — industry standard</td>
</tr>
<tr>
<td><span class="abbr">NAT</span></td>
<td>Network Address Translation — maps internal IPs to external IPs</td>
</tr>
<tr>
<td><span class="abbr">SPL</span></td>
<td>Search Processing Language — query language for Splunk</td>
</tr>
<tr>
<td><span class="abbr">KQL</span></td>
<td>Kibana Query Language — query language for Elasticsearch/Kibana</td>
</tr>
<tr>
<td><span class="abbr">ELK Stack</span></td>
<td>Elasticsearch + Logstash + Kibana — open-source SIEM alternative</td>
</tr>
<tr>
<td><span class="abbr">DoS</span></td>
<td>Denial of Service — attack that floods a target to make it unavailable</td>
</tr>
</table>
<h2>📅 The 5-Day Breakdown</h2>
<!-- DAY 1 -->
<div class="day-card">
<h2>Day 1: Firewall Fundamentals + Hands-On Setup</h2>
<p class="timeline">⏱️ Estimated Time: 2.5 - 3 hours</p>
<h3>🎓 What You'll Learn</h3>
<ul>
<li>Firewall theory: types, zones, stateful vs stateless</li>
<li>Install pfSense in VirtualBox</li>
<li>Set up network topology: Kali ↔ pfSense ↔ Windows</li>
<li>Create and test basic firewall rules</li>
</ul>
<h3>📖 Theory Speedrun (15 minutes)</h3>
<h4>What is a Firewall?</h4>
<p>A firewall is a <span class="highlight">network security device</span> that monitors and controls incoming and outgoing network traffic based on predetermined security rules.</p>
<h4>Types of Firewalls</h4>
<table>
<tr>
<th>Type</th>
<th>How It Works</th>
</tr>
<tr>
<td>Packet Filtering</td>
<td>Inspects packets, allows/blocks based on IP, port, protocol</td>
</tr>
<tr>
<td>Stateful Inspection</td>
<td>Tracks connection state, smarter decisions</td>
</tr>
<tr>
<td>Proxy Firewall</td>
<td>Acts as intermediary, inspects application-layer data</td>
</tr>
<tr>
<td>Next-Gen (NGFW)</td>
<td>Deep packet inspection + IPS + app awareness</td>
</tr>
</table>
<h4>Stateful vs Stateless</h4>
<ul>
<li><span class="highlight">Stateless:</span> Each packet judged independently (fast but dumb)</li>
<li><span class="highlight">Stateful:</span> Remembers connection context (slower but smart)</li>
</ul>
<h4>Firewall Zones</h4>
<ul>
<li><span class="highlight">WAN:</span> Wide Area Network (internet-facing, untrusted)</li>
<li><span class="highlight">LAN:</span> Local Area Network (internal, trusted)</li>
<li><span class="highlight">DMZ:</span> Demilitarized Zone (public-facing servers, semi-trusted)</li>
</ul>
<h3>🛠️ Step 1: Download pfSense (10 minutes)</h3>
<ul>
<li>Go to: <code>https://www.pfsense.org/download/</code></li>
<li>Select: <span class="highlight">Architecture:</span> AMD64 (64-bit)</li>
<li>Select: <span class="highlight">Installer:</span> DVD Image (ISO)</li>
<li>Download the <code>.iso.gz</code> file</li>
<li>Extract it to get the <code>.iso</code> file</li>
</ul>
<h3>🖥️ Step 2: Create pfSense VM in VirtualBox (20 minutes)</h3>
<pre><code>1. Open VirtualBox → New
2. Name: pfSense-Firewall
3. Type: BSD
4. Version: FreeBSD (64-bit)
5. RAM: 2048 MB (2 GB minimum)
6. Hard Disk: Create virtual hard disk (20 GB, VDI, Dynamically allocated)
7. Settings → System → Enable EFI (if needed)
8. Settings → Storage → Add the pfSense ISO to optical drive
9. Settings → Network:
- Adapter 1: NAT (WAN - internet)
- Adapter 2: Internal Network, Name: "LAN_Network" (LAN - internal)</code></pre>
<div class="warning">
<strong>⚠️ Critical:</strong> pfSense needs 2 network adapters. Adapter 1 = WAN (internet), Adapter 2 = LAN (internal network).
</div>
<h3>⚙️ Step 3: Install pfSense (20 minutes)</h3>
<pre><code>1. Start the VM
2. Wait for boot menu → select "Boot Multi User" (or wait for auto-boot)
3. Accept all defaults during installation
4. Select "Install pfSense"
5. Keymap: Select your keyboard layout
6. Partitioning: Auto (ZFS) → Stripe → select disk → YES
7. Wait for installation to complete
8. Reboot when prompted (remove ISO first)
9. After reboot:
- WAN interface: em0 (or vtnet0)
- LAN interface: em1 (or vtnet1)
- Confirm: y</code></pre>
<h3>🔗 Step 4: Configure Kali + Windows VMs (30 minutes)</h3>
<p><span class="highlight">Kali VM Network Settings:</span></p>
<pre><code>VirtualBox → Kali → Settings → Network
- Adapter 1: Internal Network, Name: "LAN_Network"
- Start Kali
- Check IP: ip addr show
- Should get IP like 192.168.1.x from pfSense DHCP</code></pre>
<p><span class="highlight">Windows VM Network Settings:</span></p>
<pre><code>VirtualBox → Windows → Settings → Network
- Adapter 1: Internal Network, Name: "LAN_Network"
- Start Windows
- Check IP: ipconfig
- Should get IP like 192.168.1.x</code></pre>
<h3>🔥 Step 5: Access pfSense Web Interface (15 minutes)</h3>
<pre><code># From Kali or Windows browser:
http://192.168.1.1
# Default credentials:
Username: admin
Password: pfsense</code></pre>
<p><span class="highlight">Setup Wizard:</span></p>
<ul>
<li>Next → Next</li>
<li>Hostname: firewall</li>
<li>Domain: localdomain</li>
<li>Primary DNS: 8.8.8.8</li>
<li>Secondary DNS: 8.8.4.4</li>
<li>Timezone: Your timezone</li>
<li>WAN: Keep defaults (DHCP from VirtualBox NAT)</li>
<li>LAN IP: 192.168.1.1 / 24</li>
<li>Set new admin password (CHANGE THIS!)</li>
<li>Finish → Reload</li>
</ul>
<h3>🛡️ Step 6: Create Your First Firewall Rules (30 minutes)</h3>
<p>Go to: <code>Firewall → Rules → LAN</code></p>
<h4>Rule 1: Block All Traffic (Default Deny)</h4>
<pre><code>Action: Block
Interface: LAN
Protocol: Any
Source: Any
Destination: Any
Description: Default Deny All</code></pre>
<h4>Rule 2: Allow DNS</h4>
<pre><code>Action: Pass
Interface: LAN
Protocol: TCP/UDP
Source: LAN net
Destination: Any
Destination Port: 53
Description: Allow DNS</code></pre>
<h4>Rule 3: Allow HTTP/HTTPS</h4>
<pre><code>Action: Pass
Interface: LAN
Protocol: TCP
Source: LAN net
Destination: Any
Destination Port: 80, 443
Description: Allow Web Traffic</code></pre>
<div class="success">
<strong>✅ Rule Order Matters:</strong> pfSense processes rules top-to-bottom, first match wins. Always put specific rules BEFORE general rules.
</div>
<h3>✅ Step 7: Test & Verify (20 minutes)</h3>
<p>From Kali:</p>
<pre><code># Test DNS
nslookup google.com
# Test HTTP
curl http://example.com
# Test ICMP (ping) - should FAIL if not allowed
ping 8.8.8.8
# Test SSH - should FAIL
nmap -p 22 8.8.8.8</code></pre>
<div class="deliverable">
<strong>📦 Day 1 Deliverable:</strong> Working pfSense firewall between Kali and Windows VMs, with 3+ firewall rules blocking and allowing specific traffic.
</div>
<h3>✅ Day 1 Checkpoint Quiz</h3>
<ul>
<li>What's the difference between stateful and stateless firewalls?</li>
<li>What are the 3 main firewall zones?</li>
<li>Why does rule order matter in pfSense?</li>
<li>What ports are used for HTTP and HTTPS?</li>
</ul>
</div>
<!-- DAY 2 -->
<div class="day-card">
<h2>Day 2: Advanced Rule Configuration + Traffic Filtering</h2>
<p class="timeline">⏱️ Estimated Time: 2.5 - 3 hours</p>
<h3>🎓 What You'll Learn</h3>
<ul>
<li>Deep dive into rule syntax and matching logic</li>
<li>Port-based filtering (SSH, RDP, FTP, etc.)</li>
<li>NAT and port forwarding</li>
<li>Test rules with offensive tools</li>
</ul>
<h3>📖 Understanding Firewall Rule Components</h3>
<table>
<tr>
<th>Component</th>
<th>What It Does</th>
</tr>
<tr>
<td>Action</td>
<td>Pass (allow), Block (deny silently), Reject (deny with response)</td>
</tr>
<tr>
<td>Interface</td>
<td>Which interface traffic is coming FROM</td>
</tr>
<tr>
<td>Protocol</td>
<td>TCP, UDP, ICMP, ANY</td>
</tr>
<tr>
<td>Source</td>
<td>Where traffic originates (IP, network, any)</td>
</tr>
<tr>
<td>Destination</td>
<td>Where traffic is going (IP, network, any)</td>
</tr>
<tr>
<td>Port</td>
<td>Specific service port (22=SSH, 3389=RDP, 80=HTTP)</td>
</tr>
</table>
<h3>🔥 10 Real SOC Firewall Rules</h3>
<h4>Rule 1: Block All Inbound RDP from WAN</h4>
<pre><code>Action: Block
Interface: WAN
Protocol: TCP
Source: Any
Destination: Any
Destination Port: 3389
Description: Block External RDP Brute Force Attempts</code></pre>
<p><span class="highlight">Why:</span> RDP is heavily targeted for brute force attacks.</p>
<h4>Rule 2: Block All Inbound SSH from WAN</h4>
<pre><code>Action: Block
Interface: WAN
Protocol: TCP
Source: Any
Destination: Any
Destination Port: 22
Description: Block External SSH Access</code></pre>
<h4>Rule 3: Allow Outbound DNS Only to Trusted DNS Servers</h4>
<pre><code>Action: Pass
Interface: LAN
Protocol: UDP
Source: LAN net
Destination: 8.8.8.8, 1.1.1.1
Destination Port: 53
Description: Allow DNS to Google/Cloudflare Only</code></pre>
<h4>Rule 4: Block Tor Exit Nodes (Using Alias)</h4>
<pre><code># First create alias: Firewall → Aliases → IP
# Name: TorExitNodes
# Type: URL (IPs)
# URL: https://check.torproject.org/torbulkexitlist
# Then create rule:
Action: Block
Interface: WAN
Protocol: Any
Source: TorExitNodes (alias)
Destination: Any
Description: Block Tor Traffic</code></pre>
<h4>Rule 5: Rate Limit ICMP (Prevent Ping Floods)</h4>
<pre><code>Action: Pass
Interface: WAN
Protocol: ICMP
Source: Any
Destination: WAN address
Advanced → Max States: 10
Description: Rate Limit ICMP</code></pre>
<h4>Rule 6: Allow HTTP/HTTPS Only to Web Servers</h4>
<pre><code>Action: Pass
Interface: LAN
Protocol: TCP
Source: LAN net
Destination: Any
Destination Port: 80, 443
Description: Allow Web Browsing</code></pre>
<h4>Rule 7: Block Outbound Telnet (Insecure Protocol)</h4>
<pre><code>Action: Block
Interface: LAN
Protocol: TCP
Source: LAN net
Destination: Any
Destination Port: 23
Description: Block Insecure Telnet Protocol</code></pre>
<h4>Rule 8: Allow NTP (Time Sync)</h4>
<pre><code>Action: Pass
Interface: LAN
Protocol: UDP
Source: LAN net
Destination: Any
Destination Port: 123
Description: Allow Network Time Protocol</code></pre>
<h4>Rule 9: Block All IPv6 (If Not Used)</h4>
<pre><code>Action: Block
Interface: WAN
Protocol: IPv6
Source: Any
Destination: Any
Description: Block IPv6 Traffic</code></pre>
<h4>Rule 10: Log All Blocked Traffic</h4>
<pre><code># For ANY block rule, enable:
☑️ Log packets that are handled by this rule
# View logs: Status → System Logs → Firewall</code></pre>
<h3>🔧 NAT & Port Forwarding</h3>
<h4>Scenario: Forward External Port 8080 to Internal Web Server</h4>
<pre><code>Firewall → NAT → Port Forward → Add
Interface: WAN
Protocol: TCP
Destination: WAN address
Destination Port: 8080
Redirect Target IP: 192.168.1.100 (internal server)
Redirect Target Port: 80
Description: Forward Web Traffic to Internal Server
Save → Apply</code></pre>
<div class="success">
<strong>✅ NAT Auto-Rule:</strong> pfSense automatically creates a matching firewall rule when you add port forwarding. Check Firewall → Rules → WAN.
</div>
<h3>🧪 Testing Your Rules with Kali</h3>
<h4>Test 1: Port Scan Detection</h4>
<pre><code># From Kali, scan your Windows VM through pfSense:
nmap -sS -p 1-1000 192.168.1.100
# Check pfSense logs:
Status → System Logs → Firewall
# Look for blocked connection attempts</code></pre>
<h4>Test 2: SSH Blocking</h4>
<pre><code># Try to SSH to external server:
ssh user@example.com
# Should timeout if blocked
# Check pfSense: Diagnostics → States
# Should NOT see SSH connections if blocked</code></pre>
<h4>Test 3: HTTP/HTTPS Allowed</h4>
<pre><code>curl -I https://google.com
# Should return HTTP 200 or 301</code></pre>
<h4>Test 4: ICMP Rate Limiting</h4>
<pre><code># Flood ping:
ping -f 8.8.8.8
# Check pfSense logs - should see drops after limit</code></pre>
<div class="deliverable">
<strong>📦 Day 2 Deliverable:</strong> 10+ firewall rules covering real SOC scenarios, tested and verified with nmap/curl. NAT port forwarding configured.
</div>
<h3>✅ Day 2 Checkpoint Quiz</h3>
<ul>
<li>What's the difference between Block and Reject?</li>
<li>Why block RDP from WAN?</li>
<li>What is NAT and why is it used?</li>
<li>How do you verify a rule is working?</li>
</ul>
</div>
<!-- DAY 3 -->
<div class="day-card">
<h2>Day 3: Log Collection + SIEM Setup</h2>
<p class="timeline">⏱️ Estimated Time: 3 - 4 hours</p>
<h3>🎓 What You'll Learn</h3>
<ul>
<li>Enable comprehensive logging on pfSense</li>
<li>Set up Syslog server</li>
<li>Install Splunk Free or ELK Stack</li>
<li>Forward pfSense logs to SIEM</li>
<li>Create your first security dashboard</li>
</ul>
<h3>📖 Why Log Collection Matters</h3>
<p>In a SOC, <span class="highlight">logs are your evidence</span>. Without centralized logging:</p>
<ul>
<li>You can't detect attacks</li>
<li>You can't prove compliance</li>
<li>You can't investigate incidents</li>
<li>You can't correlate events across systems</li>
</ul>
<h3>🛠️ Step 1: Enable Logging on pfSense (15 minutes)</h3>
<pre><code>Status → System Logs → Settings
☑️ Log packets matched from the default block rules
☑️ Log packets matched from the default pass rules
☑️ Log packets blocked by 'Block Bogon Networks' rules
☑️ Log packets blocked by 'Block Private Networks' rules
Web Server Log: ☑️ Log web server errors
GUI Log: ☑️ Log successful logins
GUI Log: ☑️ Log failed logins
Save</code></pre>
<h3>🔧 Step 2: Configure Remote Syslog (20 minutes)</h3>
<pre><code>Status → System Logs → Settings → Remote Logging
☑️ Enable Remote Logging
Remote Log Servers:
Server 1: 192.168.1.50:514 (your SIEM server IP)
Remote Syslog Contents:
☑️ Everything
Save</code></pre>
<div class="warning">
<strong>⚠️ Note:</strong> 192.168.1.50 is your Kali VM where we'll install the SIEM. Adjust to your actual IP.
</div>
<h3>🖥️ Option A: Install Splunk Free (Easier, Recommended for Beginners)</h3>
<h4>Step 1: Download Splunk on Kali</h4>
<pre><code># Download Splunk Free (requires account creation):
# Go to: https://www.splunk.com/en_us/download/splunk-enterprise.html
# Select: Linux (.deb for Debian/Kali)
# Or use wget (example URL, get latest):
wget -O splunk.deb 'https://download.splunk.com/products/splunk/releases/9.x.x/linux/splunk-9.x.x-linux-amd64.deb'</code></pre>
<h4>Step 2: Install Splunk</h4>
<pre><code>sudo dpkg -i splunk.deb
# Start Splunk
cd /opt/splunk/bin
sudo ./splunk start --accept-license
# Create admin account when prompted:
# Username: admin
# Password: (create strong password)
# Enable boot-start:
sudo ./splunk enable boot-start</code></pre>
<h4>Step 3: Access Splunk Web Interface</h4>
<pre><code># From browser (on Kali or Windows VM):
http://192.168.1.50:8000
# Login with admin credentials</code></pre>
<h4>Step 4: Configure Syslog Input in Splunk</h4>
<pre><code>Settings → Data Inputs → UDP → Add New
Port: 514
Source name override: pfsense
Source type: syslog
Index: main (default)
Save</code></pre>
<h4>Step 5: Verify Logs Are Coming In</h4>
<pre><code># In Splunk Search bar:
index=main source="pfsense"
# Should see firewall logs streaming in
# Generate traffic from Windows/Kali to create logs</code></pre>
<h4>Step 6: Create Your First Dashboard</h4>
<pre><code># Search query:
index=main source="pfsense"
| stats count by action
# Save As → Dashboard Panel
# Title: "Firewall Actions - Allow vs Block"
# Visualization: Pie Chart</code></pre>
<h3>🖥️ Option B: Install ELK Stack (Advanced, More Control)</h3>
<h4>Step 1: Install Elasticsearch</h4>
<pre><code># Import GPG key:
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
# Add repository:
echo "deb https://artifacts.elastic.co/packages/8.x/apt stable main" | sudo tee /etc/apt/sources.list.d/elastic-8.x.list
# Install:
sudo apt update
sudo apt install elasticsearch -y
# Start service:
sudo systemctl start elasticsearch
sudo systemctl enable elasticsearch
# Test:
curl -X GET "localhost:9200/"</code></pre>
<h4>Step 2: Install Logstash</h4>
<pre><code>sudo apt install logstash -y
# Create pfSense config:
sudo nano /etc/logstash/conf.d/pfsense.conf</code></pre>
<p>Paste this configuration:</p>
<pre><code>input {
udp {
port => 514
type => "pfsense"
}
}
filter {
if [type] == "pfsense" {
grok {
match => { "message" => "%{SYSLOGTIMESTAMP:timestamp} %{SYSLOGHOST:hostname} %{DATA:program}: %{GREEDYDATA:message}" }
}
}
}
output {
elasticsearch {
hosts => ["localhost:9200"]
index => "pfsense-%{+YYYY.MM.dd}"
}
}</code></pre>
<pre><code># Start Logstash:
sudo systemctl start logstash
sudo systemctl enable logstash</code></pre>
<h4>Step 3: Install Kibana</h4>
<pre><code>sudo apt install kibana -y
# Configure:
sudo nano /etc/kibana/kibana.yml
# Uncomment/set:
server.port: 5601
server.host: "0.0.0.0"
elasticsearch.hosts: ["http://localhost:9200"]
# Start:
sudo systemctl start kibana
sudo systemctl enable kibana</code></pre>
<h4>Step 4: Access Kibana</h4>
<pre><code># Browser:
http://192.168.1.50:5601
# Create index pattern:
Management → Index Patterns → Create
Pattern: pfsense-*
Time field: @timestamp</code></pre>
<h4>Step 5: Create Dashboard in Kibana</h4>
<pre><code>Dashboard → Create Dashboard → Add Panel
Visualization Type: Pie Chart
Field: action.keyword
Split Slices: Terms aggregation
Save → "Firewall Allow vs Block"</code></pre>
<div class="deliverable">
<strong>📦 Day 3 Deliverable:</strong> Live log stream from pfSense → SIEM (Splunk or ELK) with searchable events and at least 1 dashboard showing firewall activity.
</div>
<h3>✅ Day 3 Checkpoint Quiz</h3>
<ul>
<li>What is Syslog and what port does it use?</li>
<li>What's the difference between Splunk and ELK?</li>
<li>Why use UDP for syslog instead of TCP?</li>
<li>What is an index pattern in Kibana?</li>
</ul>
</div>
<!-- DAY 4 -->
<div class="day-card">
<h2>Day 4: Attack Simulation + Detection</h2>
<p class="timeline">⏱️ Estimated Time: 3 - 4 hours</p>
<h3>🎓 What You'll Learn</h3>
<ul>
<li>Simulate realistic attacks from Kali</li>
<li>Analyze logs to detect anomalies</li>
<li>Write detection queries (SPL for Splunk / KQL for ELK)</li>
<li>Identify malicious IPs and patterns</li>
<li>Create alerts for suspicious activity</li>
</ul>
<h3>⚔️ Attack Scenario 1: Port Scanning (Reconnaissance)</h3>
<h4>Execute Attack from Kali:</h4>
<pre><code># Full TCP SYN scan:
sudo nmap -sS -p- 192.168.1.100 -T4
# Aggressive scan with OS detection:
sudo nmap -A 192.168.1.100
# Stealthy scan (slow):
sudo nmap -sS -T2 192.168.1.100</code></pre>
<h4>Detection in Splunk:</h4>
<pre><code># Search for multiple connection attempts from same source:
index=main source="pfsense"
| stats count by src_ip dest_port
| where count > 50
| sort - count</code></pre>
<h4>Detection in ELK/Kibana:</h4>
<pre><code># Kibana Discover search:
source_ip: * AND destination_port: *
# Aggregation:
Terms on source_ip.keyword
Count > 50</code></pre>
<div class="success">
<strong>✅ What to Look For:</strong> Single IP hitting 50+ different ports in short time = Port Scan
</div>
<h3>⚔️ Attack Scenario 2: Brute Force SSH</h3>
<h4>Execute Attack from Kali:</h4>
<pre><code># First, allow SSH temporarily on pfSense for this test
# Install Hydra:
sudo apt install hydra -y
# Create password list:
echo -e "password\nadmin\n123456\npassword123" > passwords.txt
# Brute force:
hydra -l admin -P passwords.txt ssh://192.168.1.100</code></pre>
<h4>Detection in Splunk:</h4>
<pre><code>index=main source="pfsense" dest_port=22
| stats count by src_ip
| where count > 10
| eval attack_type="SSH Brute Force"</code></pre>
<h4>Create Alert in Splunk:</h4>
<pre><code>Settings → Searches, Reports, and Alerts → New Alert
Search: (paste above query)
Alert Type: Real-time
Trigger: Number of results > 10
Actions: Send email / Log event
Save</code></pre>
<h3>⚔️ Attack Scenario 3: DDoS Simulation (Ping Flood)</h3>
<h4>Execute Attack from Kali:</h4>
<pre><code># ICMP flood:
sudo hping3 -1 --flood 192.168.1.100
# SYN flood:
sudo hping3 -S --flood -p 80 192.168.1.100</code></pre>
<h4>Detection in Splunk:</h4>
<pre><code>index=main source="pfsense" protocol=ICMP
| timechart span=1m count by src_ip
| where count > 1000</code></pre>
<div class="warning">
<strong>⚠️ Warning:</strong> Run DDoS tests in isolated lab only! This will impact your VM performance.
</div>
<h3>🔍 Advanced Log Analysis Queries</h3>
<h4>Splunk: Top Blocked IPs</h4>
<pre><code>index=main source="pfsense" action=block
| stats count by src_ip
| sort - count
| head 20</code></pre>
<h4>Splunk: Firewall Rule Hit Count</h4>
<pre><code>index=main source="pfsense"
| stats count by rule_name
| sort - count</code></pre>
<h4>Splunk: Geographic Analysis (Requires IP Geolocation)</h4>
<pre><code>index=main source="pfsense"
| iplocation src_ip
| stats count by Country
| geom geo_countries featureIdField=Country</code></pre>
<h4>Splunk: Timeline of Attack</h4>
<pre><code>index=main source="pfsense" src_ip="<malicious_ip>"
| timechart span=1m count by dest_port</code></pre>
<h4>ELK/Kibana: Failed Connection Attempts</h4>