File size: 14,906 Bytes
48e3321 | 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 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 | //ColorDrogen.exe - safety malware
#include <Windows.h>
#include <tchar.h>
#include <stdio.h>
#include <ctime>
#include <cmath>
#include <math.h>
#pragma comment(lib, "winmm.lib")
//#pragma comment(lib, "Msimg32.lib")
#define M_PI 3.14159265358979323846264338327950288
#include <WindowsX.h>
//typedef NTSTATUS(NTAPI* NRHEdef)(NTSTATUS, ULONG, ULONG, PULONG, ULONG, PULONG);
//typedef NTSTATUS(NTAPI* RAPdef)(ULONG, BOOLEAN, BOOLEAN, PBOOLEAN);
/*typedef union _RGBQUAD {
COLORREF rgb;
struct {
BYTE r;
BYTE g;
BYTE b;
BYTE Reserved;
};
}_RGBQUAD, * PRGBQUAD;*/
typedef struct
{
FLOAT h;
FLOAT s;
FLOAT l;
} HSL;
namespace Colors
{
//These HSL functions was made by Wipet, credits to him!
//OBS: I used it in 3 payloads
//Btw ArTicZera created HSV functions, but it sucks unfortunatelly
//So I didn't used in this malware.
HSL rgb2hsl(RGBQUAD rgb)
{
HSL hsl;
BYTE r = rgb.rgbRed;
BYTE g = rgb.rgbGreen;
BYTE b = rgb.rgbBlue;
FLOAT _r = (FLOAT)r / 255.f;
FLOAT _g = (FLOAT)g / 255.f;
FLOAT _b = (FLOAT)b / 255.f;
FLOAT rgbMin = min(min(_r, _g), _b);
FLOAT rgbMax = max(max(_r, _g), _b);
FLOAT fDelta = rgbMax - rgbMin;
FLOAT deltaR;
FLOAT deltaG;
FLOAT deltaB;
FLOAT h = 0.f;
FLOAT s = 0.f;
FLOAT l = (FLOAT)((rgbMax + rgbMin) / 2.f);
if (fDelta != 0.f)
{
s = l < .5f ? (FLOAT)(fDelta / (rgbMax + rgbMin)) : (FLOAT)(fDelta / (2.f - rgbMax - rgbMin));
deltaR = (FLOAT)(((rgbMax - _r) / 6.f + (fDelta / 2.f)) / fDelta);
deltaG = (FLOAT)(((rgbMax - _g) / 6.f + (fDelta / 2.f)) / fDelta);
deltaB = (FLOAT)(((rgbMax - _b) / 6.f + (fDelta / 2.f)) / fDelta);
if (_r == rgbMax) h = deltaB - deltaG;
else if (_g == rgbMax) h = (1.f / 3.f) + deltaR - deltaB;
else if (_b == rgbMax) h = (2.f / 3.f) + deltaG - deltaR;
if (h < 0.f) h += 1.f;
if (h > 1.f) h -= 1.f;
}
hsl.h = h;
hsl.s = s;
hsl.l = l;
return hsl;
}
RGBQUAD hsl2rgb(HSL hsl)
{
RGBQUAD rgb;
FLOAT r = hsl.l;
FLOAT g = hsl.l;
FLOAT b = hsl.l;
FLOAT h = hsl.h;
FLOAT sl = hsl.s;
FLOAT l = hsl.l;
FLOAT v = (l <= .5f) ? (l * (1.f + sl)) : (l + sl - l * sl);
FLOAT m;
FLOAT sv;
FLOAT fract;
FLOAT vsf;
FLOAT mid1;
FLOAT mid2;
INT sextant;
if (v > 0.f)
{
m = l + l - v;
sv = (v - m) / v;
h *= 6.f;
sextant = (INT)h;
fract = h - sextant;
vsf = v * sv * fract;
mid1 = m + vsf;
mid2 = v - vsf;
switch (sextant)
{
case 0:
r = v;
g = mid1;
b = m;
break;
case 1:
r = mid2;
g = v;
b = m;
break;
case 2:
r = m;
g = v;
b = mid1;
break;
case 3:
r = m;
g = mid2;
b = v;
break;
case 4:
r = mid1;
g = m;
b = v;
break;
case 5:
r = v;
g = m;
b = mid2;
break;
}
}
rgb.rgbRed = (BYTE)(r * 255.f);
rgb.rgbGreen = (BYTE)(g * 255.f);
rgb.rgbBlue = (BYTE)(b * 255.f);
return rgb;
}
}
int red, green, blue;
bool ifcolorblue = false, ifblue = false;
COLORREF Hue(int length) { //Credits to Void_/GetMBR
if (red != length) {
red < length; red++;
if (ifblue == true) {
return RGB(red, 0, length);
}
else {
return RGB(red, 0, 0);
}
}
else {
if (green != length) {
green < length; green++;
return RGB(length, green, 0);
}
else {
if (blue != length) {
blue < length; blue++;
return RGB(0, length, blue);
}
else {
red = 0; green = 0; blue = 0;
ifblue = true;
}
}
}
}
/*COLORREF RndRGB() {
int clr = rand() % 5;
if (clr == 0) return RGB(255, 0, 0); if (clr == 1) return RGB(0, 255, 0); if (clr == 2) return RGB(0, 0, 255); if (clr == 3) return RGB(255, 0, 255); if (clr == 4) return RGB(255, 255, 0);
}*/
DWORD WINAPI swirl(LPVOID lpParam) {
HDC hdc = GetDC(0);
int sw = GetSystemMetrics(SM_CXSCREEN), sh = GetSystemMetrics(SM_CYSCREEN), xSize = sh / 10, ySize = 9;
while (1) {
hdc = GetDC(0); HDC hdcMem = CreateCompatibleDC(hdc);
HBITMAP screenshot = CreateCompatibleBitmap(hdc, sw, sh);
SelectObject(hdcMem, screenshot);
BitBlt(hdcMem, 0, 0, sw, sh, hdc, 0, 0, SRCCOPY);
for (int i = 0; i < sh * 2; i++) {
int wave = sin(i / ((float)xSize) * M_PI) * (ySize);
BitBlt(hdcMem, i, 0, 1, sh, hdcMem, i, wave, SRCCOPY);
}
for (int i = 0; i < sw * 2; i++) {
int wave = sin(i / ((float)xSize) * M_PI) * (ySize);
BitBlt(hdcMem, 0, i, sw, 1, hdcMem, wave, i, SRCCOPY);
}
BitBlt(hdc, 0, 0, sw, sh, hdcMem, 0, 0, SRCCOPY);
ReleaseDC(0, hdc);
DeleteDC(hdc); DeleteDC(hdcMem); DeleteObject(screenshot);
Sleep(1);
}
}
DWORD WINAPI textout1(LPVOID lpvd)
{
int x = GetSystemMetrics(0); int y = GetSystemMetrics(1);
LPCSTR text1 = 0;
//LPCSTR text2 = 0;
while (1)
{
HDC hdc = GetDC(0);
SetBkMode(hdc, 0);
text1 = "ColorDrogen.exe";
//text2 = "you asked for it";
SetTextColor(hdc, Hue(239));
HFONT font = CreateFontA(rand() % 100, rand() % 100, rand() % 3600, rand() % 3600, FW_EXTRALIGHT, 0, 0, 0, ANSI_CHARSET, 0, 0, 0, 0, "Webdings");
SelectObject(hdc, font);
TextOutA(hdc, rand() % x, rand() % y, text1, strlen(text1));
//TextOutA(hdc, rand() % x, rand() % y, text2, strlen(text2));
DeleteObject(font);
ReleaseDC(0, hdc);
Sleep(1);
}
}
DWORD WINAPI shader1(LPVOID lpParam) {
int time = GetTickCount();
int w = GetSystemMetrics(0), h = GetSystemMetrics(1);
RGBQUAD* data = (RGBQUAD*)VirtualAlloc(0, (w * h + w) * sizeof(RGBQUAD), MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
for (int i = 0;; i++, i %= 3) {
HDC desk = GetDC(NULL);
HDC hdcdc = CreateCompatibleDC(desk);
HBITMAP hbm = CreateBitmap(w, h, 1, 32, data);
SelectObject(hdcdc, hbm);
BitBlt(hdcdc, 0, 0, w, h, desk, 0, 0, SRCCOPY);
GetBitmapBits(hbm, w * h * 4, data);
int v = 0;
BYTE byte = 0;
if ((GetTickCount() - time) > 60000)
byte = rand() % 0xff;
for (int i = 0; w * h > i; i++) {
INT x = i % w, y = i / w;
if (i % h == 0 && rand() % 100 == 0)
v = rand() % 50;
((BYTE*)(data + i))[v % 3] += x ^ y;
}
SetBitmapBits(hbm, w * h * 4, data);
BitBlt(desk, 0, 0, w, h, hdcdc, 0, 0, SRCCOPY);
DeleteObject(hbm);
DeleteObject(hdcdc);
DeleteObject(desk);
}
return 0;
}
DWORD WINAPI shader2(LPVOID lpvd)
{
HDC hdc = GetDC(NULL);
HDC hdcCopy = CreateCompatibleDC(hdc);
int screenWidth = GetSystemMetrics(SM_CXSCREEN);
int screenHeight = GetSystemMetrics(SM_CYSCREEN);
BITMAPINFO bmpi = { 0 };
HBITMAP bmp;
bmpi.bmiHeader.biSize = sizeof(bmpi);
bmpi.bmiHeader.biWidth = screenWidth;
bmpi.bmiHeader.biHeight = screenHeight;
bmpi.bmiHeader.biPlanes = 1;
bmpi.bmiHeader.biBitCount = 32;
bmpi.bmiHeader.biCompression = BI_RGB;
RGBQUAD* rgbquad = NULL;
HSL hslcolor;
bmp = CreateDIBSection(hdc, &bmpi, DIB_RGB_COLORS, (void**)&rgbquad, NULL, 0);
SelectObject(hdcCopy, bmp);
INT i = 0;
while (1)
{
hdc = GetDC(NULL);
StretchBlt(hdcCopy, 0, 0, screenWidth, screenHeight, hdc, 0, 0, screenWidth, screenHeight, SRCCOPY);
RGBQUAD rgbquadCopy;
for (int x = 0; x < screenWidth; x++)
{
for (int y = 0; y < screenHeight; y++)
{
int index = y * screenWidth + x;
FLOAT fx = (x + i * 4) ^ (y);
rgbquadCopy = rgbquad[index];
hslcolor = Colors::rgb2hsl(rgbquadCopy);
hslcolor.h = fmod(fx / 400.f + y / screenHeight * .2f, 1.f);
rgbquad[index] = Colors::hsl2rgb(hslcolor);
}
}
i++;
StretchBlt(hdc, 0, 0, screenWidth, screenHeight, hdcCopy, 0, 0, screenWidth, screenHeight, SRCCOPY);
ReleaseDC(NULL, hdc);
DeleteDC(hdc);
Sleep(5);
}
return 0x00;
}
DWORD WINAPI shader3(LPVOID lpvd)
{
HDC hdc = GetDC(NULL);
HDC hdcCopy = CreateCompatibleDC(hdc);
int screenWidth = GetSystemMetrics(SM_CXSCREEN);
int screenHeight = GetSystemMetrics(SM_CYSCREEN);
BITMAPINFO bmpi = { 0 };
HBITMAP bmp;
bmpi.bmiHeader.biSize = sizeof(bmpi);
bmpi.bmiHeader.biWidth = screenWidth;
bmpi.bmiHeader.biHeight = screenHeight;
bmpi.bmiHeader.biPlanes = 1;
bmpi.bmiHeader.biBitCount = 32;
bmpi.bmiHeader.biCompression = BI_RGB;
RGBQUAD* rgbquad = NULL;
HSL hslcolor;
bmp = CreateDIBSection(hdc, &bmpi, DIB_RGB_COLORS, (void**)&rgbquad, NULL, 0);
SelectObject(hdcCopy, bmp);
INT i = 0;
while (1)
{
hdc = GetDC(NULL);
StretchBlt(hdcCopy, 0, 0, screenWidth, screenHeight, hdc, 0, 0, screenWidth, screenHeight, SRCCOPY);
RGBQUAD rgbquadCopy;
for (int x = 0; x < screenWidth; x++)
{
for (int y = 0; y < screenHeight; y++)
{
int index = y * screenWidth + x;
FLOAT fx = (y + i * 4);
rgbquadCopy = rgbquad[index];
hslcolor = Colors::rgb2hsl(rgbquadCopy);
hslcolor.h = fmod(fx / 400.f + y / screenHeight * .2f, 1.f);
rgbquad[index] = Colors::hsl2rgb(hslcolor);
}
}
i++;
StretchBlt(hdc, 0, 0, screenWidth, screenHeight, hdcCopy, 0, 0, screenWidth, screenHeight, SRCCOPY);
ReleaseDC(NULL, hdc);
DeleteDC(hdc);
Sleep(5);
}
return 0x00;
}
DWORD WINAPI shader4(LPVOID lpvd)
{
HDC hdc = GetDC(NULL);
HDC hdcCopy = CreateCompatibleDC(hdc);
int screenWidth = GetSystemMetrics(SM_CXSCREEN);
int screenHeight = GetSystemMetrics(SM_CYSCREEN);
BITMAPINFO bmpi = { 0 };
HBITMAP bmp;
bmpi.bmiHeader.biSize = sizeof(bmpi);
bmpi.bmiHeader.biWidth = screenWidth;
bmpi.bmiHeader.biHeight = screenHeight;
bmpi.bmiHeader.biPlanes = 1;
bmpi.bmiHeader.biBitCount = 32;
bmpi.bmiHeader.biCompression = BI_RGB;
RGBQUAD* rgbquad = NULL;
HSL hslcolor;
bmp = CreateDIBSection(hdc, &bmpi, DIB_RGB_COLORS, (void**)&rgbquad, NULL, 0);
SelectObject(hdcCopy, bmp);
INT i = 0;
while (1)
{
hdc = GetDC(NULL);
StretchBlt(hdcCopy, 0, 0, screenWidth, screenHeight, hdc, 0, 0, screenWidth, screenHeight, SRCCOPY);
RGBQUAD rgbquadCopy;
for (int x = 0; x < screenWidth; x++)
{
for (int y = 0; y < screenHeight; y++)
{
int index = y * screenWidth + x;
FLOAT fx = (y + i * 4);
rgbquadCopy = rgbquad[index];
hslcolor = Colors::rgb2hsl(rgbquadCopy);
hslcolor.h = fmod(fx / 400.f + y / screenHeight * .2f, 1.f);
rgbquad[index] = Colors::hsl2rgb(hslcolor);
}
}
i++;
StretchBlt(hdc, 0, 0, screenWidth, screenHeight, hdcCopy, 0, 0, screenWidth, screenHeight, SRCCOPY);
ReleaseDC(NULL, hdc);
DeleteDC(hdc);
Sleep(5);
}
return 0x00;
}
VOID WINAPI sound1() {
HWAVEOUT hWaveOut = 0;
WAVEFORMATEX wfx = { WAVE_FORMAT_PCM, 1, 32000, 32000, 1, 8, 0 };
waveOutOpen(&hWaveOut, WAVE_MAPPER, &wfx, 0, 0, CALLBACK_NULL);
char buffer[32000 * 30] = {};
for (DWORD t = 0; t < sizeof(buffer); ++t)
if (t != 0) buffer[t] = static_cast<char>(t*(t >> 14 & 2 | t >> 11 & 14 & t >> 4));
WAVEHDR header = { buffer, sizeof(buffer), 0, 0, 0, 0, 0, 0 };
waveOutPrepareHeader(hWaveOut, &header, sizeof(WAVEHDR));
waveOutWrite(hWaveOut, &header, sizeof(WAVEHDR));
waveOutUnprepareHeader(hWaveOut, &header, sizeof(WAVEHDR));
waveOutClose(hWaveOut);
}
VOID WINAPI sound2() {
HWAVEOUT hWaveOut = 0;
WAVEFORMATEX wfx = { WAVE_FORMAT_PCM, 1, 8000, 8000, 1, 8, 0 };
waveOutOpen(&hWaveOut, WAVE_MAPPER, &wfx, 0, 0, CALLBACK_NULL);
char buffer[8000 * 30] = {};
for (DWORD t = 0; t < sizeof(buffer); ++t)
if (t != 0) buffer[t] = static_cast<char>(8 * (t*(t >> 7)));
WAVEHDR header = { buffer, sizeof(buffer), 0, 0, 0, 0, 0, 0 };
waveOutPrepareHeader(hWaveOut, &header, sizeof(WAVEHDR));
waveOutWrite(hWaveOut, &header, sizeof(WAVEHDR));
waveOutUnprepareHeader(hWaveOut, &header, sizeof(WAVEHDR));
waveOutClose(hWaveOut);
}
VOID WINAPI sound3() {
HWAVEOUT hWaveOut = 0;
WAVEFORMATEX wfx = { WAVE_FORMAT_PCM, 1, 8000, 8000, 1, 8, 0 };
waveOutOpen(&hWaveOut, WAVE_MAPPER, &wfx, 0, 0, CALLBACK_NULL);
char buffer[8000 * 30] = {};
for (DWORD t = 0; t < sizeof(buffer); ++t)
if (t != 0) buffer[t] = static_cast<char>(t*t / 1 / 1 ^ t >> 5);
WAVEHDR header = { buffer, sizeof(buffer), 0, 0, 0, 0, 0, 0 };
waveOutPrepareHeader(hWaveOut, &header, sizeof(WAVEHDR));
waveOutWrite(hWaveOut, &header, sizeof(WAVEHDR));
waveOutUnprepareHeader(hWaveOut, &header, sizeof(WAVEHDR));
waveOutClose(hWaveOut);
}
VOID WINAPI sound4() {
HWAVEOUT hWaveOut = 0;
WAVEFORMATEX wfx = { WAVE_FORMAT_PCM, 1, 11025, 11025, 1, 8, 0 };
waveOutOpen(&hWaveOut, WAVE_MAPPER, &wfx, 0, 0, CALLBACK_NULL);
char buffer[11025 * 60] = {};
for (DWORD t = 0; t < sizeof(buffer); ++t)
if (t != 0) buffer[t] = static_cast<char>(500 * (2 * t >> 8 | 1 * t >> 1));
WAVEHDR header = { buffer, sizeof(buffer), 0, 0, 0, 0, 0, 0 };
waveOutPrepareHeader(hWaveOut, &header, sizeof(WAVEHDR));
waveOutWrite(hWaveOut, &header, sizeof(WAVEHDR));
waveOutUnprepareHeader(hWaveOut, &header, sizeof(WAVEHDR));
waveOutClose(hWaveOut);
}
VOID WINAPI sound5() {
HWAVEOUT hWaveOut = 0;
WAVEFORMATEX wfx = { WAVE_FORMAT_PCM, 1, 11025, 11025, 1, 8, 0 };
waveOutOpen(&hWaveOut, WAVE_MAPPER, &wfx, 0, 0, CALLBACK_NULL);
char buffer[11025 * 60] = {};
for (DWORD t = 0; t < sizeof(buffer); ++t)
if (t != 0) buffer[t] = static_cast<char>(2 * (t * (t >> 6 | t | t) + (7 & t >> 11)));
WAVEHDR header = { buffer, sizeof(buffer), 0, 0, 0, 0, 0, 0 };
waveOutPrepareHeader(hWaveOut, &header, sizeof(WAVEHDR));
waveOutWrite(hWaveOut, &header, sizeof(WAVEHDR));
waveOutUnprepareHeader(hWaveOut, &header, sizeof(WAVEHDR));
waveOutClose(hWaveOut);
}
int main() {
if (MessageBoxW(NULL, L"ColorDrogen.exe, Run?", L"ColorDrogen.exe", MB_YESNO | MB_ICONEXCLAMATION) == IDNO)
{
ExitProcess(0);
}
else
{
if (MessageBoxW(NULL, L"Are you sure?", L"Final Warning, ColorDrogen.exe", MB_YESNO | MB_ICONEXCLAMATION) == IDNO)
{
ExitProcess(0);
}
else
Sleep(600);
HANDLE thread1 = CreateThread(0, 0, swirl, 0, 0, 0);
sound1();
Sleep(30000);
Sleep(200);
TerminateThread(thread1, 0);
CloseHandle(thread1);
HANDLE thread2 = CreateThread(0, 0, textout1, 0, 0, 0);
sound2();
Sleep(30000);
Sleep(200);
TerminateThread(thread2, 0);
CloseHandle(thread2);
HANDLE thread3 = CreateThread(0, 0, shader1, 0, 0, 0);
sound3();
Sleep(30000);
Sleep(200);
TerminateThread(thread3, 0);
CloseHandle(thread3);
HANDLE thread4 = CreateThread(0, 0, shader2, 0, 0, 0);
sound4();
Sleep(60000);
Sleep(200);
TerminateThread(thread4, 0);
CloseHandle(thread4);
HANDLE thread5 = CreateThread(0, 0, shader3, 0, 0, 0);
sound5();
Sleep(30000);
Sleep(200);
TerminateThread(thread5, 0);
CloseHandle(thread5);
HANDLE thread6 = CreateThread(0, 0, shader4, 0, 0, 0);
sound5();
Sleep(30000);
Sleep(200);
}
} |