javisys / Security-Tools-in-Python

Several simple projects done in Python for network monitoring for Cybersecurity and high availability. All the modules needed are in their folder with the script.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Security-Tools-in-Python

Several simple projects done in Python for network monitoring for Cybersecurity and high availability. All the modules needed are in their folder with the script.

UPDATED, ADDED PASSWORD GENERATOR

𝗕𝗔𝗑𝗗π—ͺπ—œπ——π—§π—›
This script, made with the psutil library, obtains your bandwidth on the network interface you specify.

References
https://pypi.org/project/psutil/

𝗖π—₯π—¬π—£π—§π—’π—šπ—₯𝗔𝗣𝗛𝗬
This script generates a private key with the RSA encryption algorithm of 2048, then what it does is to convert the private key to a PEM format file, we write the key to the generated file. Then we generate the public key from the private key. Finally we pass the public key to an SSH file and write it to a file.

References
https://pypi.org/project/cryptography/

π—™π—œπ—₯π—˜π—ͺπ—”π—Ÿπ—Ÿ π—₯π—¨π—Ÿπ—˜
This script is very customizable, as we can adjust it for our own needs, in this case I have made a rule to block ping, another rule to block RDP protocol, and the last rule allows TCP traffic from one subnet to another over port 80, in this case, the good thing about this is that you can change it to suit your needs.

References
https://pypi.org/project/python-iptables/

𝗛𝗔𝗦𝗛 π—–π—”π—Ÿπ—–π—¨π—Ÿπ—”π—§π—’π—₯

References
https://pypi.org/project/hashlib/

𝗣𝗔𝗦𝗦π—ͺ𝗒π—₯𝗗 π—šπ—˜π—‘π—˜π—₯𝗔𝗧𝗒π—₯
This password generation script, the first thing I have done is to create a function that creates the password with all the ASCII characters and digits with the string library, then create a JSON file, add an exception, and then call the function created and pass it as parameter 12 to make it as secure as possible, and finally the generated passwords will be dumped to the JSON file previously created.

References
https://pypi.org/project/python-secrets/
https://docs.python.org/3/library/json.html
https://docs.python.org/es/3/library/string.html

𝗣𝗒π—₯𝗧 π—¦π—–π—”π—‘π—‘π—˜π—₯
The port scanner, I have created a function to scan all ports from 1 to 65535 and check if it is open and then close the connection. Out of the function we indicate the IP to which we want to scan and the ports. Finally we call the function, with the three parameters.

References
https://docs.python.org/es/3/library/socket.html

𝗧π—₯π—”π—™π—™π—œπ—– π—”π—‘π—”π—Ÿπ—¬π—­π—˜π—₯
This script is very short but powerful because it uses one of the best cybersecurity libraries such as scapy. I define a function, in this function it will verify if the packets are TCP and we indicate the TCP traffic and it indicates the size in bytes. With sniff we start capturing packets through the interface that we indicate, in this case eth0.

References
https://scapy.net/

π—ͺπ—˜π—• 𝗔𝗣𝗣 π—¦π—–π—”π—‘π—‘π—˜π—₯
This script to scan and analyze a web page we need the famous BeautifulSoup library. We indicate the URL that we want to scan, we collect the GET that we have answered the web that we indicate and we get the HTML and parse it using the library, and in this case, we get all the links on the page and finally iterate it with a for loop to show us all.

References
https://pypi.org/project/requests/
https://pypi.org/project/beautifulsoup4/

About

Several simple projects done in Python for network monitoring for Cybersecurity and high availability. All the modules needed are in their folder with the script.


Languages

Language:Python 100.0%