How bitwise-01/instagram- works
Project type and purpose
• This is a Python-based CLI tool (“Instagram Bruter”) that orchestrates multiple worker “bots” (browser sessions) to brute-force Instagram logins using a rotating pool of HTTP proxies.
• Key use cases: importing a proxy list into a local database, gathering proxy health stats, pruning poor proxies, and running a multi-threaded brute-force attack against a target account with a given password list.
File structure
• Top-level files:
• instagram.py – the CLI entry point and argument parser
• Pipfile/Pipfile.lock – environment and dependency management
• lib/ package (core modules):
• browser.py – browser/session abstraction for HTTP requests
• bruter.py – orchestrates threads, manages attack lifecycle
• database.py – interacts with local database to store proxies and scores
• proxy.py – proxy representation and health metrics
• proxy_manager.py – pool maintenance, rotation logic, pruning
• password_manager.py– iterates and feeds passwords to workers
• .py – real-time console output, progress bars
• const.py – configuration constants (e.g., DB path, thresholds)
README for additional insights
• Describes commands (--stats, --prune, -u, -p, -px, -m) and workflow steps:
• Upload proxies → saved in DB
• Inspect proxy health → stats
• Prune by score threshold → DB update
• Launch brute-force → multi-bot attack
a. Main components:
• CLI Layer (instagram.py)
• File Loader (reads proxy list, password list)
• Database Layer (SQLite or similar)
• Proxy Manager
• Password Manager
• Bruter (Thread Pool / Worker Manager)
• Browser Workers (HTTP clients)
• / Logger
• External Service (Instagram Web API)
b. Relationships & interactions:
1. CLI → File Loader: ingest --proxylist & --passlist files
2. File Loader → Database Layer: bulk insert proxies
3. CLI --stats/--prune → Proxy Manager ↔ Database Layer → updates scores
4. CLI -u/-p/-m → Bruter & Password Manager & Proxy Manager
5. Bruter → spawns Browser Workers; each Worker pulls next proxy from Proxy Manager and next password from Password Manager
6. Browser Worker → makes HTTP request → Instagram → returns success/fail
7. Browser Worker → reports result to Proxy Manager (to update score) and to Display
c. Architectural patterns & principles:
• Layered architecture: CLI → Core services → Data store → External system
• Producer-consumer for password and proxy feeding
• Thread-pool concurrency in Bruter module
• Single Responsibility: each lib module has a distinct function
d. Key technologies:
• Python 3.9, Pipenv
• SQLite (or file-based DB) via lib/database.py
• HTTP automation (requests or Selenium abstraction in browser.py)
• Multi-threading or async concurrency in bruter.py
Elements
• File → Database
• Proxy Manager ↔ Database
• Bruter → Workers
• Workers → Instagram → Workers
• Workers → Proxy Manager
• Workers → Display
• Blue for data stores (Database)
• Green for processing modules (Bruter, Managers)
• Orange for I/O (CLI, File Loader, Display)
• Grey cloud for external service (Instagram)