chiwormjava 2.0.3 → 2.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/readme.md +851 -170
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chiwormjava",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
package/readme.md CHANGED
@@ -43,206 +43,833 @@ javacodewatch
43
43
  ---
44
44
 
45
45
  ---
46
+ Step 1: Place devices
47
+ Add in Packet Tracer:
48
+ 2 Routers (2621XM)
49
+ 2 Switches (2960)
50
+ 4 PCs
51
+
52
+ Arrange as:
53
+ PC1 PC2 PC3 PC4
54
+ | | | |
55
+ Switch1 Switch2
56
+ | |
57
+ Router1 ---- WAN ---- Router2
58
+
59
+ Step 2: Add Serial Ports
60
+ Click Router -> Physical tab
61
+ Turn Power OFF
62
+ Insert WIC-2T module
63
+ Turn Power ON
64
+ Now Serial0/0/0 and Serial0/0/1 will be available
65
+
66
+ Step 3: Connect cables
67
+ LAN:
68
+ PC to Switch using Copper Straight-Through
69
+ Switch to Router using Copper Straight-Through
70
+
71
+ WAN:
72
+ Use Serial DCE cable
73
+ Router1 Serial0/0/0 to Router2 Serial0/0/0
74
+
75
+ Step 4: Configure Router1
76
+ enable
77
+ configure terminal
46
78
 
47
- ## Step 2: Add Serial Ports (MOST IMPORTANT FIX)
79
+ interface gigabitEthernet 0/0
80
+ ip address 192.168.1.1 255.255.255.0
81
+ no shutdown
82
+ exit
48
83
 
49
- By default, routers don’t have serial ports.
84
+ interface serial 0/0/0
85
+ ip address 172.16.1.1 255.255.255.252
86
+ clock rate 64000
87
+ no shutdown
88
+ exit
50
89
 
51
- ### Do this for BOTH routers:
90
+ Step 5: Configure Router2
91
+ enable
92
+ configure terminal
52
93
 
53
- 1. Click Router → **Physical tab**
54
- 2. Turn **Power OFF**
55
- 3. From modules:
56
- Drag **WIC-2T** into slot
57
- 4. Turn **Power ON**
94
+ interface gigabitEthernet 0/0
95
+ ip address 10.0.0.1 255.255.255.248
96
+ no shutdown
97
+ exit
98
+
99
+ interface serial 0/0/0
100
+ ip address 172.16.1.2 255.255.255.252
101
+ no shutdown
102
+ exit
58
103
 
59
- Now you will see:
104
+ Step 6: Configure PCs
105
+ Left network:
106
+ PC1 IP 192.168.1.2 Mask 255.255.255.0 Gateway 192.168.1.1
107
+ PC2 IP 192.168.1.3 Gateway 192.168.1.1
60
108
 
61
- ```
62
- Serial0/0/0
63
- Serial0/0/1
64
- ```
109
+ Right network:
110
+ PC3 IP 10.0.0.2 Mask 255.255.255.248 Gateway 10.0.0.1
111
+ PC4 IP 10.0.0.3 Gateway 10.0.0.1
65
112
 
66
- ---
113
+ Step 7: Configure Routing
114
+ Router1:
115
+ ip route 10.0.0.0 255.255.255.248 172.16.1.2
67
116
 
68
- ## Step 3: Connect cables (CORRECT WAY)
117
+ Router2:
118
+ ip route 192.168.1.0 255.255.255.0 172.16.1.1
69
119
 
70
- ### LAN connections
120
+ Step 8: Verify interfaces
121
+ Run:
122
+ show ip interface brief
71
123
 
72
- * PC Switch → **Copper Straight-Through**
73
- * Switch Router (Gig0/0 or Fa0/0) → **Copper Straight-Through**
124
+ Status should be up up
125
+ If not, use no shutdown
74
126
 
75
- ---
127
+ Step 9: Test connectivity
128
+ From PC1:
129
+ ping 10.0.0.2
76
130
 
77
- ### WAN connection (Router ↔ Router)
131
+ Expected reply from destination
78
132
 
79
- * Select **Serial DCE cable**
80
- * Router1 → `Serial0/0/0`
81
- * Router2 → `Serial0/0/0`
133
+ Step 10: Simulation Mode
134
+ Click Simulation
135
+ Reset Simulation
136
+ Edit Filters and select ARP and ICMP
82
137
 
83
- ---
138
+ Send packet using Add Simple PDU from PC1 to PC3
139
+ Click Play or Capture/Forward
84
140
 
