Metadata-Version: 2.4
Name: casperac
Version: 0.3.3
Summary: Advanced zero-config dual-layer network anonymization wrapper (WARP + Tor) with Global VPN and Anti-Detect Engine.
Author-email: Cagri <cagritas@users.noreply.github.com>
Project-URL: Homepage, https://github.com/cagritas/casperac
Project-URL: Repository, https://github.com/cagritas/casperac.git
Project-URL: Bug Tracker, https://github.com/cagritas/casperac/issues
Keywords: proxy,anonymity,tor,warp,cli,security
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Security
Classifier: Topic :: Internet :: Proxy Servers
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: typer[all]>=0.9.0
Requires-Dist: rich>=13.0.0
Requires-Dist: requests[socks]>=2.31.0
Dynamic: license-file

<div align="center">
  <img src="https://raw.githubusercontent.com/cagritas/casperac/main/assets/logo.jpg" alt="CasperAC Logo" width="100%"/>

  <h1>CasperAC</h1>
  
  <p><strong>Advanced Dual-Layer Network Anonymization CLI</strong></p>

  <p>
    <a href="https://github.com/cagritas/casperac/actions"><img src="https://img.shields.io/github/actions/workflow/status/cagritas/casperac/ci.yml?branch=main" alt="Build Status"></a>
    <a href="https://pypi.org/project/casperac/"><img src="https://img.shields.io/pypi/v/casperac.svg" alt="PyPI Version"></a>
    <a href="https://pypi.org/project/casperac/"><img src="https://img.shields.io/pypi/pyversions/casperac.svg" alt="Python Versions"></a>
    <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License: MIT"></a>
  </p>
</div>

---

CasperAC is an advanced, automated network anonymization CLI tool designed to wrap any terminal command (like `curl`, `nmap`, or `wget`) in a highly secure **Dual-Layer (WARP + Tor)** tunnel. It features a true **Zero-Config Auto-Deploy** engine that installs and configures its own VPN and proxy infrastructure automatically.

## 🌟 The Dual-Layer Privacy Architecture

CasperAC employs a state-of-the-art dual-layer network stack to ensure maximum privacy and prevent Deep Packet Inspection (DPI):

1. **Layer 1: Cloudflare WARP (WireGuard VPN)**
   - All your system traffic is encrypted and sent to Cloudflare's edge network.
   - **Why?** Your local Internet Service Provider (ISP) or network administrator cannot see that you are using Tor. They only see a standard Cloudflare connection.
2. **Layer 2: The Onion Router (Tor)**
   - Inside the WARP tunnel, CasperAC routes your specific terminal command through the Tor network.
   - **Why?** The Tor Entry Node sees Cloudflare's IP instead of your real IP. Finally, the target server sees a random Tor Exit Node IP.

**Result:** Your ISP doesn't know you use Tor, the Tor network doesn't know your real IP, and the target server doesn't know who you are.

### 📊 Network Data Flow (Dual-Layer Architecture)

```mermaid
sequenceDiagram
    autonumber
    
    actor User as Your Machine
    participant ISP as Your Local ISP
    participant WARP as Cloudflare Edge (Layer 1)
    participant TorEntry as Tor Entry Node
    participant TorMiddle as Tor Middle Relay
    participant TorExit as Tor Exit Node
    participant Target as Target Server (e.g. github.com)

    User->>ISP: Encrypted WireGuard Packet (Dest: Cloudflare)
    note left of ISP: Your ISP only sees a secure<br/>connection to Cloudflare.
    
    ISP->>WARP: Forwards data to Cloudflare Edge
    note over WARP,TorEntry: WARP (Layer 1) hides your<br/>Real IP from the Tor Network.
    
    WARP->>TorEntry: Enters Tor Network (Source IP: Cloudflare)
    note right of TorEntry: Tor Entry Node thinks the traffic<br/>is originating from Cloudflare.
    
    TorEntry->>TorMiddle: 3-Layer Encrypted (Onion) Data
    TorMiddle->>TorExit: Hops within the Tor Network
    
    note over TorExit,Target: Tor (Layer 2) hides your identity<br/>from the Target Server.
    TorExit->>Target: Connects to Target (Source IP: Tor Exit Node)
    
    note right of Target: The target server only sees the<br/>random Tor Exit Node IP.
    
    Target-->>TorExit: Returns Response
    TorExit-->>TorMiddle: 
    TorMiddle-->>TorEntry: 
    TorEntry-->>WARP: 
    WARP-->>ISP: 
    ISP-->>User: Terminal Output (cURL/Wget) Success
```

