File size: 5,415 Bytes
29a3641
 
 
53cb1a8
de04155
 
 
 
29a3641
de04155
e00b530
d59ea60
2bbd5bd
de04155
fb99a74
de04155
 
29a3641
de04155
6c933ca
de04155
f241053
 
de04155
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6c933ca
de04155
 
 
 
 
6c933ca
de04155
 
 
 
 
6c933ca
de04155
 
 
 
 
6c933ca
de04155
 
 
 
 
 
 
 
 
 
 
 
 
 
6c933ca
f241053
de04155
 
 
 
6c933ca
de04155
6c933ca
de04155
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30ad3d1
 
de04155
 
 
 
6c933ca
de04155
cb3e678
 
de04155
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
import asyncio
import os
import logging
import random
import sys
from threading import Thread
from http.server import HTTPServer, SimpleHTTPRequestHandler
from pyrogram import Client, errors, types, enums

# إعداد اللوق
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(message)s')
logger = logging.getLogger(__name__)

# المتغيرات
API_ID = int(os.getenv("API_ID", "33236310"))
API_HASH = os.getenv("API_HASH", "d8b1097f2d17f2e30d7f82d538071726")
SESSION_STRING = os.getenv("SESSION_STRING") or os.getenv("STRING_SESSION") or ""
TARGET_CHANNEL = os.getenv("TARGET_CHANNEL", "")
KEYWORDS = ["دردشة", "شات", "قروب", "سوالف", "تعارف", "شباب", "بنات", "العاب", "تداول", "عملات", "بينانس", "ضحك"]

PROCESSED_USERS = set()
VISITED_GROUPS = set()

# الجسر
Thread(target=lambda: HTTPServer(("0.0.0.0", 7860), SimpleHTTPRequestHandler).serve_forever(), daemon=True).start()

async def sync_contacts(app):
    """مزامنة الأرقام من ملف contacts.txt"""
    if os.path.exists("contacts.txt"):
        try:
            with open("contacts.txt", "r") as f:
                phones = [line.strip() for line in f if line.strip()]
            if phones:
                sample = random.sample(phones, min(15, len(phones)))
                logger.info(f"📡 مزامنة {len(sample)} رقم جديد من ملفك...")
                contacts = [types.InputPhoneContact(phone=p, first_name=f"User_{random.randint(1,999)}") for p in sample]
                await app.import_contacts(contacts)
        except: pass

async def find_and_hunt(app):
    """البحث عن جروبات عشوائية وصيد المتفاعلين"""
    word = random.choice(KEYWORDS)
    try:
        # البحث عن مجموعات
        search_results = await app.get_inline_bot_results("google", word) # محاكاة بحث
        # ملاحظة: في Pyrogram نستخدم البحث العام
        async for dialog in app.get_chat_history("me", limit=1): # حركة للتمويه
            pass
        
        # لنستخدم قائمة جروبات مستهدفة أو البحث العام
        target_hunt = f"@{word}" # تجربة يوزر الكلمة مباشرة
        chat = await app.join_chat(target_hunt)
        VISITED_GROUPS.add(chat.id)
        logger.info(f"✅ تم اقتحام جروب: {chat.title}")
        
        hunted = []
        async for message in app.get_chat_history(chat.id, limit=100):
            if message.from_user and not message.from_user.is_bot:
                if message.from_user.id not in PROCESSED_USERS:
                    hunted.append(message.from_user)
        
        await app.leave_chat(chat.id) # الخروج لمسح الأثر
        return hunted
    except: return []

async def start_attack():
    app = Client(
        "beast_final", 
        api_id=API_ID, api_hash=API_HASH,
        session_string=SESSION_STRING.strip(),
        device_model="Samsung Galaxy S24 Ultra",
        system_version="Android 14",
        app_version="10.11.1",
        in_memory=True
    )

    try:
        await app.start()
        logger.info("💀 تم إطلاق الوحش بنظام Pyrogram وبصمة سامسونج!")

        while True:
            try:
                await sync_contacts(app)
                
                # تجميع الأهداف
                targets = []
                # من جهات الاتصال
                contacts = await app.get_contacts()
                targets.extend([c for c in contacts if c.id not in PROCESSED_USERS])
                
                # من الاقتحام
                hunted_users = await find_and_hunt(app)
                targets.extend(hunted_users)

                random.shuffle(targets)
                logger.info(f"🎯 تم حشد {len(targets)} ضحية للهجوم...")

                for user in targets:
                    if user.id in PROCESSED_USERS: continue
                    PROCESSED_USERS.add(user.id)
                    name = getattr(user, 'first_name', 'User')

                    try:
                        # محاولة الحشر المباشر
                        await app.add_chat_members(TARGET_CHANNEL, user.id)
                        logger.info(f"✅ حشر مباشر: {name}")
                        await asyncio.sleep(random.randint(10, 20))

                    except (errors.UserPrivacyRestricted, errors.PeerFlood, errors.FloodWait):
                        # الخطة البديلة: قصف الخاص
                        try:
                            msg = f"أهلاً {name}! 👋\nندعوك للانضمام لأكبر تجمع متفاعل من هنا:\nhttps://t.me/{TARGET_CHANNEL}"
                            await app.send_message(user.id, msg)
                            logger.info(f"📨 قصف خاص لـ {name}")
                            await asyncio.sleep(random.randint(10, 20))
                        except: continue
                    except: continue

                logger.info("🔄 تبريد المحرك ...")
                await asyncio.sleep(30)

            except Exception as e:
                logger.error(f"💥 خطأ دورة: {e}")
                await asyncio.sleep(30)
    finally:
        await app.stop()

if __name__ == "__main__":
    asyncio.run(start_attack())