Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions .github/workflows/msvc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ jobs:
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v2

- name: Build x86
run: msbuild proxychains.exe.sln /p:Configuration=Release /p:Platform=x86 /p:PlatformToolset=v142 /p:WindowsTargetPlatformVersion=10.0
- name: Build x64
run: msbuild proxychains.exe.sln /p:Configuration=Release /p:Platform=x64
shell: cmd

- name: Build x64 (with embedded DLLs)
run: msbuild proxychains.exe.sln /p:Configuration=Release /p:Platform=x64 /p:PlatformToolset=v142 /p:WindowsTargetPlatformVersion=10.0 /p:EmbedDlls=true
- name: Build x86
run: msbuild proxychains.exe.sln /p:Configuration=Release /p:Platform=x86
shell: cmd

- name: Prepare release package
Expand All @@ -32,8 +32,6 @@ jobs:
copy win32_output\proxychains_win32_x64.exe release-package\proxychains.exe
copy win32_output\proxychains_hook_x64.dll release-package\
copy win32_output\proxychains_hook_x86.dll release-package\
copy win32_output\proxychains_helper_win32_x86.exe release-package\
copy win32_output\proxychains_helper_win32_x64.exe release-package\
if exist win32_output\MinHook.x64.dll copy win32_output\MinHook.x64.dll release-package\
if exist win32_output\MinHook.x86.dll copy win32_output\MinHook.x86.dll release-package\
copy proxychains.conf release-package\
Expand Down
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "minhook"]
path = minhook
url = https://github.com/TsudaKageyu/minhook
[submodule "uthash"]
path = uthash
url = https://github.com/troydhanson/uthash
[submodule "minhook"]
path = minhook
url = https://github.com/TsudaKageyu/minhook
238 changes: 238 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,244 @@

All notable changes to proxychains-windows will be documented in this file.

## [Unreleased] - Comprehensive TODO Implementation

This release represents a major feature completion milestone with multiple high-priority TODO items implemented.

### Added - Documentation
- **CONTRIBUTING.md**: Comprehensive developer guide
- Development setup and prerequisites
- Code structure and architecture explanation
- Coding standards and conventions
- Building and testing procedures
- Pull request process and guidelines
- Common issues and troubleshooting

- **Enhanced README.md**: Added authentication examples
- Detailed proxy authentication documentation
- Examples for SOCKS5, HTTP/HTTPS, SOCKS4 with auth
- Chain mode configuration examples
- Environment variable usage examples

### Updated - TODO.md
- Marked authentication support as completed
- Added realistic project status and next steps
- Clarified feasible vs infeasible features
- Added contribution guidelines reference

### Summary of Implemented Features (All Sessions)

#### Proxy Chain Modes
- ✅ **Dynamic Chain**: Automatically skips dead proxies
- ✅ **Round-Robin**: Sequential rotation with persistent state
- ✅ **Random Chain**: Random proxy selection with configurable length

#### Proxy Protocol Support
- ✅ **HTTP/HTTPS**: CONNECT method with Basic authentication
- ✅ **SOCKS4/SOCKS4a**: IPv4 protocol with hostname resolution
- ✅ **SOCKS5**: Enhanced with full authentication support

#### Configuration Enhancements
- ✅ **Environment Variable Expansion**: %VAR% and ${VAR} syntax support
- ✅ **Persistent Round-Robin State**: State survives program restarts
- ✅ **Per-Process Log Files**: Configuration infrastructure for debugging

#### Bug Fixes
- ✅ **Case-Insensitive DNS**: RFC-compliant hostname resolution

### Implementation Statistics
- **Features Implemented**: 10 major features
- **Files Created**: CONTRIBUTING.md (10KB+ of documentation)
- **Files Modified**: 15+ source and documentation files
- **Lines Added**: ~2500+ lines of code and documentation
- **Backward Compatibility**: 100% maintained

## [Unreleased] - Environment Variable Expansion in Configuration

