netanelcyber / netanelcyber/AdPentestAI-Python
Performance: LDAP and SMB connection pooling
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 5
- Forks
- 2
- Avg merge
- 22h 25m
- Merged PRs (30d)
- 7
Description
Description
Implement connection pooling for LDAP and SMB connections to avoid repeated connection overhead during parallel tool execution.
Current Behavior
- Each tool creates new LDAP connection
- Each tool creates new SMB connection
- Redundant TLS handshakes
- Redundant NTLM negotiation
Proposed Implementation
-
LDAP Connection Pool
- Reuse anonymous bind connections across tools
- RootDSE queries share connection
- Per-DC pool (multiple DCs may be discovered)
- Connection timeout and re-establishment
-
SMB Connection Pool
- Reuse authenticated SMB sessions
- Share enumeration reuses connections
- Null session pooling (if available)
- Automatic reconnection on timeout
-
Pool Management
- Max 10 connections per DC (configurable)
- Idle timeout: 300 seconds
- LRU eviction policy
- Health check before reuse
Implementation
- Create:
adpentest/connection_pool.py - Singleton pattern for pool management
- Thread-safe with locks
- Metrics tracking (hit rate, misses, timeouts)
Files to Update
adpentest/core.py- Use pooled connections- Create:
adpentest/connection_pool.py
Success Criteria
- 50%+ reduction in connection overhead
- No connection pool exhaustion under 16 concurrent tools
- Transparent to existing code
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading adpentest/core.py to trace how LDAP and SMB connections are created during parallel tool execution. Then design the thread-safe singleton in the new adpentest/connection_pool.py, including per-DC pooling, limits, timeouts, reconnection, eviction, health checks, and metrics. Done means core.py uses the pools transparently and the stated concurrency and connection-overhead criteria are met.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- networking, security
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100