This project consists of the development of a computer security application using Python. The application was designed to explore core concepts of offensive and defensive cybersecurity in controlled and authorized environments.
https://github.com/MarcoAbreu2002/MarcoAbreuProjetoFinalLPDchmod +x requirements.sh
./requirements.shrequirements_windows.batpython3 main.py************Computer Security Application**************
A: Available Network Ports
B: UDP flood (DoS)
C: SYN flood (TCP SYN)
D: Encrypted Chat
Q: Quit
This feature allows scanning and listing open ports on domains or IP addresses, with configurable port ranges and connectivity levels.
************Computer Security Application************** A: Available Network Ports B: UDP flood (DoS) C: SYN flood (TCP SYN) D: Encrypted Chat Q: QuitChoose the desired option: ARunning available-ports.py...************************************************************ Port Scanner D - Domain Name | I - IP Address I Enter the IP Address to scan: 192.168.1.10 Enter the start port number 1 Enter the last port number 99999Range not OK Setting last port to 65535Low connectivity = L | High connectivity = H HScanning in progress... 192.168.1.10 ************************************************************ Port Open:--> 9200 -- Elasticsearch — default Elasticsearch port - Unofficial TCP Port Open:--> 9000 -- qBittorrent embedded torrent tracker default port - Unofficial TCP Port Open:--> 4444 -- I2P HTTP/S proxy - Unofficial TCP Port Open:--> 27017 -- MongoDB daemon process (mongod) and routing service (mongos) - No UDP, Unofficial TCP Port Open:--> 9300 -- IBM Cognos BI [citation needed] - Unofficial TCP Port Open:--> 12201 -- Graylog Extended Log Format (GELF) [importance?] - Unofficial TCP and UDP Port Open:--> 1515 -- No known service for port 1515Exiting main thread Scanning complete in 0:00:07.054941
Simulation of a UDP Flood attack, allowing the configuration of the target IP, target port, number of packets, and payload message.
************Computer Security Application**************
A: Available Network Ports
B: UDP flood (DoS)
C: SYN flood (TCP SYN)
D: Encrypted Chat
Q: Quit
Choose the desired option: B
Running udp_flood.py...
Enter the target IP address: 192.168.1.10
Enter the target port: 80
Enter the number of packets to send: 50
Enter a message to send to the target: Test
Multi-threaded TCP SYN Flood simulation, demonstrating resource exhaustion attacks on TCP services.
************Computer Security Application************** A: Available Network Ports B: UDP flood (DoS) C: SYN flood (TCP SYN) D: Encrypted Chat Q: QuitChoose the desired option: CRunning synflood.py...Enter the target IP: 192.168.1.10 Enter the number of packets to send per thread: 100 Enter the number of threads: 5Thread sent 100 packets successfully. Sent 500 packets successfully.
A client-server messaging system featuring authentication, encryption of private keys, broadcast messaging, message history reading, and export functionality.
Implementation of a port knocking mechanism using firewall rules configured with iptables, enabling conditional access to SSH and L2TP/IPSec services.
#!/bin/bash ### Clear existing rules and custom chainsiptables -X iptables -F iptables -X INTO-P2 iptables -X INTO-P3 iptables -X INTO-P4# Accept established and related connections to allow return trafficiptables -A INPUT -p tcp --dport 22 -m state --state ESTABLISHED -j ACCEPT iptables -A INPUT -p tcp --dport 22 -m state --state RELATED -j ACCEPT# Create new chains to control the program flowiptables -N INTO-P2 iptables -N INTO-P3 iptables -N INTO-P4# Rules to move connections from one stage to another, tracking them with names # P1 - P2 - P3 - P4iptables -A INTO-P2 -m recent --name P1 --remove iptables -A INTO-P2 -m recent --name P2 --set iptables -A INTO-P2 -j LOG --log-prefix "INTO P2: " iptables -A INTO-P3 -m recent --name P2 --remove iptables -A INTO-P3 -m recent --name P3 --set iptables -A INTO-P3 -j LOG --log-prefix "INTO P3: " iptables -A INTO-P4 -m recent --name P3 --remove iptables -A INTO-P4 -m recent --name P4 --set iptables -A INTO-P4 -j LOG --log-prefix "INTO P4: "# Update the last time the P1 connection was seeniptables -A INPUT -m recent --update --name P1# Define the sequence of ports that must be accessed in a specific order # To allow access to the SSH port # If the sequence is broken, access rules will be rejectediptables -A INPUT -p tcp --dport 6666 -m recent --name P1 --set iptables -A INPUT -p tcp --dport 7777 -m recent --rcheck --seconds 10 --name P1 -j INTO-P2 iptables -A INPUT -p tcp --dport 8888 -m recent --rcheck --seconds 10 --name P2 -j INTO-P3 iptables -A INPUT -p tcp --dport 9999 -m recent --rcheck --seconds 10 --name P3 -j INTO-P4# If the sequence is complete (P1 → P2 → P3 → P4), the SSH port will be openediptables -A INPUT -p tcp --dport 22 -m recent --rcheck --seconds 10 --name P4 -j ACCEPT# Open L2TP/IPSec port (1701) if the sequence is respectediptables -A INPUT -p udp --dport 1701 -m recent --rcheck --seconds 10 --name P4 -j ACCEPT# Default rule to reject new SSH connections if the sequence is not respectediptables -A INPUT -p tcp --dport 22 -m state --state NEW -j DROP