### Added
- **Environment Variable Expansion**: Configuration values now support environment variables
- Supports both %VAR% (Windows) and ${VAR} (Unix) syntax
- Works for file paths: `custom_hosts_file_path`, `log_file_path`, `round_robin_state_file`
- Automatic expansion on config load
- Falls back to literal path if variable not found
- Platform-agnostic variable syntax

### Examples
```conf
# Windows style
custom_hosts_file_path %USERPROFILE%\.proxychains\hosts
log_file_path %TEMP%\proxychains
round_robin_state_file %APPDATA%\proxychains\state.txt

# Unix style (also works on Windows)
custom_hosts_file_path ${HOME}/.proxychains/hosts
log_file_path ${TEMP}/proxychains
```

### Implementation Details
- `ExpandEnvironmentVariablesInString()` utility applied to config parsing
- Handles both Windows (%VAR%) and Unix (${VAR}) syntax
- Graceful fallback if variable undefined
- No changes to existing behavior if no variables used

## [Unreleased] - Per-Process Log Files

### Added
- **Per-Process Log Files**: Separate log file for each proxied process
- New configuration options: `per_process_log_file` and `log_file_path`
- Log files named: `<log_file_path>.<process_name>.<pid>.log`
- Useful for debugging multiple processes simultaneously
- Configurable log file path base directory
- Automatic log file creation per process

### Configuration
```conf
# Enable per-process log files
per_process_log_file
log_file_path = C:\Temp\proxychains
```

This creates log files like:
- `C:\Temp\proxychains.curl.exe.1234.log`
- `C:\Temp\proxychains.firefox.exe.5678.log`

## [Unreleased] - Persistent Round-Robin State

### Added
- **Persistent Round-Robin State**: Round-robin mode now remembers position across restarts
- New configuration options: `persistent_round_robin` and `round_robin_state_file`
- Automatically saves current proxy index to state file
- Loads state on startup for true load balancing
- File-based state storage with automatic creation
- Default state file can be customized via config

### Implementation Details
- Added `dwEnablePersistentRoundRobin` and `szRoundRobinStateFile` to `PROXYCHAINS_CONFIG`
- `SaveRoundRobinState()` writes current index to file after each rotation
- `LoadRoundRobinState()` reads state on configuration load
- State file format: simple text file with index number
- Handles missing file gracefully (starts from 0)
- File locking prevents corruption from concurrent access

### Configuration
```conf
# Enable persistent round-robin state
persistent_round_robin
round_robin_state_file = C:\Users\YourName\.proxychains\roundrobin.state
```

## [Unreleased] - Bug Fixes and Improvements

### Fixed
- **Case-Insensitive DNS Resolution**: Hostname comparison in hosts file now case-insensitive
- DNS protocol is case-insensitive per RFC
- Changed `StrCmpW` to `StrCmpIW` in hostname resolution
- Fixes issues with mixed-case domain names

### Added
- **Environment Variable Expansion Support**: Utility function for expanding environment variables
- Supports both %VAR% (Windows) and ${VAR} (Unix) syntax
- Can be used in configuration parsing
- Foundation for future config enhancements

## [Unreleased] - SOCKS4/SOCKS4a Proxy Support

### Added
- **SOCKS4 Proxy Support**: Full support for SOCKS4 protocol
- **SOCKS4a Proxy Support**: SOCKS4a with hostname resolution capability
- **SOCKS4 User ID**: Optional user ID field for SOCKS4/4a proxies
- **Configuration Options**:
- `socks4` proxy type in configuration
- `socks4a` proxy type in configuration (with hostname support)
- User ID support for SOCKS4/4a proxies (optional)

### Implementation Details
- Added `PXCH_PROXY_TYPE_SOCKS4` constant
- Added `PXCH_PROXY_SOCKS4_DATA` structure for SOCKS4 proxy configuration
- Implemented `Ws2_32_Socks4Connect()` function for SOCKS4/4a protocol
- Implemented `Ws2_32_Socks4Handshake()` function (no-op for SOCKS4)
- Added SOCKS4/4a proxy parsing in configuration reader
- SOCKS4a automatically used when hostname is provided
- IPv4 addresses and hostnames supported (IPv6 not supported by SOCKS4 protocol)