85
- ## Step 4: Configure Router1
141
+ Expected packet flow:
142
+ PC1 -> Switch1 -> Router1 -> Router2 -> Switch2 -> PC3
86
143
 
87
- Go to CLI:
144
+ First ARP then ICMP communication successful
88
145
 
89
- ```bash
146
+
147
+
148
+ Step 1: Setting Up the Topology
149
+ Add devices:
150
+ 1 Router (2911 or similar)
151
+ 1 Switch (2960)
152
+ 3 PCs (PC0, PC1, PC2)
153
+ 1 Cloud or Server
154
+
155
+ Step 2: Assign IP Addresses
156
+ Private Network:
157
+ PC0 IP 192.168.1.2 Mask 255.255.255.0 Gateway 192.168.1.1
158
+ PC1 IP 192.168.1.3 Mask 255.255.255.0 Gateway 192.168.1.1
159
+ PC2 IP 192.168.1.4 Mask 255.255.255.0 Gateway 192.168.1.1
160
+
161
+ Step 3: Configure Router Interfaces
162
+ Router> enable
163
+ Router# configure terminal
164
+
165
+ Interface gig0/0
166
+ Router(config)# interface gig0/0
167
+ Router(config-if)# ip address 192.168.1.1 255.255.255.0
168
+ Router(config-if)# no shutdown
169
+
170
+ Interface gig0/1
171
+ Router(config)# interface gig0/1
172
+ Router(config-if)# ip address 203.0.113.1 255.255.255.0
173
+ Router(config-if)# no shutdown
174
+
175
+ Assign IP to Cloud/Server
176
+ IP 203.0.113.2
177
+ Mask 255.255.255.0
178
+
179
+ Step 4: Configure NAT
180
+ Define inside and outside interfaces
181
+ Router(config)# interface gig0/0
182
+ Router(config-if)# ip nat inside
183
+ Router(config-if)# exit
184
+
185
+ Router(config)# interface gig0/1
186
+ Router(config-if)# ip nat outside
187
+ Router(config-if)# exit
188
+
189
+ Configure PAT
190
+ Router(config)# access-list 1 permit 192.168.1.0 0.0.0.255
191
+ Router(config)# ip nat inside source list 1 interface gig0/1 overload
192
+
193
+ Step 5: Configure Routing
194
+ Router(config)# ip route 0.0.0.0 0.0.0.0 203.0.113.2
195
+
196
+ Step 6: Test Configuration
197
+ From PC command prompt:
198
+ ping 203.0.113.2
199
+
200
+ If reply is received, NAT is working
201
+
202
+ Verify NAT translations
203
+ Router# show ip nat translations
204
+
205
+
206
+
207
+
208
+
209
+
210
+
211
+
212
+
213
+
214
+
215
+
216
+
217
+
218
+
219
+
220
+
221
+
222
+
223
+
224
+
225
+ AIM:
226
+ To analyze packet fragmentation by changing packet size and observing its effect using Wireshark.
227
+
228
+ Step 1: Open Wireshark
229
+ Launch Wireshark
230
+ Select active interface (WiFi or Ethernet)
231
+ Click Start Capture
232
+
233
+ Step 2: Check MTU size
234
+ Open Command Prompt and run:
235
+ netsh interface ipv4 show subinterfaces
236
+ Note MTU value (usually 1500 bytes)
237
+
238
+ Step 3: Test without fragmentation
239
+ ping 8.8.8.8 -f -l 1472
240
+ 1472 + 28 header = 1500, fits MTU
241
+ Output: Reply received, no fragmentation
242
+
243
+ Step 4: Force fragmentation error
244
+ ping 8.8.8.8 -f -l 2000
245
+ Output: Packet needs to be fragmented but DF set
246
+ Meaning: Packet too large and fragmentation not allowed
247
+
248
+ Step 5: Allow fragmentation
249
+ ping 8.8.8.8 -l 2000
250
+ Packet is divided into fragments
251
+ May observe delay or packet loss
252
+
253
+ Step 6: Analyze in Wireshark
254
+ Apply filter:
255
+ ip.flags.mf == 1 or ip.frag_offset > 0
256
+
257
+ Observation:
258
+ Multiple packets for single ping
259
+ Fragmented packets visible
260
+
261
+ Observations:
262
+ Fragmented packets have same Identification ID
263
+ Different Fragment Offset values
264
+ MF flag indicates more fragments
265
+ Last packet has MF = 0
266
+
267
+ Performance Impact:
268
+ More packets generated
269
+ Increased delay
270
+ Possible packet loss
271
+
272
+ Final Observation:
273
+ Small packet: No fragmentation
274
+ Large packet with DF: Error
275
+ Large packet without DF: Fragmentation occurs
276
+
277
+ Conclusion:
278
+ If packet size exceeds MTU, it is divided into smaller fragments, affecting performance
279
+
280
+ Output:
281
+ Ping command results showing success or error
282
+ Wireshark showing fragmented packets using filter
283
+
284
+ Result:
285
+ Fragmentation observed and analyzed successfully
286
+
287
+
288
+
289
+
290
+
291
+
292
+
293
+
294
+
295
+
296
+
297
+
298
+
299
+
300
+
301
+
302
+
303
+
304
+
305
+ AIM:
306
+ To identify vulnerabilities and secure the network using Access Control List (ACL) and Port Security.
307
+
308
+ Step 1: Topology Setup
309
+ Add devices:
310
+ 1 Router (2911)
311
+ 1 Switch (2960)
312
+ 2 PCs
313
+
314
+ Step 2: Connections
315
+ PC1 FastEthernet0 to Switch Fa0/1 using Copper Straight-Through
316
+ PC2 FastEthernet0 to Switch Fa0/2 using Copper Straight-Through
317
+ Switch Fa0/24 to Router GigabitEthernet0/0
318
+
319
+ Step 3: Configure PCs
320
+ PC1 IP 192.168.1.10 Mask 255.255.255.0 Gateway 192.168.1.1
321
+ PC2 IP 192.168.1.20 Mask 255.255.255.0 Gateway 192.168.1.1
322
+
323
+ Step 4: Configure Router
90
324
  enable
91
325
  configure terminal
326
+ interface g0/0
327
+ ip address 192.168.1.1 255.255.255.0
328
+ no shutdown
329
+ exit
92
330
 
93
- interface gigabitEthernet 0/0
331
+ Step 5: Test Before Security
332
+ From PC2:
333
+ ping 192.168.1.10
334
+ Communication should be successful
335
+
336
+ Step 6: Apply ACL
337
+ access-list 1 deny 192.168.1.20
338
+ access-list 1 permit any
339
+
340
+ Apply ACL:
341
+ interface g0/0
342
+ ip access-group 1 in
343
+ exit
344
+
345
+ Step 7: Test After Security
346
+ From PC2:
347
+ ping 192.168.1.10
348
+ Should fail
349
+
350
+ From PC1:
351
+ ping 192.168.1.20
352
+ Should work
353
+
354
+ Step 8: Configure Port Security on Switch
355
+ enable
356
+ configure terminal
357
+ interface fa0/1
358
+ switchport mode access
359
+ switchport port-security
360
+ switchport port-security maximum 1
361
+ exit
362
+
363
+ Vulnerabilities Identified:
364
+ No access control
365
+ No device restriction
366
+ No traffic filtering
367
+
368
+ Security Measures Applied:
369
+ ACL controls communication between devices
370
+ Port Security restricts number of devices per port
371
+
372
+ Additional Concepts:
373
+ IDS detects suspicious activities such as unusual traffic
374
+ IPsec encrypts data for secure transmission
375
+
376
+ Simulation (Optional):
377
+ Use Simulation mode
378
+ Filter ICMP
379
+ Observe packet drop due to ACL
380
+
381
+ Final Result:
382
+ PC2 is blocked
383
+ PC1 is allowed
384
+ Switch ports are secured
385
+ Network is protected successfully
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
+ AIM:
411
+ To demonstrate IP Spoofing attack and implement security measures to prevent unauthorized access.
412
+
413
+ Step 1: Topology Setup
414
+ Devices required:
415
+ 1 Router (2911)
416
+ 1 Switch (2960)
417
+ PC1 (Trusted user)
418
+ PC2 (Attacker)
419
+ 1 Server
420
+
421
+ Connections:
422
+ PC1 to Switch Fa0/1
423
+ PC2 to Switch Fa0/2
424
+ Switch Fa0/24 to Router G0/0
425
+ Server to Router G0/1
426
+
427
+ Step 2: IP Configuration
428
+ PC1 IP 192.168.1.10 Gateway 192.168.1.1
429
+ PC2 IP 192.168.1.20 Gateway 192.168.1.1
430
+ Server IP 10.0.0.2 Gateway 10.0.0.1
431
+
432
+ Step 3: Configure Router
433
+ enable
434
+ configure terminal
435
+
436
+ interface g0/0
94
437
  ip address 192.168.1.1 255.255.255.0
95
438
  no shutdown
96
439
  exit
97
440
 
98
- interface serial 0/0/0
99
- ip address 172.16.1.1 255.255.255.252
100
- clock rate 64000
441
+ interface g0/1
442
+ ip address 10.0.0.1 255.255.255.0
101
443
  no shutdown
102
444
  exit
103
- ```
104
445
 
