Kali Linux Automation Toolkit — 145 Bash & Python Scripts
The Kali Linux Automation Toolkit is a curated collection of 145 Bash and Python scripts for local system administration, network reconnaissance, defensive monitoring, vulnerability scanning and security hardening. Every script is small, readable and focused on a single job — and you can copy any of them straight from this page.
It is built for a Linux or Kali environment and is strictly for education and authorised security testing. Only run these scripts against systems you own or have explicit written permission to test.
What's inside
Kali · Foundations
Start here. These Bash and Python scripts cover the Linux fundamentals every security learner needs first — creating and…
24 scripts
Kali · Network Recon
Reconnaissance scripts — ping sweeps, port scans, banner grabbing, DNS enumeration, HTTP header analysis, subdomain test…
40 scripts
Kali · Defensive Monitoring
Defensive monitoring and log analysis. Parse auth logs for failed SSH logins, watch critical file integrity with SHA-256…
20 scripts
Kali · Vuln Scanning
Vulnerability scanning and forensics — Nmap vulnerability scripts, Nikto and WPScan wrappers, CVE database lookup, stega…
20 scripts
Kali · Enumeration
Local and network enumeration — read /etc/passwd for interactive users, parse crontabs for risky scheduled tasks, find S…
20 scripts
Kali · System Hardening
System hardening and container security — SSH brute-force defence, kernel parameter tuning, iptables and UFW rule compil…
21 scripts
How to use a script
- Pick a module above and open it.
- Find the script you need in the table — click its name to read the full source on GitHub.
- Use the COPY CODE button on any code block to copy it.
- Save it locally, make it executable with
chmod +x script.shand run it. Read the comments first.
Safety and ethics
Several scripts change system state — firewall rules, kernel parameters, MAC addresses and package sources. Review them before running, and never execute them on a production system without a tested rollback plan. Unauthorised scanning or access of systems you do not own is illegal in most jurisdictions.
Sample script
subnet_mask_parser.py — CIDR / subnet calculator
#!/usr/bin/env python3
"""
subnet_mask_parser.py
Day 12: System and Network Enumeration
Description:
A technical utility to parse CIDR notation and calculate network parameters.
This script provides the network ID, broadcast address, valid host range,
and total host capacity, which are critical for network segmentation auditing.
Cybersecurity Principle:
Understanding network boundaries is the first step in "Least Privilege" network
design and is essential for identifying unauthorized subnets during enumeration.
"""
import ipaddress
import sys
def parse_subnet(cidr):
"""
Parses CIDR notation and prints detailed network statistics.
"""
try:
# Create an IPv4 network object
network = ipaddress.IPv4Network(cidr, strict=False)
print(f"\n[+] Network Analysis for: {cidr}")
print("-" * 40)
print(f"Network ID: {network.network_address}")
print(f"Subnet Mask: {network.netmask}")
print(f"Broadcast Address: {network.broadcast_address}")
print(f"Wildcard Mask: {network.hostmask}")
print(f"First Host: {list(network.hosts())[0] if network.num_addresses > 2 else 'N/A'}")
print(f"Last Host: {list(network.hosts())[-1] if network.num_addresses > 2 else 'N/A'}")
print(f"Total Hosts: {network.num_addresses}")
print(f"Valid Host Count: {max(0, network.num_addresses - 2)}")
print("-" * 40)
except ValueError as e:
print(f"[-] Error: Invalid CIDR notation: {e}")
except IndexError:
print("[-] Error: Subnet too small for host calculations.")
if __name__ == "__main__":
if len(sys.argv) != 2:
print("Usage: python3 subnet_mask_parser.py <CIDR_NOTATION>")
print("Example: python3 subnet_mask_parser.py 192.168.1.0/24")
sys.exit(0)
parse_subnet(sys.argv[1])