- Installation
- Quick Start
- Pattern Generation Strategies
- Target Configuration
- Safety Features
- Checkpoint System
- Advanced Usage
# Install Erlang/OTP (version 26 or higher)
# On Ubuntu/Debian:
sudo apt-get install erlang
# On macOS:
brew install erlang
# Install Rebar3
curl -O https://s3.amazonaws.com/rebar3/rebar3
chmod +x rebar3
sudo mv rebar3 /usr/local/bin/
# Install LFE
rebar3 new lfe-app myappgit clone https://github.com/Hyperpolymath/safe-brute-force.git
cd safe-brute-force
rebar3 compilerebar3 lfe repl;; Start the application
> (sbf:start)
;; Test with a simple function
> (sbf:test_wordlist "priv/wordlists/test-wordlist.txt"
(lambda (p) (== p "secret")))
;; Test HTTP endpoint
> (sbf:test_http "http://localhost/login"
"admin"
"priv/wordlists/common-passwords.txt")# Basic wordlist test
./sbf_cli wordlist priv/wordlists/test-wordlist.txt http://localhost/login admin
# PIN code test
./sbf_cli pins http://localhost/api/verify
# Charset combinations
./sbf_cli charset "abc" 2 4 http://localhostLoad patterns from a text file:
(let ((pattern-config
(list (tuple 'type 'wordlist)
(tuple 'filename "priv/wordlists/common-passwords.txt")))
(target-config
(list (tuple 'type 'function)
(tuple 'function (lambda (p) (== p "target"))))))
(sbf:run pattern-config target-config))Apply common mutations (leet speak, capitalization, suffixes):
(let ((pattern-config
(list (tuple 'type 'wordlist)
(tuple 'filename "passwords.txt")
(tuple 'mutations 'standard)))) ; or 'minimal or 'aggressive
(sbf:run pattern-config target-config))Mutation levels:
- minimal: Original + Capitalized
- standard: + numbers (123, 2024) + leet speak
- aggressive: All mutations + reverse + combinations
Generate all combinations from a character set:
(let ((pattern-config
(list (tuple 'type 'charset)
(tuple 'charset "abcdefghijklmnopqrstuvwxyz0123456789")
(tuple 'min_length 4)
(tuple 'max_length 6))))
(sbf:run pattern-config target-config))(let ((pattern-config
(list (tuple 'type 'sequential)
(tuple 'start 1000)
(tuple 'end 9999))))
(sbf:run pattern-config target-config))(let ((pattern-config
(list (tuple 'type 'common))))
(sbf:run pattern-config target-config))(let ((pattern-config
(list (tuple 'type 'custom)
(tuple 'function
(lambda ()
;; Generate custom patterns
(list "pattern1" "pattern2" "pattern3"))))))
(sbf:run pattern-config target-config))(let ((target-config
(list (tuple 'type 'http)
(tuple 'url "http://example.com/login")
(tuple 'method 'post) ; or 'get
(tuple 'username "admin")
(tuple 'username_field "user")
(tuple 'password_field "pass")
;; Success detection
(tuple 'success_pattern "Welcome")
;; Or failure detection
(tuple 'failure_pattern "Invalid credentials")
;; Optional: custom headers
(tuple 'headers (list (tuple "User-Agent" "Custom")))
;; Optional: body format
(tuple 'body_format 'json)))) ; or 'urlencoded (default)
(sbf:run pattern-config target-config))(let ((target-config
(list (tuple 'type 'function)
(tuple 'function
(lambda (pattern)
;; Your validation logic
(== pattern "correct"))))))
(sbf:run pattern-config target-config))(let ((target-config
(list (tuple 'type 'mock)
(tuple 'expected "secret123"))))
(sbf:run pattern-config target-config))SafeBruteForce automatically pauses every 25 attempts (configurable):
;; The system will pause and display:
╔════════════════════════════════════════════════╗
║ 🛑 PAUSED - Safety Checkpoint ║
║ Completed 25 attempts ║
║ Call (sbf:resume) to continue ║
║ Call (sbf:stats) to see results ║
╚════════════════════════════════════════════════╝
;; To continue:
> (sbf:resume);; Pause at any time
> (sbf:pause)
;; Resume
> (sbf:resume)
;; Check status
> (sbf:status)
;; Get detailed statistics
> (sbf:stats)Configure requests per second:
%% In config/sys.config
{safe_brute_force, [
{rate_limit, 50} % Max 50 requests per second
]};; Auto-save with default name
> (sbf:save_checkpoint)
;; Save with custom name
> (sbf:save_checkpoint 'my_session);; List available checkpoints
> (sbf:list_checkpoints)
;; Restore from checkpoint
> (sbf:load_checkpoint "my_session_1234567890_5678")Checkpoints are automatically saved every 100 attempts (configurable):
%% In config/sys.config
{safe_brute_force, [
{checkpoint_interval, 100}
]};; Run asynchronously
> (sbf:run_async pattern-config target-config)
#Pid<0.123.0>
;; Check status while running
> (sbf:status);; Get progress with ETA
(let ((progress (sbf_progress:new 10000)))
;; ... process items ...
(sbf_progress:print progress))
;; Output: [=========>----------] 45.2% (4520/10000) | 120.5/s | ETA: 45s;; Set log level
(sbf_logger:set_level 'debug) ; 'debug | 'info | 'warning | 'error
;; Log custom messages
(sbf_logger:info "Starting custom test")
(sbf_logger:success "Pattern found!");; After running
(let ((stats (sbf:stats)))
(let ((successful-patterns (maps:get 'successful_patterns stats)))
(io:format "Found: ~p~n" (list successful-patterns))));; PIN codes
(sbf_patterns:pin-codes) ; All 4-digit PINs
;; Simple passwords
(sbf_patterns:simple-passwords) ; Alphanumeric 4-6 chars
;; Hex colors
(sbf_patterns:hex-colors) ; All #RRGGBB colors{safe_brute_force, [
{pause_interval, 25}, % Pause every N attempts
{max_workers, 10}, % Concurrent workers
{request_timeout, 5000}, % Timeout per request (ms)
{rate_limit, 100}, % Max requests per second
{checkpoint_interval, 100}, % Auto-checkpoint frequency
{checkpoint_dir, "priv/checkpoints"},
{safety_enabled, true} % Enable safety pause
]}%% Only for testing!
{safe_brute_force, [
{safety_enabled, false}
]}See the examples/ directory for complete examples:
http_login_test.lfe- HTTP form authenticationpin_code_test.lfe- PIN code brute-forcingcustom_pattern_test.lfe- Custom pattern generation
# Check Erlang version
erl -version
# Rebuild
rebar3 clean
rebar3 compile% Adjust in config/sys.config
{rate_limit, 0} % Disable rate limiting (use with caution!)# Ensure directory exists
mkdir -p priv/checkpoints
chmod 755 priv/checkpoints- Always get authorization before testing any system
- Start with small wordlists to verify configuration
- Use rate limiting to avoid overwhelming targets
- Save checkpoints for long-running operations
- Monitor system resources during large operations
- Review results carefully using filtering functions
- Test on local/mock systems first
- Read the README
- Check CLAUDE.md for AI assistant guidance
- Review Security Best Practices
- Open an issue on GitHub