105
- ---
446
+ Step 4: Configure Routing
447
+ ip route 10.0.0.0 255.255.255.0 10.0.0.1
106
448
 
107
- ## Step 5: Configure Router2
449
+ Step 5: Apply Trust-Based ACL
450
+ access-list 10 permit 192.168.1.10
451
+ access-list 10 deny any
108
452
 
109
- ```bash
453
+ interface g0/0
454
+ ip access-group 10 in
455
+
456
+ Step 6: Test Before Attack
457
+ From PC1:
458
+ ping 10.0.0.2 (should work)
459
+
460
+ From PC2:
461
+ ping 10.0.0.2 (should fail)
462
+
463
+ Step 7: Simulate IP Spoofing
464
+ Change PC2 IP to 192.168.1.10
465
+
466
+ Test again:
467
+ ping 10.0.0.2 (should work)
468
+
469
+ Step 8: Impact
470
+ Unauthorized access
471
+ Security bypass
472
+ Fake identity
473
+
474
+ Step 9: Countermeasure 1 Anti-Spoofing ACL
475
+ ip access-list extended ANTI-SPOOF
476
+ deny ip 192.168.1.0 0.0.0.255 any
477
+ permit ip any any
478
+
479
+ interface g0/1
480
+ ip access-group ANTI-SPOOF in
481
+
482
+ Step 10: Countermeasure 2 uRPF
483
+ interface g0/0
484
+ ip verify unicast source reachable-via rx
485
+
486
+ Step 11: Switch Port Security
110
487
  enable
111
488
  configure terminal
112
489
 
113
- interface gigabitEthernet 0/0
114
- ip address 10.0.0.1 255.255.255.248
490
+ interface fa0/1
491
+ switchport mode access
492
+ switchport port-security
493
+ switchport port-security maximum 1
494
+ switchport port-security mac-address sticky
495
+ switchport port-security violation shutdown
496
+
497
+ Final Understanding:
498
+ Before ACL everyone allowed
499
+ ACL allows only trusted IP
500
+ Spoofing bypasses security
501
+ uRPF blocks spoofed packets
502
+
503
+ Conclusion:
504
+ IP-based trust is not secure and must be verified using mechanisms like uRPF and port security
505
+
506
+ Result:
507
+ Attack simulated successfully
508
+ Vulnerability identified
509
+ Security measures implemented
510
+
511
+
512
+
513
+
514
+
515
+
516
+
517
+
518
+
519
+
520
+
521
+
522
+
523
+
524
+
525
+
526
+
527
+
528
+
529
+
530
+
531
+
532
+
533
+ AIM:
534
+ To allow normal UDP communication and block unwanted UDP traffic using ACL.
535
+
536
+ Step 1: Build the Network
537
+ Devices required:
538
+ 1 Router (2911)
539
+ 1 Switch (2960)
540
+ PC1 (Client)
541
+ PC2 (Attacker)
542
+ 1 Server
543
+
544
+ Connections:
545
+ PC1 FastEthernet0 to Switch Fa0/1
546
+ PC2 FastEthernet0 to Switch Fa0/2
547
+ Server FastEthernet0 to Switch Fa0/3
548
+ Switch Fa0/24 to Router GigabitEthernet0/0
549
+
550
+ Step 2: IP Configuration
551
+ PC1 IP 192.168.1.10 Gateway 192.168.1.1
552
+ PC2 IP 192.168.1.30 Gateway 192.168.1.1
553
+ Server IP 192.168.1.20
554
+ Subnet Mask 255.255.255.0
555
+
556
+ Step 3: Configure Router
557
+ enable
558
+ configure terminal
559
+ interface g0/0
560
+ ip address 192.168.1.1 255.255.255.0
115
561
  no shutdown
116
562
  exit
117
563
 
118
- interface serial 0/0/0
119
- ip address 172.16.1.2 255.255.255.252
564
+ Step 4: Enable UDP Service on Server
565
+ Open Server -> Services -> DNS
566
+ Turn DNS ON
567
+ Add entry:
568
+ Name example.com
569
+ Address 192.168.1.20
570
+
571
+ Step 5: Test UDP Communication
572
+ From PC1:
573
+ nslookup example.com 192.168.1.20
574
+ UDP communication should work
575
+
576
+ Step 6: Apply ACL to Block Attacker
577
+ Router(config)# access-list 100 deny udp host 192.168.1.30 any
578
+ Router(config)# access-list 100 permit ip any any
579
+
580
+ Apply ACL:
581
+ interface g0/0
582
+ ip access-group 100 in
583
+ exit
584
+
585
+ Step 7: Test After ACL
586
+ From PC2:
587
+ nslookup example.com 192.168.1.20 (should fail)
588
+
589
+ From PC1:
590
+ nslookup example.com 192.168.1.20 (should work)
591
+
592
+ Step 8: Block DNS Service (Port-Based ACL)
593
+ Router(config)# access-list 101 deny udp any any eq 53
594
+ Router(config)# access-list 101 permit ip any any
595
+
596
+ Apply:
597
+ interface g0/0
598
+ ip access-group 101 in
599
+ exit
600
+
601
+ Test:
602
+ From PC1:
603
+ nslookup example.com 192.168.1.20 (should fail)
604
+
605
+ Step 9: Important Concept
606
+ If all devices are in same network, traffic bypasses router
607
+ Communication becomes PC -> Switch -> Server
608
+ ACL will not work
609
+
610
+ Step 10: Fix Topology
611
+ Change Server network:
612
+ Server IP 10.0.0.2 Gateway 10.0.0.1
613
+
614
+ Configure Router:
615
+ interface g0/1
616
+ ip address 10.0.0.1 255.255.255.0
617
+ no shutdown
618
+
619
+ Now traffic flows through router:
620
+ PC -> Router -> Server
621
+ ACL works correctly
622
+
623
+ Concepts:
624
+ UDP is fast and connectionless protocol
625
+ ACL filters traffic based on rules
626
+ Port 53 is used for DNS
627
+ Router must be in path for ACL to work
628
+
629
+ Result:
630
+ UDP communication tested
631
+ Attacker blocked using ACL
632
+ DNS service blocked using port-based ACL
633
+ Network secured successfully
634
+
635
+
636
+
637
+
638
+
639
+
640
+
641
+
642
+
643
+
644
+
645
+
646
+
647
+
648
+
649
+
650
+
651
+
652
+
653
+
654
+
655
+
656
+
657
+ AIM:
658
+ Create a network, enable DNS (UDP), allow normal user, and block attacker using ACL.
659
+
660
+ Step 1: Topology
661
+ PC1 (Client) and PC2 (Attacker) connected to Switch
662
+ Switch connected to Router G0/0
663
+ Router G0/1 connected to Server
664
+
665
+ Step 2: Connections
666
+ Use Copper Straight-Through cables
667
+ PC1 to Switch Fa0/1
668
+ PC2 to Switch Fa0/2
669
+ Switch to Router G0/0
670
+ Router G0/1 to Server
671
+ All links should be active
672
+
673
+ Step 3: IP Configuration
674
+ PC1 IP 192.168.1.10 Mask 255.255.255.0 Gateway 192.168.1.1 DNS 10.0.0.2
675
+ PC2 IP 192.168.1.30 Mask 255.255.255.0 Gateway 192.168.1.1 DNS 10.0.0.2
676
+ Server IP 10.0.0.2 Mask 255.255.255.0 Gateway 10.0.0.1
677
+
678
+ Step 4: Router Configuration
679
+ enable
680
+ configure terminal
681
+
682
+ interface g0/0
683
+ ip address 192.168.1.1 255.255.255.0
120
684
  no shutdown
121
685
  exit
122
- ```
123
686
 
