SafeBruteForce is designed for:
- ✅ Authorized penetration testing engagements
- ✅ CTF (Capture The Flag) competitions
- ✅ Security research on systems you own
- ✅ Educational demonstrations in controlled environments
- ✅ Password policy validation for your own organization
SafeBruteForce must NEVER be used for:
- ❌ Unauthorized access to third-party systems
- ❌ Credential stuffing or account takeover attacks
- ❌ Testing systems without written permission
- ❌ Circumventing security controls maliciously
- ❌ Any activity that violates laws or regulations
Be aware of applicable laws:
- CFAA (USA): Computer Fraud and Abuse Act
- GDPR (EU): Data protection regulations
- DMCA (USA): Anti-circumvention provisions
- Local laws: Vary by jurisdiction
Violation of these laws can result in criminal prosecution and civil liability.
Before starting any test:
[ ] Obtain written authorization from system owner
[ ] Document scope of testing (URLs, accounts, timeframes)
[ ] Establish emergency contact procedures
[ ] Define acceptable impact levels
[ ] Get sign-off from legal/compliance team
[ ] Review and accept terms of service;; Example: Limit testing to specific endpoint
(let ((target-config
(list (tuple 'type 'http)
(tuple 'url "http://test.example.com/authorized-test-endpoint")
;; NOT: http://example.com/* (too broad)
)))
(sbf:run pattern-config target-config))Always configure appropriate rate limits:
%% Conservative rate limiting
{safe_brute_force, [
{rate_limit, 10}, % Max 10 requests per second
{request_timeout, 5000}, % 5 second timeout
{max_workers, 3} % Limited concurrency
]}Conduct testing during agreed-upon windows:
# Example: Only test between 2-4 AM
# Use cron or manual scheduling
0 2 * * * /path/to/sbf_cli wordlist passwords.txt http://test.example.comMaintain comprehensive logs:
;; Enable detailed logging
(sbf_logger:set_level 'info)
;; Log to file
(sbf_logger:log_to_file "logs/test-session-2025-01-15.log"
"Starting authorized test")The built-in safety pause cannot be disabled in production:
%% This setting should ALWAYS be true in production
{safety_enabled, true}The CLI includes authorization checks:
$ ./sbf_cli wordlist passwords.txt http://example.com
⚠️ AUTHORIZATION CHECK ⚠️
You must have written authorization to test this system.
Do you have authorization to test this system? (yes/no):HTTP requests identify themselves:
%% Default User-Agent header
{"User-Agent", "SafeBruteForce/0.1.0 (Authorized Testing)"}This allows system administrators to:
- Identify brute-force attempts
- Distinguish authorized tests from attacks
- Apply appropriate rate limiting
If you're a system administrator, protect against brute-force attacks:
# Nginx example
limit_req_zone $binary_remote_addr zone=login:10m rate=5r/m;
location /login {
limit_req zone=login burst=3 nodelay;
}# Example: Lock account after 5 failed attempts
failed_attempts = get_failed_attempts(username)
if failed_attempts >= 5:
lock_account(username, duration=timedelta(minutes=15))Implement CAPTCHA after multiple failures:
if (failedAttempts >= 3) {
requireCaptcha = true;
}Require MFA for sensitive accounts:
- Time-based OTP (TOTP)
- SMS verification
- Hardware tokens (YubiKey, etc.)
# Alert on suspicious patterns
if (failed_attempts > 10 and time_window < 60):
send_alert("Possible brute-force attack detected")NEVER store discovered credentials in plain text:
;; BAD: Don't do this
(defun save_found_password (password)
(file:write_file "found_passwords.txt" password))
;; GOOD: Use secure reporting
(defun report_vulnerability (pattern metadata)
(let ((report (map 'timestamp (erlang:system_time 'second)
'pattern_type "redacted"
'metadata metadata)))
(sbf_logger:log 'success "Vulnerability confirmed" report)));; Filter sensitive data from logs
(defun sanitize_results (results)
(lists:map
(lambda ((tuple pattern result data))
(tuple "***REDACTED***" result (map 'success 'true)))
results))Checkpoints may contain sensitive data:
# Protect checkpoint directory
chmod 700 priv/checkpoints
# Encrypt sensitive checkpoints
gpg -c priv/checkpoints/session_*.checkpoint
# Delete after use
rm -P priv/checkpoints/*.checkpoint- Stop testing immediately upon finding an actual vulnerability
- Document the finding without exploiting further
- Follow responsible disclosure:
- Contact the system owner privately
- Provide reasonable time to patch (typically 90 days)
- Do not publicly disclose until patched
- Report through proper channels:
- security@organization.com
- Bug bounty programs (HackerOne, Bugcrowd)
- CERT/CC for critical infrastructure
If you accidentally test an unauthorized system:
- Stop immediately
- Contact the system owner and explain the mistake
- Provide logs if requested
- Delete all collected data
- Document the incident for your records
# Penetration Testing Agreement
**Client**: [Organization Name]
**Tester**: [Your Name/Company]
**Date**: [YYYY-MM-DD]
## Scope
- Target Systems: [Specific URLs, IP ranges, applications]
- Testing Methods: Brute-force authentication testing
- Timeframe: [Start Date] to [End Date]
- Authorized Hours: [e.g., 2:00 AM - 4:00 AM UTC]
## Limitations
- Maximum request rate: [e.g., 10 requests/second]
- Excluded systems: [List any off-limits systems]
- Data restrictions: [e.g., no data exfiltration]
## Responsibilities
- Tester will: [List obligations]
- Client will: [List obligations]
## Emergency Contact
- Name: [Contact]
- Phone: [Number]
- Email: [Address]
**Signatures**
Client: _________________ Date: _______
Tester: _________________ Date: _______Maintain comprehensive records:
;; Log all activities
(defun audit_log (action details)
(let ((entry (map 'timestamp (erlang:system_time 'second)
'action action
'details details
'user (whoami))))
(sbf_logger:log_to_file "audit.log"
(format_audit_entry entry))))- Authorization First: Never test without permission
- Minimize Impact: Use rate limiting and timeboxing
- Responsible Disclosure: Report vulnerabilities privately
- Data Protection: Handle discovered credentials securely
- Continuous Compliance: Stay updated on laws and regulations
- Professional Standards: Follow industry best practices (OWASP, NIST)
- Transparency: Clearly identify your testing activity
- Accountability: Maintain audit trails and documentation
- PTES (Penetration Testing Execution Standard)
- OSSTMM (Open Source Security Testing Methodology Manual)
For security concerns about SafeBruteForce itself:
- Email: security@[your-domain]
- PGP Key: [Key ID]
- Responsible Disclosure Policy: [URL]
Remember: With great power comes great responsibility. Use SafeBruteForce ethically and legally.