[Click] How to spoof MAC?

Eddie Kohler kohler at cs.ucla.edu
Fri Jan 26 16:00:30 EST 2007


Hi,

Have you tried adding a Print() after your MacIPSpoofer?  This certainly
looks like
you are setting the ethernet address correctly.  The problem may be in
where you
are running Click -- kernel or user, for example -- and particularly in
what your
device is.  Maybe the device driver is resetting the source ethernet
address.

Eddie


静 李 wrote:
> How to spoof MAC?
> 
> I made a element::MACIPSpoofer(my_mac,my_ip),and want
> to change the incomeming packets src MAC ,src ip. But
> it seems that it only change the src ip! 
> 
> Here is main part of the macipspoofer.cc code :
> Packet *
> MACIPSpoofer::simple_action(Packet *p)
> {
>   if (WritablePacket *q = p->uniqueify()) {
>     click_ether *ethh = reinterpret_cast<click_ether
> *>(q->data());  
> 	memcpy(ethh->ether_shost,_ethh.ether_shost,6);
> 
>     click_ip *ip =(click_ip *)(q->data()+
>  				    sizeof(click_ether));
> 
>  	  ip->ip_src = _ip_src;
> 
>     return q;
>   } else
>     return 0;
> }
> 
> and part of configuration :
>  ......
> ls_prio :: PrioSched -> 
>  spoofer::MACIPSpoofer(11:22:33:44:55:66, 10.10.7.7)->
>  ToDevice(wlan0);
> 
> 
> The result on my local PC1 seems that the src_MAC has
> been changed to 
> 11:22:33:44:55:66 , and it also can be seen by the
> Ethereal.
> But on the other PC2 which get these spoofed_packed
> ,it seems that the packes src_MAC are still my PC's
> real MAC.And by the PC2's Ethereal I also see my PC's
> real MAC. 
> why this happens ? Why I can only change the src_ip
> field (on PC2, src_ip has been changed ),but not
> src_MAC field ?  Is there something wrong with my c++
> code  or  configuration ? 
> 
> Thank in advance ! 
> 
> 
> 
> 		
> ___________________________________________________________ 
> 抢注雅虎免费邮箱-3.5G容量,20M附件! 
> http://cn.mail.yahoo.com
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
> 



More information about the click mailing list