124
- ---
687
+ interface g0/1
688
+ ip address 10.0.0.1 255.255.255.0
689
+ no shutdown
690
+ exit
691
+
692
+ Step 5: Enable DNS on Server
693
+ Open Server -> Services -> DNS
694
+ Turn DNS ON
695
+ Add entry:
696
+ Name example.com
697
+ Address 10.0.0.2
698
+
699
+ Step 6: Initial Testing
700
+ From PC1:
701
+ ping 10.0.0.2
702
+ This builds ARP
703
+
704
+ Then:
705
+ nslookup example.com
706
+ Should work successfully
707
+
708
+ Step 7: Apply ACL Security
709
+ configure terminal
710
+
711
+ access-list 101 deny udp host 192.168.1.30 any
712
+ access-list 101 permit ip any any
713
+
714
+ interface g0/0
715
+ ip access-group 101 in
716
+ exit
717
+
718
+ Step 8: Final Testing
719
+ From PC1:
720
+ nslookup example.com
721
+ Should work
722
+
723
+ From PC2:
724
+ nslookup example.com
725
+ Should fail
726
+
727
+ Concepts:
728
+ Router must be in path for ACL to work
729
+ DNS uses UDP port 53
730
+ First ping builds ARP and avoids timeout
731
+ ACL filters traffic based on rules
732
+
733
+ Final Result:
734
+ PC1 allowed
735
+ PC2 blocked
736
+ DNS working
737
+ ACL applied successfully
738
+
739
+
740
+
741
+
742
+
743
+
125
744
 
