proxy package provides utilities for loading proxies from files, parsing user agent lists, and filtering proxies by attack method.
Package Overview
- Loading proxies from text files with various formats
- Parsing authentication credentials
- Loading user agent lists
- Filtering proxies by protocol compatibility
Functions
LoadProxies
[]engine.Proxy
Parsed proxy list
error
Error if file cannot be read or parsed
Protocol Detection
Protocol Detection
- Default protocol:
http - Explicit protocol:
http://,https://,socks4://,socks5:// - Protocol prefix is removed from the host string
Authentication Extraction
Authentication Extraction
- Regex pattern:
^([^:]+):([^@]+)@(.+)$ - Format:
username:password@host:port - Username and password stored in
Proxy.UsernameandProxy.Password - Credentials removed from host string after extraction
Port Parsing
Port Parsing
- Default port:
8080 - Custom port: parsed from
host:portformat - Invalid port numbers fall back to
8080
Comments and Blank Lines
Comments and Blank Lines
LoadUserAgents
[]string
List of user agent strings
error
Error if file cannot be read
user-agents.txt
- Splits file by newlines
- Trims whitespace from each line
- Skips empty lines
- Skips lines starting with
#(comments)
FilterByMethod
[]engine.Proxy
Proxies compatible with the specified method
Why SOCKS-only for some attacks?HTTP/HTTPS proxies work at the application layer and can only forward HTTP requests. Attacks like Slowloris, TCP flood, and Minecraft ping require raw TCP connections, which only SOCKS proxies support.
Complete Usage Example
Proxy File Best Practices
Organize by Type
Organize by Type
Use comments to organize proxies by protocol, region, or purpose:
Test Proxy Validity
Test Proxy Validity
Regularly validate proxies before use:
Separate by Attack Type
Separate by Attack Type
Maintain separate files for different attack requirements:
Document Credentials Securely
Document Credentials Securely
Store authenticated proxies in separate, secured files:Ensure proper file permissions:
premium-proxies.txt
Error Handling
File Not Found
Empty Proxy List
Malformed Lines
See Also
- Engine Package - Using proxies in attacks
- AttackWorker Interface - How workers use proxies
#are ignored