Skip to content

blackmatriXblack/linuxcommand

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Kali Linux Commands Browser v1.0 – Technical Documentation

1. Project Overview

Kali Linux Commands Browser v1.0 is a comprehensive, terminal-based educational and reference tool designed for cybersecurity professionals, students, and penetration testers. Developed in standard C, this application provides an organized, searchable database of over 200 essential Kali Linux tools.

Unlike simple cheat sheets, this application offers an interactive menu-driven interface that categorizes tools by their operational phase (e.g., Information Gathering, Vulnerability Analysis, Wireless Attacks), provides detailed descriptions, and offers precise usage syntax. It serves as an offline-ready "quick-reference guide" that can be compiled and run on any standard Linux or Windows environment (via WSL or MinGW).

1.1 Core Objectives

  • Centralized Knowledge Base: Consolidate scattered command-line knowledge into a single, structured binary.
  • Enhanced Discoverability: Allow users to find tools by category or keyword search, reducing the cognitive load of remembering specific tool names.
  • Educational Utility: Provide immediate context (description and usage) for each tool, aiding in learning and retention.
  • Cross-Platform Compatibility: Written in portable C with conditional compilation for screen clearing (cls vs clear), ensuring usability across Windows and Linux terminals.

1.2 Key Features

  • Categorized Browsing: Tools are grouped into 13 distinct cybersecurity domains (e.g., Sniffing & Spoofing, Forensics, Reverse Engineering).
  • Keyword Search Engine: Implements a case-insensitive search algorithm that scans both command names and descriptions.
  • Rich Terminal UI: Utilizes ANSI escape codes for color-coded output, improving readability and visual hierarchy.
  • Static Data Integrity: All command data is embedded within the source code, ensuring zero dependency on external databases or internet connectivity.

2. System Architecture

2.1 Data Model

The core of the application is built around a structured data model representing a single command entry.

typedef struct {
    char name[50];        // The executable name (e.g., "nmap")
    char description[200]; // Brief explanation of functionality
    char usage[150];      // Standard syntax example
    char category[30];    // Functional grouping (e.g., "Exploitation")
} Command;
  • Memory Allocation: The application uses a static array Command commands[200] allocated on the stack. This ensures fast access times and eliminates the complexity of dynamic memory management (malloc/free) for the dataset.
  • Capacity: Currently supports up to 200 unique entries. The initializeCommands function returns the actual count of loaded entries.

2.2 Module Structure

Module Function Description
Initialization initializeCommands() Populates the commands array with hardcoded data. Acts as the local database loader.
UI/UX displayMenu() Renders the main navigation loop.
Display displayAllCommands() Iterates through the entire array and prints detailed cards for each tool.
Filtering displayByCategory() Dynamically extracts unique categories and allows users to filter the view.
Search searchCommand() Implements string matching logic to find relevant tools based on user input.
Utilities clearScreen(), pressEnterToContinue() Handles platform-specific console operations for a smooth user experience.

3. Detailed Module Analysis

3.1 Data Initialization (initializeCommands)