126
- ## Step 6: Configure PCs
127
745
 
128
- ### Left network (Router1 side)
129
746
 
130
- * PC1
131
- IP: `192.168.1.2`
132
- Mask: `255.255.255.0`
133
- Gateway: `192.168.1.1`
134
747
 
135
- * PC2
136
- IP: `192.168.1.3`
137
- Gateway: `192.168.1.1`
138
748
 
139
- ---
140
749
 
141
- ### Right network (Router2 side)
142
750
 
143
- * PC3
144
- IP: `10.0.0.2`
145
- Mask: `255.255.255.248`
146
- Gateway: `10.0.0.1`
147
751
 
148
- * PC4
149
- IP: `10.0.0.3`
150
- Gateway: `10.0.0.1`
151
752
 
152
- ---
153
753
 
154
- ## Step 7: Configure Routing (VERY IMPORTANT)
155
754
 
156
- ### Router1:
157
755
 
158
- ```bash
159
- ip route 10.0.0.0 255.255.255.248 172.16.1.2
160
- ```
161
756
 
162
- ### Router2:
163
757
 
164
- ```bash
165
- ip route 192.168.1.0 255.255.255.0 172.16.1.1
166
- ```
167
758
 
168
- ---
169
759
 
170
- ## Step 8: Verify interfaces
171
760
 