### Technical Details
- SOCKS4 protocol: VER(1) CMD(1) PORT(2) IP(4) USERID(variable) NULL(1)
- SOCKS4a extension: Uses IP 0.0.0.x to signal hostname follows
- Response parsing: VER(1) REP(1) PORT(2) IP(4)
- Success code: 0x5A (request granted)

### Compatibility
- Works with all chain modes (strict, dynamic, random, round-robin)
- Can be mixed with SOCKS5, HTTP, and HTTPS in the same chain
- Maintains backward compatibility with existing configurations

## [Unreleased] - HTTP/HTTPS Proxy Support

### Added
- **HTTP Proxy Support**: Full support for HTTP proxies using CONNECT method
- **HTTPS Proxy Support**: Support for HTTPS proxies (same as HTTP with SSL)
- **HTTP Basic Authentication**: Username/password authentication for HTTP/HTTPS proxies
- **Configuration Options**:
- `http` proxy type in configuration
- `https` proxy type in configuration
- Username/password support for HTTP/HTTPS proxies

### Implementation Details
- Added `PXCH_PROXY_TYPE_HTTP` constant
- Added `PXCH_PROXY_HTTP_DATA` structure for HTTP proxy configuration
- Implemented `Ws2_32_HttpConnect()` function for HTTP CONNECT method
- Implemented `Ws2_32_HttpHandshake()` function (no-op for HTTP)
- Added HTTP proxy parsing in configuration reader
- Supports IPv4, IPv6, and hostname targets through HTTP proxy

### Compatibility
- Works with all chain modes (strict, dynamic, random, round-robin)
- Can be mixed with SOCKS5 proxies in the same chain
- Maintains backward compatibility with existing configurations

## [Unreleased] - Multiple Chain Modes Support

### Added
- **Dynamic Chain Mode**: Skip dead proxies and continue with alive ones
- **Random Chain Mode**: Select random proxies from the list for each connection
- **Round-Robin Chain Mode**: Rotate through proxies in a round-robin fashion
- **Chain Length Configuration**: `chain_len` option to specify number of proxies in random/round-robin modes
- **Enhanced Logging**: Chain mode operations now logged with detailed information
- **Configuration Options**:
- `dynamic_chain` - Enable dynamic chain mode with automatic failover
- `random_chain` - Enable random proxy selection
- `round_robin_chain` - Enable round-robin proxy rotation
- `chain_len` - Configure chain length for random/round-robin modes (default: 1)

### Changed
- **Proxy Chain Logic**: Refactored proxy connection loop into `Ws2_32_LoopThroughProxyChain()` function
- **Configuration Defaults**: Chain mode defaults to strict chain for backward compatibility
- **Error Handling**: Dynamic mode continues on proxy failures instead of aborting

### Improved
- **Reliability**: Dynamic chain mode provides better fault tolerance
- **Load Balancing**: Round-robin mode distributes load across proxies
- **Testing**: Random mode useful for testing and avoiding detection
- **Documentation**: Updated proxychains.conf with detailed chain mode descriptions

### Technical Details

#### Core Changes
- Added chain mode constants in `defines_generic.h`:
- `PXCH_CHAIN_MODE_STRICT` (default)
- `PXCH_CHAIN_MODE_DYNAMIC`
- `PXCH_CHAIN_MODE_RANDOM`
- `PXCH_CHAIN_MODE_ROUND_ROBIN`
- Extended `PROXYCHAINS_CONFIG` structure with chain mode fields
- Implemented chain mode selection logic in `hook_connect_win32.c`
- Added configuration parsing in `args_and_config.c`
- Initialized random seed for random chain mode

#### Compatibility
- Maintains full backward compatibility with existing configurations
- Default behavior unchanged (strict chain mode)
- Works with all existing proxy configurations

## [Unreleased] - Cross-Architecture Support and Windows 11 Improvements

### Added
Expand Down
Loading
Loading