Kali · Enumeration

Termux Hub · Kali Linux

Kali Local & Network Enumeration Scripts

Local and network enumeration — read /etc/passwd for interactive users, parse crontabs for risky scheduled tasks, find SUID binaries, list listening ports with their PIDs, audit sudo privileges and detect ARP cache poisoning.

Kali · Enumeration — script list

ScriptCategoryWhat it does
passwd_file_analyzer.pyLocal EnumerationReads `/etc/passwd` and lists interactive-shell users.
cron_job_parser.pyLocal EnumerationParses crontab files to surface risky scheduled tasks.
log_file_monitor.pyLocal EnumerationTails a mock `auth.log` and alerts on failed SSH logins.
file_hash_checker.pyLocal EnumerationHashes critical binaries to check for tampering.
network_interface_auditor.pyNetwork EnumerationLists active interfaces and checks for promiscuous mode.
subnet_mask_parser.pyNetwork EnumerationParses CIDR notation into network range and host limits.
live_host_ping_sweep.pyNetwork EnumerationThreaded ICMP sweep to discover active nodes.
mac_address_spoof_automator.pyNetwork EnumerationRotates hardware MAC addresses for anonymity.
dns_recon_resolver.pyNetwork EnumerationResolves A, MX, and TXT records for target mapping.
socket_banner_grabber_cli.pyNetwork EnumerationFingerprints service versions via low-level sockets.
suid_binary_finder.shLocal EnumerationFinds all SUID files on the system and saves the list.
open_ports_enumerator.shLocal EnumerationLists listening ports with their associated PIDs.
sudo_privilege_checker.shLocal EnumerationRuns `sudo -l` and parses NOPASSWD entries.
system_info_gatherer.shLocal EnumerationCollects kernel, hostname, and OS info into one file.
clear_logs_simulator.shLocal EnumerationDemonstrates history/wtmp clearing (defensive awareness only).
new_connection_alert.shNetwork EnumerationAlerts on new unauthorised established TCP connections.
iptables_firewall_reset.shNetwork EnumerationResets firewall rules to a secure default-deny posture.
arp_cache_poison_detector.shNetwork EnumerationFlags duplicate MACs in the ARP table to warn of spoofing.
wireless_interface_auditor.shNetwork EnumerationEvaluates wireless card modes and monitor capability.
network_recon_bundle.shNetwork EnumerationAggregates interface, routing, and DNS data into a forensic dump.

Code samples

find_suid_binaries.sh — locate SUID/SGID files

#!/bin/bash
# find_suid_binaries.sh
# Day 5: Security Auditing & System Defense
# Description: Locates files with SUID or SGID bits set (potential privesc vectors).

echo "[*] Searching for SUID/SGID binaries on the system..."
echo "[*] This may take a moment depending on disk size..."
echo "--------------------------------------------------------"

# -perm /4000 looks for SUID
# -perm /2000 looks for SGID
# 2>/dev/null hides permission denied errors

# In test mode (AUDIT/CI set), limit the scan to a small subtree so it returns fast.
SCAN_ROOT="/"
if [ -n "${AUDIT:-}" ] || [ "${CI:-}" = "true" ]; then
    SCAN_ROOT="/usr/bin"
fi

echo "[+] SUID Files (Set Owner User ID):"
find "$SCAN_ROOT" -perm /4000 -type f 2>/dev/null | xargs ls -lh

echo ""
echo "[+] SGID Files (Set Group ID):"
find "$SCAN_ROOT" -perm /2000 -type f 2>/dev/null | xargs ls -lh

echo "--------------------------------------------------------"
echo "[*] Audit complete. Review the above files for unusual or unauthorized binaries."

passwd_file_analyzer.py — interactive users in /etc/passwd

#!/usr/bin/env python3
"""
passwd_file_analyzer.py
Day 11: Local Enumeration
Description: Reads /etc/passwd and extracts users with interactive shell access.
"""

import os

def analyze_passwd():
    passwd_path = "/etc/passwd"
    
    # Check if the file exists (to avoid errors in non-Linux environments)
    if not os.path.exists(passwd_path):
        print(f"[-] Error: {passwd_path} not found. Are you on a Linux system?")
        return

    interactive_shells = ["/bin/bash", "/bin/sh", "/bin/zsh", "/usr/bin/bash", "/usr/bin/zsh"]
    
    print(f"[*] Analyzing {passwd_path} for interactive users...")
    print("-" * 50)
    print(f"{'Username':<15} {'UID':<6} {'Shell':<15}")
    print("-" * 50)

    try:
        with open(passwd_path, "r") as f:
            for line in f:
                parts = line.strip().split(":")
                if len(parts) >= 7:
                    username = parts[0]
                    uid = parts[2]
                    shell = parts[6]
                    
                    if shell in interactive_shells:
                        print(f"{username:<15} {uid:<6} {shell:<15}")
                        
    except Exception as e:
        print(f"[-] An error occurred: {e}")

if __name__ == "__main__":
    analyze_passwd()

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