172
- Run on both routers:
173
761
 
174
- ```bash
175
- show ip interface brief
176
- ```
177
762
 
178
- You MUST see:
179
763
 
180
- ```
181
- up up
182
- ```
183
764
 
184
- If not:
185
- Use `no shutdown`
186
765
 
187
- ---
188
766
 
189
- ## Step 9: Test connectivity
767
+ AIM:
768
+ Simulate a DNS-based UDP hijacking scenario, observe its impact on the client, and apply basic protection.
190
769
 
770
+ Step 1: Topology Setup
771
+ Connect devices using Copper Straight-Through:
772
+ PC1 to Switch
773
+ PC2 to Switch
774
+ Server to Switch
775
+ Switch to Router
776
+ Ensure all connections are active
777
+
778
+ Step 2: IP Configuration
779
+ PC1 IP 192.168.1.10 Mask 255.255.255.0 Gateway 192.168.1.1 DNS 192.168.1.100
780
+ PC2 IP 192.168.1.20 Gateway 192.168.1.1
781
+ Server IP 192.168.1.100 Gateway 192.168.1.1
782
+
783
+ Step 3: Router Configuration
784
+ enable
785
+ configure terminal
786
+ interface g0/0
787
+ ip address 192.168.1.1 255.255.255.0
788
+ no shutdown
789
+ exit
790
+
791
+ Step 4: Enable DNS on Real Server
792
+ Open Server -> Services -> DNS
793
+ Turn DNS ON
794
+ Add entry:
795
+ example.com maps to 192.168.1.100
796
+
797
+ Step 5: Test Normal Output
191
798
  From PC1:
799
+ nslookup example.com
800
+ Expected result:
801
+ Name example.com
802
+ Address 192.168.1.100
803
+
804
+ Step 6: Simulate Attack
805
+ Turn OFF real server
806
+ On PC2 change IP to 192.168.1.100
807
+ Enable DNS on PC2
808
+ Add entry:
809
+ example.com maps to 5.5.5.5
810
+
811
+ Step 7: Test Attack Output
812
+ From PC1:
813
+ nslookup example.com
814
+ Expected result:
815
+ Name example.com
816
+ Address 5.5.5.5
817
+
818
+ Observation:
819
+ Before attack DNS resolves to 192.168.1.100
820
+ After attack DNS resolves to 5.5.5.5
821
+ Client is misled
822
+
823
+ Step 8: Apply Basic Protection using Port Security
824
+ On Switch CLI:
825
+ enable
826
+ configure terminal
827
+ interface fa0/2
828
+ switchport mode access
829
+ switchport port-security
830
+ switchport port-security maximum 1
831
+ switchport port-security mac-address sticky
832
+ switchport port-security violation shutdown
833
+ exit
192
834
 
