ProxyWrap is a powerful bash script that provides an enhanced interface for ProxyChains, making it easier to manage and use proxy configurations with advanced features like validation, profiles, and interactive selection.
- Multiple Proxy Support: Add proxies individually or load from files
- Proxy Validation: Test proxy connectivity before use
- Profile Management: Save and load proxy configurations
- Interactive Mode: Select proxies interactively
- Chain Types: Support for strict and random chain modes
- Retry Logic: Automatic retry on command failure
- Export Functionality: Export ProxyChains configurations
- Dry Run Mode: Preview configurations without execution
- Verbose Output: Detailed logging and configuration display
proxychainsmust be installed and available in PATH- Bash shell (version 4.0 or higher recommended)
- Standard Unix utilities (timeout, mktemp, etc.)
Ubuntu/Debian:
sudo apt-get install proxychainsCentOS/RHEL:
sudo yum install proxychains-ngmacOS:
brew install proxychains-ng- Clone the repository:
git clone https://github.com/yourrepo/proxywrap.git
cd proxywrap- Make the script executable:
chmod +x ProxyWrap.sh- (Optional) Run from anywhere: Add the directory to your PATH or symlink the script.
Note:
ProxyWrap.shrelies on thelib/directory. Ensurelib/is in the same directory as the script if you move it, or keep the script in place and symlink it.
sudo ln -s "$(pwd)/ProxyWrap.sh" /usr/local/bin/proxywrapProxyWrap/
├── ProxyWrap.sh # Main executable
├── lib/ # Modular libraries
│ ├── utils.sh # Utilities (logging, colors)
│ ├── network.sh # Network scanning & MAC resolution
│ ├── proxy.sh # Proxy handling & validation
│ └── profile.sh # Profile management
└── README.md # Documentation
./ProxyWrap.sh [options] -- <command>| Option | Description |
|---|---|
-p <proxy> |
Add proxy (format: "socks5 127.0.0.1 9050") |
-P <file> |
Load proxies from file |
-m <mac> <proto> <port> |
Add proxy by MAC address resolution |
-M <file> |
Load MAC addresses from file |
-r |
Use random_chain instead of strict_chain |
-n |
Disable proxy_dns |
-i |
Interactive proxy selection |
-d |
Dry-run mode (don't execute command) |
--retry <N> |
Retry the command N times if it fails |
--delay <sec> |
Random delay between proxies |
--profile <name> |
Load/save a proxy profile |
--validate |
Validate proxies before use |
--export <file> |
Export proxychains config to file |
--timeout <sec> |
Connection timeout for validation (default: 5) |
--network <range> |
Network range for MAC scanning (default: auto-detect) |
--mac-timeout <sec> |
Timeout for MAC address resolution (default: 10) |
--list-profiles |
List available profiles |
--remove-profile <name> |
Remove a profile |
-v, --verbose |
Verbose output |
-h, --help |
Show help menu |
ProxyWrap supports three proxy protocols:
socks4 <host> <port>socks5 <host> <port>http <host> <port>
Run curl through a single SOCKS5 proxy:
./ProxyWrap.sh -p "socks5 127.0.0.1 9050" -- curl http://ifconfig.meAdd a proxy by resolving its MAC address to an IP:
./ProxyWrap.sh -m "aa:bb:cc:dd:ee:ff" socks5 1080 -- curl http://ifconfig.meUse multiple proxies in random chain mode:
./ProxyWrap.sh -r -p "socks5 127.0.0.1 9050" -p "http 192.168.1.100 8080" -- curl http://ifconfig.meCreate a proxy file (proxies.txt):
socks5 127.0.0.1 9050
http 192.168.1.100 8080
socks4 10.0.0.1 1080
Then use it:
./ProxyWrap.sh -P proxies.txt -- curl http://ifconfig.meSave a proxy configuration as a profile:
./ProxyWrap.sh -p "socks5 127.0.0.1 9050" --profile myvpn -- curl http://ifconfig.meLoad and use a saved profile:
./ProxyWrap.sh --profile myvpn -- firefoxList available profiles:
./ProxyWrap.sh --list-profilesValidate proxies before use:
./ProxyWrap.sh -P proxies.txt --validate --timeout 10 -- curl http://ifconfig.meSelect proxies interactively:
./ProxyWrap.sh -P proxies.txt -i -- curl http://ifconfig.meCombine multiple features:
./ProxyWrap.sh --profile myvpn --validate -i --retry 3 --delay 2 -v -- curl http://ifconfig.mePreview configuration without execution:
./ProxyWrap.sh -p "socks5 127.0.0.1 9050" -d -- curl http://ifconfig.meExport ProxyChains configuration to a file:
./ProxyWrap.sh -p "socks5 127.0.0.1 9050" --export /tmp/proxychains.confProfiles are stored in ~/.proxywrap/ directory as .profile files.
Proxy files should contain one proxy per line in the format:
protocol host port
Comments (lines starting with #) and empty lines are ignored.
Example:
# My proxy list
socks5 127.0.0.1 9050
http 192.168.1.100 8080
# Another proxy
socks4 10.0.0.1 1080
Proxies are used in the exact order specified. If any proxy fails, the connection fails.
A random proxy is selected from the list for each connection.
Usage:
./ProxyWrap.sh -r -P proxies.txt -- curl http://ifconfig.meProxyWrap includes comprehensive error handling:
- Validates proxy formats
- Checks for required dependencies
- Provides clear error messages
- Supports retry logic for failed commands
- Graceful cleanup of temporary files
-
Command not found: proxychains
- Install proxychains using your package manager
- Ensure proxychains is in your PATH
-
Permission denied
- Make sure the script is executable:
chmod +x ProxyWrap.sh
- Make sure the script is executable:
-
Proxy connection failed
- Use
--validateto test proxy connectivity - Check proxy server status and credentials
- Verify firewall settings
- Use
-
Profile not found
- Use
--list-profilesto see available profiles - Check if profile exists in
~/.proxywrap/
- Use
-
Library not found
- Ensure the
lib/directory is in the same folder asProxyWrap.sh
- Ensure the
Use -v or --verbose for detailed output:
./ProxyWrap.sh -v -p "socks5 127.0.0.1 9050" -- curl http://ifconfig.me- Proxy credentials are not encrypted in profile files
- Use appropriate file permissions for proxy configuration files
- Be cautious when using untrusted proxy servers
- Consider using VPN in addition to proxies for enhanced security
Feel free to submit issues, feature requests, or pull requests to improve ProxyWrap.
This project is licensed under the MIT License - see the LICENSE file for details.
- Modularization: Codebase split into
lib/modules for better maintainability. - Improved Parsing: Enhanced argument parsing logic.
- Network Module: Dedicated module for resolution logic.
- Refined UI: Cleaner output and error messages.
- Initial release
- Basic proxy management
- Profile system
- Validation functionality
- Interactive mode
- Export capabilities