Kali · Foundations

Termux Hub · Kali Linux

Kali Linux Foundations Scripts — Files, Networking & System Info

Start here. These Bash and Python scripts cover the Linux fundamentals every security learner needs first — creating and moving files, reading logs, checking disk space, discovering your local IP, listing open ports and printing system information. Each script is short enough to read in a minute and safe to run on your own machine.

Kali · Foundations — script list

ScriptCategoryWhat it does
create_system_directory.pyFoundationsScaffolds an organised system directory tree for the toolkit.
write_sample_logs.pyFoundationsGenerates sample log files for testing monitoring and parsing scripts.
run_basic_ping.pyNetworkingSimple connectivity check against common targets such as Google DNS.
list_directory_contents.pyFile OpsWalks and prints a directory structure for inspection.
file_permissions.shFile OpsDemonstrates `chmod` and execution-right management.
connectivity_check.shNetworkingBasic connectivity and address discovery with `ping`.
ip_recon.shNetworkingExtracts the local IP address using `ip addr` and `grep`.
file_ops.shFile OpsAutomates `touch`, `cp`, `mv`, and `rm` operations.
grep_search.shText ProcessingPattern matching and search within log files using `grep`.
system_updater.shMaintenanceAutomated system update and package management.
user_recon.shReconReports on the current user's sessions and privileges.
log_reader.shLog AnalysisReads file segments with `cat`, `head`, and `tail`.
hidden_files.shFile OpsExplores hidden-file creation and discovery (`ls -la`).
process_hunter.shProcess ManagementTracks and filters background processes with `ps aux`.
project_directory_setup.shFile OpsQuickly scaffolds a standard project directory structure.
disk_monitor.shMonitoringReports disk-space usage in a human-readable format.
file_backup.shBackupCreates a `.bak` backup copy of a chosen file.
ip_fetcher.shNetworkingDetects and prints the local IP address.
local_net_analyzer.shNetworkingConsolidated report of IP info, routing tables, and listening services.
mass_file_creator.shFile OpsDemonstrates bulk file creation in a single pass.
network_ping.shNetworkingChecks connectivity to a host with a 3-packet ping.
open_ports.shNetworkingLists all active listening network ports.
sys_info.shSystem InfoPrints basic OS and kernel information.
user_greet.shUtilitiesDisplays the current user and time as a friendly greeting.

Code samples

sys_info.sh — print OS, kernel and hardware info

#!/bin/bash

# sys_info.sh
# This script fetches and prints basic system and kernel information.

echo "--- System Information ---"

# 'uname -s' prints the operating system name.
# 'uname -r' prints the kernel release version.
# 'uname -m' prints the machine hardware name.
echo "Operating System: $(uname -s)"
echo "Kernel Version: $(uname -r)"
echo "Hardware Architecture: $(uname -m)"

# 'hostname' displays the name of the machine.
echo "Hostname: $(hostname)"

echo "--------------------------"

open_ports.sh — list listening ports with ss/netstat

#!/bin/bash

# open_ports.sh
# This script lists currently listening network ports.

echo "--- Active Listening Ports ---"

# Check if 'ss' (Socket Statistics) is available.
if command -v ss >/dev/null 2>&1; then
    # '-t' TCP, '-u' UDP, '-l' listening, '-n' numeric.
    echo "Using 'ss' command:"
    ss -tuln
else
    # Fallback to 'netstat' if 'ss' is missing.
    echo "Using 'netstat' command:"
    netstat -tuln
fi

echo "------------------------------"

python_scripts/list_directory_contents.py

#!/usr/bin/env python3
import subprocess
import sys

def main():
    if sys.platform == "win32":
        command = ["cmd", "/c", "dir", "/a"]
    else:
        command = ["ls", "-la"]
    
    print(f"Executing command: {' '.join(command)}")
    
    try:
        result = subprocess.run(command, capture_output=True, text=True, check=True)
        print("Directory Contents:")
        print(result.stdout)
    except subprocess.CalledProcessError as e:
        print(f"Error executing command: {e}")

if __name__ == "__main__":
    main()

Related pages

View the full toolkit on GitHub

Explore Termux Hub

Kali Toolkit

Toolkit home (145 scripts) Foundations Network recon Defensive monitoring Vulnerability scanning Enumeration System hardening

Termux tool guides

Apache Brutus Cloudflare Cool Commands Cpp Findomain Fsociety Geo Recon Ghost Eye Hacktronian Ipicker Javascript John Local Server Manjaro Naabu Ncat Nmap Nordvpn Onex Pydictor Python Quasar Recondog Subfinder Termux Banner Ubuntu Gui Wafw00F Web Recon

Learn

Home Termux cheatsheet Python JavaScript C++ Cool Termux commands About Termux Hub