193
- ```bash
194
- ping 10.0.0.2
195
- ```
835
+ Step 9: Final Check
836
+ Attempt attack again
837
+ Port security blocks attacker or shuts down port
196
838
 
197
- Expected:
839
+ Output Observation Methods:
840
+ Command Line:
841
+ Use nslookup example.com before and after attack
198
842
 
199
- ```
200
- Reply from 10.0.0.2
201
- ```
843
+ Simulation Mode:
844
+ Select Simulation
845
+ Filter DNS or UDP
846
+ Run nslookup
847
+ Observe source IP, destination IP, and UDP port 53
202
848
 
203
- ---
849
+ Conclusion:
850
+ DNS over UDP can be exploited by spoofing
851
+ Client blindly trusts DNS response
852
+ Security measures like port security help prevent attacks
204
853
 
205
- ## Step 10: See animation (Simulation Mode)
854
+ Result:
855
+ Attack successfully simulated
856
+ Impact observed
857
+ Basic protection applied
206
858
 
207
- 1. Click **Simulation**
208
- 2. Click **Reset Simulation**
209
- 3. Click **Edit Filters**
210
859
 
211
- * Select only:
212
860
 
213
- ```
214
- ARP
215
- ICMP
216
- ```
217
861
 
218
- ---
219
862
 
220
- ### Send packet
221
863
 
222
- * Click **Add Simple PDU (envelope icon)**
223
- * Click **PC1 → PC3**
224
864
 
225
- ---
226
865
 
227
- ### Play
228
866
 
229
- * Click ▶ play or ⏭ Capture/Forward
230
867
 
231
- ---
232
868
 
233
- ## 👀 What you should see
234
869
 
235
- Packet flow:
236
870
 
237
- ```
238
- PC1 → Switch1 → Router1 → Router2 → Switch2 → PC3
239
- ```
240
871
 
241
- * First ARP (finding MAC)
242
- * Then ICMP (ping)
243
- * All **green ✔**
244
872
 
245
- ---
246
873
 
247
874
 
248
875
 
@@ -261,19 +888,126 @@ PC1 → Switch1 → Router1 → Router2 → Switch2 → PC3
261
888
 
262
889
 
263
890
 
891
+ AIM:
892
+ Simulate a DoS condition using continuous requests, observe its impact on a server, and apply prevention techniques.
264
893
 
894
+ Step 1: Topology
895
+ Devices:
896
+ PC1, PC2, PC3, Server connected to Switch
897
+ Switch connected to Router G0/0
898
+ Ensure all connections are active
265
899
 
900
+ Step 2: IP Configuration
901
+ PC1 IP 192.168.1.10
902
+ PC2 IP 192.168.1.20
903
+ PC3 IP 192.168.1.30
904
+ Server IP 192.168.1.100
905
+ Mask 255.255.255.0
906
+ Gateway 192.168.1.1
266
907
 
908
+ Step 3: Router Configuration
909
+ enable
910
+ configure terminal
911
+ interface g0/0
912
+ ip address 192.168.1.1 255.255.255.0
913
+ no shutdown
914
+ exit
267
915
 
916
+ Step 4: Enable Server Service
917
+ Open Server -> Services -> HTTP
918
+ Turn HTTP ON
268
919
 
920
+ Step 5: Normal Test
921
+ From PC1:
922
+ ping 192.168.1.100
923
+ Stable replies indicate normal operation
269
924
 
925
+ Step 6: Simulate DoS Attack
926
+ From PC2:
927
+ ping 192.168.1.100 -t
270
928
 
929
+ From PC3:
930
+ ping 192.168.1.100 -t
271
931
 
932
+ Continuous traffic is generated
272
933
 
934
+ Step 7: Observe Impact
935
+ From PC1:
936
+ ping 192.168.1.100
273
937
 
938
+ Expected results:
939
+ Request timed out
940
+ High delay
941
+ Packet loss
274
942
 
943
+ Indicates server overload and network congestion
275
944
 
945
+ Step 8: Important Concept
946
+ If all devices are in same network, traffic flows directly
947
+ PC -> Switch -> Server
948
+ Router is bypassed
949
+ ACL on router will not work
276
950
 