### 🔍 Why is this better than just using Tor?
1. **Blind ISP (Layer 1):** If you only use Tor, your Internet Service Provider (ISP) knows you are connecting to the Tor network. With CasperAC, your ISP only sees standard, encrypted Cloudflare WARP traffic.
2. **Blind Tor Entry Node (Layer 2):** In a normal Tor setup, the first node (Entry Node) knows your real home IP address. With CasperAC, the Tor network thinks you are connecting from a Cloudflare data center. Your real IP never touches the Tor network.
3. **Blind Target Server:** The destination server only sees a random Tor Exit Node IP and a spoofed `User-Agent` (thanks to the Anti-Detect Engine), keeping you completely anonymous.

## ✨ Features

- 🚀 **Zero-Config Auto-Deploy:** If Tor or Cloudflare WARP are not installed, CasperAC automatically downloads, installs, and configures them for you via system package managers (Homebrew/APT).
- 🛡️ **Dual-Layer Security:** Combines Cloudflare WARP with Tor for ISP-blind, exit-node-anonymized traffic.
- 🌍 **Global VPN Mode:** Instantly route your entire operating system (all browsers and apps) through the Tor network with a single command (`casperac global-on`).
- 🕵️‍♂️ **Anti-Detect Engine:** Intelligently evades bot-protection (like Cloudflare) by dynamically injecting realistic browser fingerprints (User-Agents, sec-ch-ua, Accept-Language) into terminal commands.
- 🔄 **Dynamic IP Rotation:** Effortlessly renew your Tor circuit with a single command to get a fresh IP address.
- 💻 **Environment Management:** Easily export or unset proxy environment variables for your current active shell session.

## 🚀 Usage

### 1. Status Check & Auto-Deploy
Check your network status. If Tor or WARP is missing, CasperAC will auto-deploy them.
```bash
casperac status
```

### 2. Command Proxying (Smart Wrapper)
Wrap any terminal command to automatically route it through Tor, with dynamic browser fingerprint injection.
```bash
casperac run -- curl ifconfig.me
```

#### Spoof Mobile Identity
```bash
casperac run --mobile -- curl ifconfig.me
```

### 3. Global VPN Mode (System-wide Tor)
Route your entire operating system (Safari, Chrome, Spotify, OS updates) through the Tor network.
*(Currently supported on macOS and Linux GNOME desktops).*
```bash
casperac global-on
```
To disable and restore normal internet:
```bash
casperac global-off
```

### 4. Circuit Renewal
```bash
casperac renew
```

## 🚀 Installation

### Prerequisites
- Python 3.8+
- [Tor](https://www.torproject.org/) daemon installed and running locally on port 9050. Control port on 9051.
- [Cloudflare WARP CLI](https://developers.cloudflare.com/warp-client/get-started/linux/) (optional, but recommended for the dual-layer approach).

### Setup via PyPI (Recommended)
```bash
pip install casperac
```

### Setup from Source
```bash
git clone https://github.com/cagritas/casperac.git
cd casperac
pip install -e .
```

## 💻 Usage

```bash
# Check the status of your proxies
casperac status

# Run a specific command through the proxy chain
casperac run -- curl -I https://api.github.com/user

# Renew your Tor exit node
casperac renew

# Source proxy variables into your active shell session
eval $(casperac env-on)

# Revert proxy variables
eval $(casperac env-off)
```

## 🤝 Contributing
Contributions, issues and feature requests are welcome!
Feel free to check [issues page](https://github.com/cagritas/casperac/issues). You can also take a look at the [contributing guide](CONTRIBUTING.md).

## 📝 License
Copyright © 2024.
This project is [MIT](LICENSE) licensed.
