chiwormjava 2.0.2 → 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.
- package/java.json +29 -52
- package/package.json +1 -1
- package/readme.md +645 -993
package/java.json
CHANGED
|
@@ -1,62 +1,39 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
"title": "
|
|
4
|
-
"code": "
|
|
2
|
+
"classful_classless_routing_practical": {
|
|
3
|
+
"title": "Classful and Classless Routing Configuration using Packet Tracer",
|
|
4
|
+
"code": "Step 1: Place devices\\nAdd in Packet Tracer:\\n2 Routers (2621XM)\\n2 Switches (2960)\\n4 PCs\\n\\nArrange as:\\nPC1 PC2 PC3 PC4\\n | | | |\\nSwitch1 Switch2\\n | |\\n Router1 ---- WAN ---- Router2\\n\\nStep 2: Add Serial Ports\\nClick Router -> Physical tab\\nTurn Power OFF\\nInsert WIC-2T module\\nTurn Power ON\\nNow Serial0/0/0 and Serial0/0/1 will be available\\n\\nStep 3: Connect cables\\nLAN:\\nPC to Switch using Copper Straight-Through\\nSwitch to Router using Copper Straight-Through\\n\\nWAN:\\nUse Serial DCE cable\\nRouter1 Serial0/0/0 to Router2 Serial0/0/0\\n\\nStep 4: Configure Router1\\nenable\\nconfigure terminal\\n\\ninterface gigabitEthernet 0/0\\nip address 192.168.1.1 255.255.255.0\\nno shutdown\\nexit\\n\\ninterface serial 0/0/0\\nip address 172.16.1.1 255.255.255.252\\nclock rate 64000\\nno shutdown\\nexit\\n\\nStep 5: Configure Router2\\nenable\\nconfigure terminal\\n\\ninterface gigabitEthernet 0/0\\nip address 10.0.0.1 255.255.255.248\\nno shutdown\\nexit\\n\\ninterface serial 0/0/0\\nip address 172.16.1.2 255.255.255.252\\nno shutdown\\nexit\\n\\nStep 6: Configure PCs\\nLeft network:\\nPC1 IP 192.168.1.2 Mask 255.255.255.0 Gateway 192.168.1.1\\nPC2 IP 192.168.1.3 Gateway 192.168.1.1\\n\\nRight network:\\nPC3 IP 10.0.0.2 Mask 255.255.255.248 Gateway 10.0.0.1\\nPC4 IP 10.0.0.3 Gateway 10.0.0.1\\n\\nStep 7: Configure Routing\\nRouter1:\\nip route 10.0.0.0 255.255.255.248 172.16.1.2\\n\\nRouter2:\\nip route 192.168.1.0 255.255.255.0 172.16.1.1\\n\\nStep 8: Verify interfaces\\nRun:\\nshow ip interface brief\\n\\nStatus should be up up\\nIf not, use no shutdown\\n\\nStep 9: Test connectivity\\nFrom PC1:\\nping 10.0.0.2\\n\\nExpected reply from destination\\n\\nStep 10: Simulation Mode\\nClick Simulation\\nReset Simulation\\nEdit Filters and select ARP and ICMP\\n\\nSend packet using Add Simple PDU from PC1 to PC3\\nClick Play or Capture/Forward\\n\\nExpected packet flow:\\nPC1 -> Switch1 -> Router1 -> Router2 -> Switch2 -> PC3\\n\\nFirst ARP then ICMP communication successful"
|
|
5
5
|
},
|
|
6
|
-
"
|
|
7
|
-
"title": "
|
|
8
|
-
"code": "
|
|
6
|
+
"nat_configuration_practical": {
|
|
7
|
+
"title": "NAT Configuration using Packet Tracer",
|
|
8
|
+
"code": "Step 1: Setting Up the Topology\\nAdd devices:\\n1 Router (2911 or similar)\\n1 Switch (2960)\\n3 PCs (PC0, PC1, PC2)\\n1 Cloud or Server\\n\\nStep 2: Assign IP Addresses\\nPrivate Network:\\nPC0 IP 192.168.1.2 Mask 255.255.255.0 Gateway 192.168.1.1\\nPC1 IP 192.168.1.3 Mask 255.255.255.0 Gateway 192.168.1.1\\nPC2 IP 192.168.1.4 Mask 255.255.255.0 Gateway 192.168.1.1\\n\\nStep 3: Configure Router Interfaces\\nRouter> enable\\nRouter# configure terminal\\n\\nInterface gig0/0\\nRouter(config)# interface gig0/0\\nRouter(config-if)# ip address 192.168.1.1 255.255.255.0\\nRouter(config-if)# no shutdown\\n\\nInterface gig0/1\\nRouter(config)# interface gig0/1\\nRouter(config-if)# ip address 203.0.113.1 255.255.255.0\\nRouter(config-if)# no shutdown\\n\\nAssign IP to Cloud/Server\\nIP 203.0.113.2\\nMask 255.255.255.0\\n\\nStep 4: Configure NAT\\nDefine inside and outside interfaces\\nRouter(config)# interface gig0/0\\nRouter(config-if)# ip nat inside\\nRouter(config-if)# exit\\n\\nRouter(config)# interface gig0/1\\nRouter(config-if)# ip nat outside\\nRouter(config-if)# exit\\n\\nConfigure PAT\\nRouter(config)# access-list 1 permit 192.168.1.0 0.0.0.255\\nRouter(config)# ip nat inside source list 1 interface gig0/1 overload\\n\\nStep 5: Configure Routing\\nRouter(config)# ip route 0.0.0.0 0.0.0.0 203.0.113.2\\n\\nStep 6: Test Configuration\\nFrom PC command prompt:\\nping 203.0.113.2\\n\\nIf reply is received, NAT is working\\n\\nVerify NAT translations\\nRouter# show ip nat translations"
|
|
9
9
|
},
|
|
10
|
-
"
|
|
11
|
-
"title": "
|
|
12
|
-
"code": "
|
|
10
|
+
"packet_fragmentation_analysis": {
|
|
11
|
+
"title": "Packet Fragmentation Analysis using Wireshark",
|
|
12
|
+
"code": "AIM:\\nTo analyze packet fragmentation by changing packet size and observing its effect using Wireshark.\\n\\nStep 1: Open Wireshark\\nLaunch Wireshark\\nSelect active interface (WiFi or Ethernet)\\nClick Start Capture\\n\\nStep 2: Check MTU size\\nOpen Command Prompt and run:\\nnetsh interface ipv4 show subinterfaces\\nNote MTU value (usually 1500 bytes)\\n\\nStep 3: Test without fragmentation\\nping 8.8.8.8 -f -l 1472\\n1472 + 28 header = 1500, fits MTU\\nOutput: Reply received, no fragmentation\\n\\nStep 4: Force fragmentation error\\nping 8.8.8.8 -f -l 2000\\nOutput: Packet needs to be fragmented but DF set\\nMeaning: Packet too large and fragmentation not allowed\\n\\nStep 5: Allow fragmentation\\nping 8.8.8.8 -l 2000\\nPacket is divided into fragments\\nMay observe delay or packet loss\\n\\nStep 6: Analyze in Wireshark\\nApply filter:\\nip.flags.mf == 1 or ip.frag_offset > 0\\n\\nObservation:\\nMultiple packets for single ping\\nFragmented packets visible\\n\\nObservations:\\nFragmented packets have same Identification ID\\nDifferent Fragment Offset values\\nMF flag indicates more fragments\\nLast packet has MF = 0\\n\\nPerformance Impact:\\nMore packets generated\\nIncreased delay\\nPossible packet loss\\n\\nFinal Observation:\\nSmall packet: No fragmentation\\nLarge packet with DF: Error\\nLarge packet without DF: Fragmentation occurs\\n\\nConclusion:\\nIf packet size exceeds MTU, it is divided into smaller fragments, affecting performance\\n\\nOutput:\\nPing command results showing success or error\\nWireshark showing fragmented packets using filter\\n\\nResult:\\nFragmentation observed and analyzed successfully"
|
|
13
13
|
},
|
|
14
|
-
"
|
|
15
|
-
"title": "
|
|
16
|
-
"code": "
|
|
14
|
+
"network_security_acl_port_security": {
|
|
15
|
+
"title": "Network Security using ACL and Port Security",
|
|
16
|
+
"code": "AIM:\\nTo identify vulnerabilities and secure the network using Access Control List (ACL) and Port Security.\\n\\nStep 1: Topology Setup\\nAdd devices:\\n1 Router (2911)\\n1 Switch (2960)\\n2 PCs\\n\\nStep 2: Connections\\nPC1 FastEthernet0 to Switch Fa0/1 using Copper Straight-Through\\nPC2 FastEthernet0 to Switch Fa0/2 using Copper Straight-Through\\nSwitch Fa0/24 to Router GigabitEthernet0/0\\n\\nStep 3: Configure PCs\\nPC1 IP 192.168.1.10 Mask 255.255.255.0 Gateway 192.168.1.1\\nPC2 IP 192.168.1.20 Mask 255.255.255.0 Gateway 192.168.1.1\\n\\nStep 4: Configure Router\\nenable\\nconfigure terminal\\ninterface g0/0\\nip address 192.168.1.1 255.255.255.0\\nno shutdown\\nexit\\n\\nStep 5: Test Before Security\\nFrom PC2:\\nping 192.168.1.10\\nCommunication should be successful\\n\\nStep 6: Apply ACL\\naccess-list 1 deny 192.168.1.20\\naccess-list 1 permit any\\n\\nApply ACL:\\ninterface g0/0\\nip access-group 1 in\\nexit\\n\\nStep 7: Test After Security\\nFrom PC2:\\nping 192.168.1.10\\nShould fail\\n\\nFrom PC1:\\nping 192.168.1.20\\nShould work\\n\\nStep 8: Configure Port Security on Switch\\nenable\\nconfigure terminal\\ninterface fa0/1\\nswitchport mode access\\nswitchport port-security\\nswitchport port-security maximum 1\\nexit\\n\\nVulnerabilities Identified:\\nNo access control\\nNo device restriction\\nNo traffic filtering\\n\\nSecurity Measures Applied:\\nACL controls communication between devices\\nPort Security restricts number of devices per port\\n\\nAdditional Concepts:\\nIDS detects suspicious activities such as unusual traffic\\nIPsec encrypts data for secure transmission\\n\\nSimulation (Optional):\\nUse Simulation mode\\nFilter ICMP\\nObserve packet drop due to ACL\\n\\nFinal Result:\\nPC2 is blocked\\nPC1 is allowed\\nSwitch ports are secured\\nNetwork is protected successfully"
|
|
17
17
|
},
|
|
18
|
-
"
|
|
19
|
-
"title": "
|
|
20
|
-
"code": "
|
|
18
|
+
"ip_spoofing_security_practical": {
|
|
19
|
+
"title": "IP Spoofing Attack and Prevention using ACL and uRPF",
|
|
20
|
+
"code": "AIM:\\nTo demonstrate IP Spoofing attack and implement security measures to prevent unauthorized access.\\n\\nStep 1: Topology Setup\\nDevices required:\\n1 Router (2911)\\n1 Switch (2960)\\nPC1 (Trusted user)\\nPC2 (Attacker)\\n1 Server\\n\\nConnections:\\nPC1 to Switch Fa0/1\\nPC2 to Switch Fa0/2\\nSwitch Fa0/24 to Router G0/0\\nServer to Router G0/1\\n\\nStep 2: IP Configuration\\nPC1 IP 192.168.1.10 Gateway 192.168.1.1\\nPC2 IP 192.168.1.20 Gateway 192.168.1.1\\nServer IP 10.0.0.2 Gateway 10.0.0.1\\n\\nStep 3: Configure Router\\nenable\\nconfigure terminal\\n\\ninterface g0/0\\nip address 192.168.1.1 255.255.255.0\\nno shutdown\\nexit\\n\\ninterface g0/1\\nip address 10.0.0.1 255.255.255.0\\nno shutdown\\nexit\\n\\nStep 4: Configure Routing\\nip route 10.0.0.0 255.255.255.0 10.0.0.1\\n\\nStep 5: Apply Trust-Based ACL\\naccess-list 10 permit 192.168.1.10\\naccess-list 10 deny any\\n\\ninterface g0/0\\nip access-group 10 in\\n\\nStep 6: Test Before Attack\\nFrom PC1:\\nping 10.0.0.2 (should work)\\n\\nFrom PC2:\\nping 10.0.0.2 (should fail)\\n\\nStep 7: Simulate IP Spoofing\\nChange PC2 IP to 192.168.1.10\\n\\nTest again:\\nping 10.0.0.2 (should work)\\n\\nStep 8: Impact\\nUnauthorized access\\nSecurity bypass\\nFake identity\\n\\nStep 9: Countermeasure 1 Anti-Spoofing ACL\\nip access-list extended ANTI-SPOOF\\ndeny ip 192.168.1.0 0.0.0.255 any\\npermit ip any any\\n\\ninterface g0/1\\nip access-group ANTI-SPOOF in\\n\\nStep 10: Countermeasure 2 uRPF\\ninterface g0/0\\nip verify unicast source reachable-via rx\\n\\nStep 11: Switch Port Security\\nenable\\nconfigure terminal\\n\\ninterface fa0/1\\nswitchport mode access\\nswitchport port-security\\nswitchport port-security maximum 1\\nswitchport port-security mac-address sticky\\nswitchport port-security violation shutdown\\n\\nFinal Understanding:\\nBefore ACL everyone allowed\\nACL allows only trusted IP\\nSpoofing bypasses security\\nuRPF blocks spoofed packets\\n\\nConclusion:\\nIP-based trust is not secure and must be verified using mechanisms like uRPF and port security\\n\\nResult:\\nAttack simulated successfully\\nVulnerability identified\\nSecurity measures implemented"
|
|
21
21
|
},
|
|
22
|
-
"
|
|
23
|
-
"title": "
|
|
24
|
-
"code": "
|
|
22
|
+
"udp_acl_security_practical": {
|
|
23
|
+
"title": "UDP Traffic Control using Access Control List (ACL)",
|
|
24
|
+
"code": "AIM:\\nTo allow normal UDP communication and block unwanted UDP traffic using ACL.\\n\\nStep 1: Build the Network\\nDevices required:\\n1 Router (2911)\\n1 Switch (2960)\\nPC1 (Client)\\nPC2 (Attacker)\\n1 Server\\n\\nConnections:\\nPC1 FastEthernet0 to Switch Fa0/1\\nPC2 FastEthernet0 to Switch Fa0/2\\nServer FastEthernet0 to Switch Fa0/3\\nSwitch Fa0/24 to Router GigabitEthernet0/0\\n\\nStep 2: IP Configuration\\nPC1 IP 192.168.1.10 Gateway 192.168.1.1\\nPC2 IP 192.168.1.30 Gateway 192.168.1.1\\nServer IP 192.168.1.20\\nSubnet Mask 255.255.255.0\\n\\nStep 3: Configure Router\\nenable\\nconfigure terminal\\ninterface g0/0\\nip address 192.168.1.1 255.255.255.0\\nno shutdown\\nexit\\n\\nStep 4: Enable UDP Service on Server\\nOpen Server -> Services -> DNS\\nTurn DNS ON\\nAdd entry:\\nName example.com\\nAddress 192.168.1.20\\n\\nStep 5: Test UDP Communication\\nFrom PC1:\\nnslookup example.com 192.168.1.20\\nUDP communication should work\\n\\nStep 6: Apply ACL to Block Attacker\\nRouter(config)# access-list 100 deny udp host 192.168.1.30 any\\nRouter(config)# access-list 100 permit ip any any\\n\\nApply ACL:\\ninterface g0/0\\nip access-group 100 in\\nexit\\n\\nStep 7: Test After ACL\\nFrom PC2:\\nnslookup example.com 192.168.1.20 (should fail)\\n\\nFrom PC1:\\nnslookup example.com 192.168.1.20 (should work)\\n\\nStep 8: Block DNS Service (Port-Based ACL)\\nRouter(config)# access-list 101 deny udp any any eq 53\\nRouter(config)# access-list 101 permit ip any any\\n\\nApply:\\ninterface g0/0\\nip access-group 101 in\\nexit\\n\\nTest:\\nFrom PC1:\\nnslookup example.com 192.168.1.20 (should fail)\\n\\nStep 9: Important Concept\\nIf all devices are in same network, traffic bypasses router\\nCommunication becomes PC -> Switch -> Server\\nACL will not work\\n\\nStep 10: Fix Topology\\nChange Server network:\\nServer IP 10.0.0.2 Gateway 10.0.0.1\\n\\nConfigure Router:\\ninterface g0/1\\nip address 10.0.0.1 255.255.255.0\\nno shutdown\\n\\nNow traffic flows through router:\\nPC -> Router -> Server\\nACL works correctly\\n\\nConcepts:\\nUDP is fast and connectionless protocol\\nACL filters traffic based on rules\\nPort 53 is used for DNS\\nRouter must be in path for ACL to work\\n\\nResult:\\nUDP communication tested\\nAttacker blocked using ACL\\nDNS service blocked using port-based ACL\\nNetwork secured successfully"
|
|
25
25
|
},
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
"junit_armstrong": {
|
|
38
|
-
"title": "JUnit Armstrong Number Test",
|
|
39
|
-
"code": "public class ArmstrongService {\\n\\n\\tpublic boolean isArmstrong(int num) {\\n\\t\\tint temp = num, sum = 0, rem;\\n\\n\\t\\twhile (num > 0) {\\n\\t\\t\\trem = num % 10;\\n\\t\\t\\tsum += rem * rem * rem;\\n\\t\\t\\tnum /= 10;\\n\\t\\t}\\n\\t\\treturn sum == temp;\\n\\t}\\n}\\n\\nimport org.junit.jupiter.api.Test;\\nimport static org.junit.jupiter.api.Assertions.*;\\n\\npublic class ArmstrongTest {\\n\\n\\t@Test\\n\\tvoid testArmstrong() {\\n\\t\\tArmstrongService s = new ArmstrongService();\\n\\t\\tassertTrue(s.isArmstrong(153));\\n\\t\\tassertFalse(s.isArmstrong(123));\\n\\t}\\n}"
|
|
40
|
-
},
|
|
41
|
-
"junit_volume": {
|
|
42
|
-
"title": "JUnit Volume Calculation Test",
|
|
43
|
-
"code": "public class VolumeService {\\n\\n\\tpublic double sphere(double r) {\\n\\t\\treturn (4.0 / 3.0) * Math.PI * r * r * r;\\n\\t}\\n\\n\\tpublic double cylinder(double r, double h) {\\n\\t\\treturn Math.PI * r * r * h;\\n\\t}\\n\\n\\tpublic double cube(double a) {\\n\\t\\treturn a * a * a;\\n\\t}\\n}\\n\\nimport org.junit.jupiter.api.Test;\\nimport static org.junit.jupiter.api.Assertions.*;\\n\\npublic class VolumeTest {\\n\\n\\tVolumeService s = new VolumeService();\\n\\n\\t@Test\\n\\tvoid testSphere() {\\n\\t\\tassertEquals(523.5, s.sphere(5), 0.1);\\n\\t}\\n\\n\\t@Test\\n\\tvoid testCylinder() {\\n\\t\\tassertEquals(314.1, s.cylinder(5, 4), 0.1);\\n\\t}\\n\\n\\t@Test\\n\\tvoid testCube() {\\n\\t\\tassertEquals(27, s.cube(3));\\n\\t}\\n}"
|
|
44
|
-
},
|
|
45
|
-
"junit_area": {
|
|
46
|
-
"title": "JUnit Area Calculation Test",
|
|
47
|
-
"code": "public class AreaService {\\n\\n\\tpublic double circle(double r) {\\n\\t\\treturn Math.PI * r * r;\\n\\t}\\n\\n\\tpublic double rectangle(double l, double b) {\\n\\t\\treturn l * b;\\n\\t}\\n\\n\\tpublic double triangle(double b, double h) {\\n\\t\\treturn 0.5 * b * h;\\n\\t}\\n}\\n\\nimport org.junit.jupiter.api.Test;\\nimport static org.junit.jupiter.api.Assertions.*;\\n\\npublic class AreaTest {\\n\\n\\tAreaService s = new AreaService();\\n\\n\\t@Test\\n\\tvoid testCircle() {\\n\\t\\tassertEquals(78.5, s.circle(5), 0.1);\\n\\t}\\n\\n\\t@Test\\n\\tvoid testRectangle() {\\n\\t\\tassertEquals(20, s.rectangle(5, 4));\\n\\t}\\n\\n\\t@Test\\n\\tvoid testTriangle() {\\n\\t\\tassertEquals(10, s.triangle(5, 4));\\n\\t}\\n}"
|
|
48
|
-
},
|
|
49
|
-
"testng_selenium_setup": {
|
|
50
|
-
"title": "Practical 5 TestNG and Selenium Setup Steps",
|
|
51
|
-
"code": "A) Setup TestNG in Maven Project\\n\\nStep 1: Create Maven Project\\nOpen Eclipse IDE\\nGo to File -> New -> Maven Project\\nSelect Create a simple project\\nClick Next\\n\\nEnter details:\\nGroupId: com.bca\\nArtifactId: PracticeTestNG\\nName: PracticeTestNG\\nClick Finish\\n\\nStep 2: Fix pom.xml Error\\nGo to Window -> Preferences -> Maven\\nEnable Update Maven Projects on Startup\\nClick Apply and Close\\n\\nStep 3: Add TestNG Dependency\\nOpen pom.xml and add:\\n<dependencies>\\n <dependency>\\n <groupId>org.testng</groupId>\\n <artifactId>testng</artifactId>\\n <version>7.12.0</version>\\n <scope>test</scope>\\n </dependency>\\n</dependencies>\\n\\nRight click project -> Maven -> Update Project\\n\\nStep 4: Install TestNG Plugin\\nGo to Help -> Eclipse Marketplace\\nSearch TestNG\\nInstall and restart Eclipse\\n\\nStep 5: Create Test Class\\nGo to src/test/java\\nRight click -> New -> Class\\nName: FirstTest\\n\\nStep 6: Simple Test Code\\nimport org.testng.annotations.Test;\\n\\npublic class FirstTest {\\n @Test\\n public void test1() {\\n System.out.println(\\\"TestNG is working\\\");\\n }\\n}\\n\\nRun using Run As -> TestNG Test\\n\\nB) Selenium + TestNG Setup\\n\\nStep 1: Add Dependencies\\nAdd in pom.xml:\\n<dependency>\\n <groupId>org.seleniumhq.selenium</groupId>\\n <artifactId>selenium-java</artifactId>\\n <version>4.21.0</version>\\n</dependency>\\n\\n<dependency>\\n <groupId>io.github.bonigarcia</groupId>\\n <artifactId>webdrivermanager</artifactId>\\n <version>5.8.0</version>\\n</dependency>\\n\\nRight click -> Maven -> Update Project\\n\\nStep 2: Final Working Code\\npackage mypack;\\n\\nimport org.openqa.selenium.By;\\nimport org.openqa.selenium.Keys;\\nimport org.openqa.selenium.WebDriver;\\nimport org.openqa.selenium.chrome.ChromeDriver;\\nimport org.testng.annotations.Test;\\nimport io.github.bonigarcia.wdm.WebDriverManager;\\n\\npublic class FirstTest {\\n\\n @Test\\n public void TestGoogle() throws Exception {\\n\\n WebDriverManager.chromedriver().setup();\\n\\n WebDriver driver = new ChromeDriver();\\n\\n driver.manage().window().maximize();\\n\\n driver.get(\\\"https://www.google.com/\\\");\\n\\n driver.findElement(By.name(\\\"q\\\"))\\n .sendKeys(\\\"skates\\\", Keys.ENTER);\\n\\n System.out.println(driver.getTitle());\\n\\n Thread.sleep(5000);\\n\\n driver.quit();\\n }\\n}\\n\\nImportant Notes\\n\\nIf Chrome does not open:\\nUpdate Chrome browser and WebDriverManager\\n\\nIf TestNG does not run:\\nUse Run As -> TestNG Test\\n\\nIf import errors occur:\\nEnsure import org.testng.annotations.Test is added"
|
|
52
|
-
},
|
|
53
|
-
"autoit_selenium_steps": {
|
|
54
|
-
"title": "AutoIt + Selenium File Upload Practical Steps",
|
|
55
|
-
"code": "Step 1: Download AutoIt from https://www.autoitscript.com/site/autoit/downloads/\\n\\nStep 2: Download SciTE Editor from https://www.autoitscript.com/site/autoit-script-editor/downloads/\\n\\nStep 3: Install AutoIt by extracting zip and running setup file\\n\\nStep 4: Install SciTE editor and complete setup\\n\\nStep 5: Open SciTE.exe and Au3Info_x64.exe (Finder Tool)\\n\\nStep 6: Open website https://the-internet.herokuapp.com/upload\\n\\nStep 7: Use Finder Tool to get details of file input and open button (Edit1, Button1)\\n\\nStep 8: Write AutoIt script:\\nControlFocus(\\\"Open\\\",\\\"\\\",\\\"Edit1\\\")\\nControlSetText(\\\"Open\\\",\\\"\\\",\\\"Edit1\\\",$CmdLine[1])\\nControlClick(\\\"Open\\\",\\\"\\\",\\\"Button1\\\")\\n\\nStep 9: Save as hello.au3 and compile using Tools -> Compile (X86 + X64)\\n\\nStep 10: Create Java Selenium project in Eclipse\\n\\nStep 11: Write Selenium code to open browser and click upload button\\n\\nStep 12: Use ProcessBuilder to run hello.exe with file path\\n\\nStep 13: Run Java application\\n\\nOutput: File upload is automated using AutoIt and Selenium"
|
|
56
|
-
},
|
|
57
|
-
"autoit_file_upload": {
|
|
58
|
-
"title": "AutoIt + Selenium File Upload Automation",
|
|
59
|
-
"code": "/* AutoIt Script */\\nControlFocus(\\\"Open\\\",\\\"\\\",\\\"Edit1\\\")\\nControlSetText(\\\"Open\\\",\\\"\\\",\\\"Edit1\\\",$CmdLine[1])\\nControlClick(\\\"Open\\\",\\\"\\\",\\\"Button1\\\")\\n\\n/* Java Selenium Code */\\npackage Auto;\\n\\nimport java.io.IOException;\\nimport org.openqa.selenium.By;\\nimport org.openqa.selenium.WebElement;\\nimport org.openqa.selenium.chrome.ChromeDriver;\\nimport org.openqa.selenium.interactions.Actions;\\n\\npublic class AutoITScirpt {\\n\\n\\tpublic static void main(String[] args) throws IOException, InterruptedException {\\n\\n\\t\\tChromeDriver driver = new ChromeDriver();\\n\\n\\t\\tdriver.get(\\\"https://the-internet.herokuapp.com/upload\\\");\\n\\n\\t\\tSystem.out.println(\\\"URL: \\\" + driver.getCurrentUrl());\\n\\t\\tSystem.out.println(\\\"Title: \\\" + driver.getTitle());\\n\\t\\tSystem.out.println(\\\"Source Length: \\\" + driver.getPageSource().length());\\n\\n\\t\\tWebElement buttonElement = driver.findElement(By.id(\\\"file-upload\\\"));\\n\\n\\t\\tActions act = new Actions(driver);\\n\\t\\tact.moveToElement(buttonElement).click().perform();\\n\\n\\t\\tThread.sleep(2000);\\n\\n\\t\\tProcessBuilder pBuilder = new ProcessBuilder(\\n\\t\\t\\t\\\"C:\\\\\\\\Users\\\\\\\\User\\\\\\\\OneDrive\\\\\\\\Desktop\\\\\\\\material\\\\\\\\STT\\\\\\\\hello.exe\\\",\\n\\t\\t\\t\\\"C:\\\\\\\\Users\\\\\\\\User\\\\\\\\Downloads\\\\\\\\chromedriver-win64\\\\\\\\hello.txt\\\"\\n\\t\\t);\\n\\n\\t\\tProcess process = pBuilder.start();\\n\\t\\tprocess.waitFor();\\n\\t}\\n}"
|
|
26
|
+
"udp_acl_dns_security_practical": {
|
|
27
|
+
"title": "UDP DNS Communication with ACL Security",
|
|
28
|
+
"code": "AIM:\\nCreate a network, enable DNS (UDP), allow normal user, and block attacker using ACL.\\n\\nStep 1: Topology\\nPC1 (Client) and PC2 (Attacker) connected to Switch\\nSwitch connected to Router G0/0\\nRouter G0/1 connected to Server\\n\\nStep 2: Connections\\nUse Copper Straight-Through cables\\nPC1 to Switch Fa0/1\\nPC2 to Switch Fa0/2\\nSwitch to Router G0/0\\nRouter G0/1 to Server\\nAll links should be active\\n\\nStep 3: IP Configuration\\nPC1 IP 192.168.1.10 Mask 255.255.255.0 Gateway 192.168.1.1 DNS 10.0.0.2\\nPC2 IP 192.168.1.30 Mask 255.255.255.0 Gateway 192.168.1.1 DNS 10.0.0.2\\nServer IP 10.0.0.2 Mask 255.255.255.0 Gateway 10.0.0.1\\n\\nStep 4: Router Configuration\\nenable\\nconfigure terminal\\n\\ninterface g0/0\\nip address 192.168.1.1 255.255.255.0\\nno shutdown\\nexit\\n\\ninterface g0/1\\nip address 10.0.0.1 255.255.255.0\\nno shutdown\\nexit\\n\\nStep 5: Enable DNS on Server\\nOpen Server -> Services -> DNS\\nTurn DNS ON\\nAdd entry:\\nName example.com\\nAddress 10.0.0.2\\n\\nStep 6: Initial Testing\\nFrom PC1:\\nping 10.0.0.2\\nThis builds ARP\\n\\nThen:\\nnslookup example.com\\nShould work successfully\\n\\nStep 7: Apply ACL Security\\nconfigure terminal\\n\\naccess-list 101 deny udp host 192.168.1.30 any\\naccess-list 101 permit ip any any\\n\\ninterface g0/0\\nip access-group 101 in\\nexit\\n\\nStep 8: Final Testing\\nFrom PC1:\\nnslookup example.com\\nShould work\\n\\nFrom PC2:\\nnslookup example.com\\nShould fail\\n\\nConcepts:\\nRouter must be in path for ACL to work\\nDNS uses UDP port 53\\nFirst ping builds ARP and avoids timeout\\nACL filters traffic based on rules\\n\\nFinal Result:\\nPC1 allowed\\nPC2 blocked\\nDNS working\\nACL applied successfully"
|
|
29
|
+
},
|
|
30
|
+
"dns_udp_hijacking_practical": {
|
|
31
|
+
"title": "DNS UDP Hijacking Simulation and Prevention",
|
|
32
|
+
"code": "AIM:\\nSimulate a DNS-based UDP hijacking scenario, observe its impact on the client, and apply basic protection.\\n\\nStep 1: Topology Setup\\nConnect devices using Copper Straight-Through:\\nPC1 to Switch\\nPC2 to Switch\\nServer to Switch\\nSwitch to Router\\nEnsure all connections are active\\n\\nStep 2: IP Configuration\\nPC1 IP 192.168.1.10 Mask 255.255.255.0 Gateway 192.168.1.1 DNS 192.168.1.100\\nPC2 IP 192.168.1.20 Gateway 192.168.1.1\\nServer IP 192.168.1.100 Gateway 192.168.1.1\\n\\nStep 3: Router Configuration\\nenable\\nconfigure terminal\\ninterface g0/0\\nip address 192.168.1.1 255.255.255.0\\nno shutdown\\nexit\\n\\nStep 4: Enable DNS on Real Server\\nOpen Server -> Services -> DNS\\nTurn DNS ON\\nAdd entry:\\nexample.com maps to 192.168.1.100\\n\\nStep 5: Test Normal Output\\nFrom PC1:\\nnslookup example.com\\nExpected result:\\nName example.com\\nAddress 192.168.1.100\\n\\nStep 6: Simulate Attack\\nTurn OFF real server\\nOn PC2 change IP to 192.168.1.100\\nEnable DNS on PC2\\nAdd entry:\\nexample.com maps to 5.5.5.5\\n\\nStep 7: Test Attack Output\\nFrom PC1:\\nnslookup example.com\\nExpected result:\\nName example.com\\nAddress 5.5.5.5\\n\\nObservation:\\nBefore attack DNS resolves to 192.168.1.100\\nAfter attack DNS resolves to 5.5.5.5\\nClient is misled\\n\\nStep 8: Apply Basic Protection using Port Security\\nOn Switch CLI:\\nenable\\nconfigure terminal\\ninterface fa0/2\\nswitchport mode access\\nswitchport port-security\\nswitchport port-security maximum 1\\nswitchport port-security mac-address sticky\\nswitchport port-security violation shutdown\\nexit\\n\\nStep 9: Final Check\\nAttempt attack again\\nPort security blocks attacker or shuts down port\\n\\nOutput Observation Methods:\\nCommand Line:\\nUse nslookup example.com before and after attack\\n\\nSimulation Mode:\\nSelect Simulation\\nFilter DNS or UDP\\nRun nslookup\\nObserve source IP, destination IP, and UDP port 53\\n\\nConclusion:\\nDNS over UDP can be exploited by spoofing\\nClient blindly trusts DNS response\\nSecurity measures like port security help prevent attacks\\n\\nResult:\\nAttack successfully simulated\\nImpact observed\\nBasic protection applied"
|
|
33
|
+
},
|
|
34
|
+
"dos_attack_simulation_practical": {
|
|
35
|
+
"title": "Denial of Service (DoS) Attack Simulation and Prevention",
|
|
36
|
+
"code": "AIM:\\nSimulate a DoS condition using continuous requests, observe its impact on a server, and apply prevention techniques.\\n\\nStep 1: Topology\\nDevices:\\nPC1, PC2, PC3, Server connected to Switch\\nSwitch connected to Router G0/0\\nEnsure all connections are active\\n\\nStep 2: IP Configuration\\nPC1 IP 192.168.1.10\\nPC2 IP 192.168.1.20\\nPC3 IP 192.168.1.30\\nServer IP 192.168.1.100\\nMask 255.255.255.0\\nGateway 192.168.1.1\\n\\nStep 3: Router Configuration\\nenable\\nconfigure terminal\\ninterface g0/0\\nip address 192.168.1.1 255.255.255.0\\nno shutdown\\nexit\\n\\nStep 4: Enable Server Service\\nOpen Server -> Services -> HTTP\\nTurn HTTP ON\\n\\nStep 5: Normal Test\\nFrom PC1:\\nping 192.168.1.100\\nStable replies indicate normal operation\\n\\nStep 6: Simulate DoS Attack\\nFrom PC2:\\nping 192.168.1.100 -t\\n\\nFrom PC3:\\nping 192.168.1.100 -t\\n\\nContinuous traffic is generated\\n\\nStep 7: Observe Impact\\nFrom PC1:\\nping 192.168.1.100\\n\\nExpected results:\\nRequest timed out\\nHigh delay\\nPacket loss\\n\\nIndicates server overload and network congestion\\n\\nStep 8: Important Concept\\nIf all devices are in same network, traffic flows directly\\nPC -> Switch -> Server\\nRouter is bypassed\\nACL on router will not work\\n\\nStep 9: Apply Switch Port Security\\nenable\\nconfigure terminal\\n\\ninterface fa0/2\\nswitchport port-security\\nswitchport port-security maximum 1\\nswitchport port-security violation shutdown\\nexit\\n\\ninterface fa0/3\\nswitchport port-security\\nswitchport port-security maximum 1\\nswitchport port-security violation shutdown\\nexit\\n\\nLimits attacker behavior\\n\\nStep 10: Improved Topology for Router Control\\nChange Server network:\\nServer IP 10.0.0.2 Gateway 10.0.0.1\\n\\nAdd router interface:\\ninterface g0/1\\nip address 10.0.0.1 255.255.255.0\\nno shutdown\\n\\nTraffic now passes through router\\n\\nStep 11: Apply ACL Protection\\nip access-list extended BLOCK_ICMP\\npermit icmp host 192.168.1.10 host 10.0.0.2\\ndeny icmp any any\\n\\ninterface g0/0\\nip access-group BLOCK_ICMP in\\n\\nStep 12: Final Testing\\nFrom PC1:\\nping 10.0.0.2 (should work)\\n\\nFrom PC2 and PC3:\\nping 10.0.0.2 (should fail)\\n\\nOutput Observation:\\nCommand Line:\\nCompare ping before and during attack\\n\\nSimulation Mode:\\nFilter ICMP\\nObserve multiple packets and congestion\\n\\nConclusion:\\nDoS attack floods server with requests causing delay and packet loss\\nSwitch port security and ACL help control traffic\\n\\nResult:\\nAttack simulated\\nImpact observed\\nProtection applied successfully"
|
|
60
37
|
}
|
|
61
38
|
}
|
|
62
39
|
|