951
+ Step 9: Apply Switch Port Security
952
+ enable
953
+ configure terminal
954
+
955
+ interface fa0/2
956
+ switchport port-security
957
+ switchport port-security maximum 1
958
+ switchport port-security violation shutdown
959
+ exit
960
+
961
+ interface fa0/3
962
+ switchport port-security
963
+ switchport port-security maximum 1
964
+ switchport port-security violation shutdown
965
+ exit
966
+
967
+ Limits attacker behavior
968
+
969
+ Step 10: Improved Topology for Router Control
970
+ Change Server network:
971
+ Server IP 10.0.0.2 Gateway 10.0.0.1
972
+
973
+ Add router interface:
974
+ interface g0/1
975
+ ip address 10.0.0.1 255.255.255.0
976
+ no shutdown
977
+
978
+ Traffic now passes through router
979
+
980
+ Step 11: Apply ACL Protection
981
+ ip access-list extended BLOCK_ICMP
982
+ permit icmp host 192.168.1.10 host 10.0.0.2
983
+ deny icmp any any
984
+
985
+ interface g0/0
986
+ ip access-group BLOCK_ICMP in
987
+
988
+ Step 12: Final Testing
989
+ From PC1:
990
+ ping 10.0.0.2 (should work)
991
+
992
+ From PC2 and PC3:
993
+ ping 10.0.0.2 (should fail)
994
+
995
+ Output Observation:
996
+ Command Line:
997
+ Compare ping before and during attack
998
+
999
+ Simulation Mode:
1000
+ Filter ICMP
1001
+ Observe multiple packets and congestion
1002
+
1003
+ Conclusion:
1004
+ DoS attack floods server with requests causing delay and packet loss
1005
+ Switch port security and ACL help control traffic
1006
+
1007
+ Result:
1008
+ Attack simulated
1009
+ Impact observed
1010
+ Protection applied successfully
277
1011
 
278
1012
 
279
1013
 
@@ -289,57 +1023,4 @@ PC1 → Switch1 → Router1 → Router2 → Switch2 → PC3
289
1023
 
290
1024
 
291
1025
 
292
- Step 1: Setting Up the Topology
293
- 1. Add Devices to the Workspace:
294
- o Drag and drop:
295
- ▪ 1 Router (e.g., 2911 or similar).
296
- ▪ 1 Switch (e.g., 2960).
297
- ▪ 3 PCs (PC-0, PC-1, PC-2).
298
- ▪ 1 Cloud or Server (representing the internet).
299
- Step 2: Assign IP Addresses
300
- For Private Network (PCs and Router Internal Interface)
301
- ● Assign Private IP Addresses to the PCs:
302
- o PC-0: IP Address: 192.168.1.2 | Subnet Mask: 255.255.255.0 | Default Gateway:
303
- 192.168.1.1
304
- o PC-1: IP Address: 192.168.1.3 | Subnet Mask: 255.255.255.0 | Default Gateway:
305
- 192.168.1.1
306
- o PC-2: IP Address: 192.168.1.4 | Subnet Mask: 255.255.255.0 | Default Gateway:
307
- 192.168.1.1
308
- Step 3: Configure Router interface
309
- 1) gig0/0
310
- Router> enable
311
- Router# configure terminal
312
- Router(config)# interface gig0/0
313
- Router(config-if)# ip address 192.168.1.1 255.255.255.0
314
- Router(config-if)# no shutdown
315
- 2) gig0/1
316
- Router(config)# interface gig0/1
317
- Router(config-if)# ip address 203.0.113.1 255.255.255.0
318
- Router(config-if)# no shutdown
319
- 3) Assign an IP Address to the Cloud or Server:
320
- a. Cloud/Server IP Address: 203.0.113.2
321
- b. Subnet Mask: 255.255.255.0
322
- Step 4: Configure NAT on the Router
323
- Define Inside and Outside Interfaces
324
- Router(config)# interface gig0/0
325
- Router(config-if)# ip nat inside
326
- Router(config-if)# exit
327
- Router(config)# interface gig0/1
328
- Router(config-if)# ip nat outside
329
- Router(config-if)# exit
330
- Set Up PAT (Port Address Translation)
331
- Allow multiple private IPs to share one public IP:
332
- Router(config)# access-list 1 permit 192.168.1.0 0.0.0.255
333
- Router(config)# ip nat inside source list 1 interface gig0/1 overload
334
- Step 5: Configure Routing
335
- Add a Default Route to direct traffic to the public network
336
- Router(config)# ip route 0.0.0.0 0.0.0.0 203.0.113.2
337
- Step 6: Test the Configuration
338
- Test Internet Access from PCs
339
- 1. Open the Command Prompt on any PC.
340
- 2. Ping the external Cloud/Server (e.g., ping 203.0.113.2).
341
- o If successful, NAT is working correctly.
342
- Verify NAT Translations on the Router
343
- On the router CLI, use the following command to see active NAT translations:
344
- Router# show ip nat translations
345
1026