要发送数据包让LAN内某个机子掉线,那个ARP包该怎么填充?

Cricketol 2007-12-20 01:56:04
如题.........................
...全文
140 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
Cricketol 2008-02-21
  • 打赏
  • 举报
回复
多谢各位
小弟明白了
  • 打赏
  • 举报
回复
发一个arp包,让对方认为nat是假的mac地址.
CODE163 2008-02-13
  • 打赏
  • 举报
回复
冒充路由
awperpvip 2008-02-06
  • 打赏
  • 举报
回复
大过年的,不会是想做不好的事情吧...
lin_style 2008-02-06
  • 打赏
  • 举报
回复
冒充路由器返回一个路由不可达到的错误,不就可以了。。
Cricketol 2008-02-05
  • 打赏
  • 举报
回复
有人知道吗??!!!
快崩溃啦!!!
Cricketol 2008-02-04
  • 打赏
  • 举报
回复
或者这样说

假设局域网中存在主机192.168.0.7
其网卡MAC未知
我现在想发送个包去欺骗他
是不是只要知道他的IP就足够了
还是需要他确切的MAC然后才能欺骗?
也就是说是不是欺骗包中ethernet_head.dest_mac和arpHead.dest_addr一定要为他真实的MAC才能发送欺骗包?

typedef struct ethernet_head //14 bytes
{
unsigned char dest_mac[6]; //destination MAC
unsigned char source_mac[6]; //source MAC
unsigned short eh_type; //ethernet type
}ethernet_head, *pEthernetHead;

typedef struct arpHead //
{
unsigned short hardware_type; //type of hardware
unsigned short protocol_type; //type of protocol
unsigned char add_len; //length of hardware address
unsigned char pro_len; //length of protocol address
unsigned short option; //operate number
unsigned char sour_addr[6]; //source hardware address
unsigned long sour_ip; //source protocol address
unsigned char dest_addr[6]; //destination hardware address
unsigned long dest_ip; //destination protocol address
unsigned char padding[18];
}arpHead, *pArpHead;

还有个问题:
//这样取得MAC并保存在 Adapter.adapt.adapter_address 中
NCB ncb;
UCHAR uRetCode;
LANA_ENUM lana_enum;

memset( &ncb, 0, sizeof(ncb) );
ncb.ncb_command = NCBENUM;

ncb.ncb_buffer = (unsigned char *) &lana_enum;
ncb.ncb_length = sizeof(lana_enum);

//send NCBENUM command to the netcard to get the info of the netcard
//FOREXAMPLE:the number of netcards,the serie of each netcard
uRetCode = Netbios( &ncb );
if ( uRetCode == 0 )
{

memset(&ncb,0,sizeof(ncb) );
ncb.ncb_command=NCBRESET;
ncb.ncb_lana_num=lana_enum.lana[0]; // select the default MAC(the first one)

//send a NCBRESET command to the selected netcard to initialize it
uRetCode=Netbios( &ncb );

memset(&ncb,0,sizeof(ncb));
ncb.ncb_command=NCBASTAT;
ncb.ncb_lana_num=lana_enum.lana[0]; // select the default MAC(the first one)

strcpy((char *)ncb.ncb_callname,"*");
ncb.ncb_buffer=(unsigned char *)&Adapter;

ncb.ncb_length=sizeof(Adapter);
uRetCode=Netbios(&ncb);
}
然后这样填充是否正确?
memcpy(ehead.source_mac,Adapter.adapt.adapter_address,6);
memcpy(ArpHead.sour_addr,Adapter.adapt.adapter_address,6);

18,357

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 网络编程
c++c语言开发语言 技术论坛(原bbs)
社区管理员
  • 网络编程
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