This function serves as the Data Access Layer (DAL). It manually populates the Command structure using strcpy.

  • Data Organization: The code is logically sectioned by category (e.g., // Information Gathering Tools, // Wireless Attacks). This makes it easy for developers to add new tools by simply appending new strcpy blocks.
  • Index Management: An integer index tracks the current position in the array. Each time a tool is added, index++ increments the counter.
  • Example Entry:
    strcpy(commands[index].name, "nmap");
    strcpy(commands[index].description, "Network exploration tool and security/port scanner");
    strcpy(commands[index].usage, "nmap [options] <target>");
    strcpy(commands[index].category, "Information Gathering");
    index++;

3.2 Category Browsing Logic (displayByCategory)

This module implements a dynamic distinct selection algorithm, similar to SQL's SELECT DISTINCT category FROM commands.

  1. Extraction: It iterates through the entire commands array.
  2. Uniqueness Check: For each command, it checks if its category already exists in a local categories[20][30] array.
  3. Storage: If new, the category is added to the list.
  4. User Selection: The user selects a category by number.
  5. Filtered Display: The array is scanned again, printing only those entries where strcmp(commands[i].category, selected_category) == 0.

3.3 Search Engine (searchCommand)

The search feature implements a case-insensitive substring match.

  1. Input Normalization: The user's input string is converted to lowercase using tolower().
  2. Data Normalization: Inside the loop, temporary buffers nameLower and descLower are created and converted to lowercase.
  3. Matching: strstr() is used to check if the search term exists within either the command name or its description.
    • Benefit: Searching for "scan" will return nmap, masscan, nikto, and wpscan because their descriptions or names contain the substring "scan".
  4. Result Presentation: Matches are displayed in a detailed card format.

3.4 User Interface Rendering

The application heavily relies on ANSI Escape Codes for visual styling.

  • Color Palette:
    • CYAN: Headers and Titles.
    • GREEN: Success messages, Command Names, Menu Options.
    • RED: Errors, Exit Options.
    • YELLOW: Prompts and Warnings.
    • BLUE: Detail Card Borders.
    • MAGENTA: Section Dividers.
  • Card Layout: The displayCommandDetails function draws a box using +, -, and | characters, creating a structured "ID Card" look for each tool.
+-----------------------------------------------------------+
| Command: nmap                                             |
+-----------------------------------------------------------+
| Category: Information Gathering                           |
| Description: Network exploration tool and security/port...|
| Usage: nmap [options] <target>                            |
+-----------------------------------------------------------+

4. Tool Categories & Coverage

The browser covers the entire penetration testing lifecycle, aligned with standard methodologies like PTES (Penetration Testing Execution Standard).

4.1 Information Gathering

  • Tools: nmap, netdiscover, whois, dig, theharvester, shodan, maltego.
  • Purpose: Passive and active reconnaissance to map out target infrastructure.

4.2 Vulnerability Analysis

  • Tools: nikto, openvas, sqlmap, wpscan, nessus, lynis.
  • Purpose: Identifying known weaknesses, misconfigurations, and CVEs.

4.3 Wireless Attacks

  • Tools: aircrack-ng, reaver, kismet, wifite, pixiewps.
  • Purpose: Auditing WiFi security, cracking WPA/WPS keys.

4.4 Web Applications

  • Tools: burpsuite, zaproxy, dirb, gobuster, xsser, commix.
  • Purpose: Testing web servers for SQLi, XSS, Directory Traversal, etc.

4.5 Exploitation

  • Tools: metasploit, searchsploit, beef-xss, crackmapexec.
  • Purpose: Leveraging vulnerabilities to gain access.

4.6 Sniffing & Spoofing

  • Tools: wireshark, tcpdump, ettercap, bettercap, responder.
  • Purpose: Intercepting network traffic and performing MITM attacks.

4.7 Password Attacks

  • Tools: hydra, john, hashcat, mimikatz, cewl.
  • Purpose: Brute-forcing, dictionary attacks, and hash cracking.

4.8 Reverse Engineering

  • Tools: ghidra, radare2, gdb, strings, objdump.
  • Purpose: Analyzing binaries and malware without source code.

4.9 Forensics

  • Tools: autopsy, binwalk, volatility, testdisk, exiftool.
  • Purpose: Digital evidence recovery and analysis.

4.10 Social Engineering

  • Tools: setoolkit, gophish, king-phisher.
  • Purpose: Simulating phishing campaigns and human-based attacks.

4.11 Post Exploitation

  • Tools: powersploit, weevely, empire, netcat.
  • Purpose: Maintaining access and lateral movement after initial compromise.

4.12 Hardware Hacking

  • Tools: arduino, apktool, android-sdk.
  • Purpose: Interfacing with physical devices and mobile apps.

4.13 Networking & System Services

  • Tools: curl, wget, iptables, systemctl, ssh.
  • Purpose: General system administration and network manipulation.

5. Compilation and Deployment

5.1 Prerequisites

  • Compiler: GCC (Linux/Mac) or MinGW/GCC (Windows).
  • Standard Library: Requires <stdio.h>, <stdlib.h>, <string.h>, <ctype.h>.
  • OS: Linux, macOS, or Windows (via CMD/PowerShell/WSL).

5.2 Build Instructions

On Linux/macOS:

gcc main.c -o kali-browser -std=c99
./kali-browser

On Windows (MinGW):

gcc main.c -o kali-browser.exe
kali-browser.exe

On Windows (MSVC): Note: system("cls") works natively. ANSI colors may require Windows 10+.

cl main.c /Fe:kali-browser.exe
kali-browser.exe

5.3 Portability Notes

  • Screen Clearing: The clearScreen() function uses preprocessor directives:
    #ifdef _WIN32
    system("cls");
    #else
    system("clear");
    #endif
    This ensures the correct command is sent to the OS shell.
  • ANSI Colors: Most modern terminals (Windows Terminal, GNOME Terminal, iTerm2) support ANSI codes out of the box. Older Windows CMD versions may display raw escape sequences.

6. Security & Ethical Considerations

6.1 Educational Purpose

This tool is strictly a reference guide. It does not execute any of the listed commands. It merely displays text. Therefore, it poses no direct security risk to the host system.

6.2 Ethical Usage Disclaimer

The tools listed (e.g., hydra, metasploit, aircrack-ng) are dual-use technologies.

  • Authorized Use: Only use these tools on networks and systems you own or have explicit written permission to test.
  • Illegal Activity: Unauthorized scanning, exploitation, or interception of network traffic is illegal in most jurisdictions (e.g., CFAA in the US, Computer Misuse Act in the UK).

6.3 No Network Interaction

Since the application is purely informational, it requires no network permissions, firewalls exceptions, or root privileges to run.


7. Future Enhancements & Roadmap

7.1 Dynamic Data Loading

  • Current Limitation: Adding a new command requires recompiling the source code.
  • Proposal: Load commands from an external JSON or CSV file at runtime. This would allow users to update their database without touching the C code.

7.2 Advanced Search

  • Fuzzy Search: Implement Levenshtein distance to handle typos (e.g., searching "namp" finds "nmap").
  • Tagging System: Add multiple tags per command (e.g., nmap tagged as "network", "scanner", "tcp").

7.3 Interactive Execution (Safe Mode)

  • Feature: Allow users to press 'E' to execute a command directly from the browser.
  • Safety: Would require strict sandboxing or a "Dry Run" mode that only prints the full command to stdout for the user to copy-paste.

7.4 GUI Frontend

  • Proposal: Port the logic to NCurses (Linux) or PDCurses (Windows) for a more robust TUI (Text User Interface) with window panes and mouse support.

7.5 Export Functionality

  • Feature: Allow exporting the current view or search results to a .txt or .md file for report generation.

8. Conclusion

Kali Linux Commands Browser v1.0 is a well-structured, efficient, and highly useful tool for anyone involved in cybersecurity. By leveraging the simplicity of C and the power of structured data, it provides a fast, offline-accessible encyclopedia of penetration testing tools. Its modular design makes it easy to extend, and its cross-platform compatibility ensures it can be used in almost any environment. Whether you are a student learning the ropes or a professional needing a quick syntax reminder, this browser streamlines the workflow and enhances productivity.

About

a tool of windows for linuxcommandtool

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors