Re: libnet for mac/windows

Karl Andersson <[email protected]> Mon, 28 Jun 2004 03:07:43 +0200
Newsgroups gmane.comp.security.libnet
Message-ID <[email protected]>
>Hi
>
> Do we have libnet for Mac OS X 10.3, Darwin 7.0 and windows 2000, if yes
>can somebody send me the download paths ?
>
>
>  
>
Hi
For the mac there are a few steps you need to do to make libnet work 
(with full etherspoof and all) if you dont need layer3 etherspoof you 
can just download the ordinary and I think it will work just fine.

But if you want etherspoof (not working on wlan with standard drivers)
First goto http://slagheap.net/etherspoof/ and apply the latest 
BIOCSHDRCMPLT patch to the latest xnu source. I'm not going to go over 
every step you need to compile the kernel but here is a very usfull 
link: 
http://www.opendarwin.org/doc/en/articles/building_xnu/building_xnu.php

After you have successfully applied the BIOCSHDRCMPLT patch you also 
need to make a few changes to libnet patchfile below:

--- libnet_link_bpf.c.orig      Mon May 10 01:23:35 2004
+++ libnet_link_bpf.c   Mon May 10 02:00:47 2004
@@ -50,6 +50,11 @@
 #include "../include/os-proto.h"
 #endif
 
+/* hope this works */
+#define BIOCGHDRCMPLT   _IOR('B',116, u_int)
+#define BIOCSHDRCMPLT   _IOW('B',117, u_int)
+
 int
 libnet_bpf_open(int8_t *err_buf)
 {
@@ -97,9 +102,9 @@
     struct bpf_version bv;
     u_int v;
 
-#if defined(BIOCGHDRCMPLT) && defined(BIOCSHDRCMPLT) && !(__APPLE__)
+//#if defined(BIOCGHDRCMPLT) && defined(BIOCSHDRCMPLT)
     u_int spoof_eth_src = 1;
-#endif
+//#endif
 
     if (l == NULL)
     {
@@ -163,14 +168,18 @@
      *  NetBSD and FreeBSD BPF have an ioctl for enabling/disabling
      *  automatic filling of the link level source address.
      */
-#if defined(BIOCGHDRCMPLT) && defined(BIOCSHDRCMPLT) && !(__APPLE__)
+//#if defined(BIOCGHDRCMPLT) && defined(BIOCSHDRCMPLT)
     if (ioctl(l->fd, BIOCSHDRCMPLT, &spoof_eth_src) == -1)
     {
         snprintf(l->err_buf, LIBNET_ERRBUF_SIZE, "%s(): BIOCSHDRCMPLT: 
%s\n",
                 __func__, strerror(errno));
         goto bad;
     }
-#endif
+//#endif

That should make it work just fine.. unfourently the latest xnu 
(xnu-517.3.15) didn't build for me.. prehaps it's only me but it didn't 
work for me.

// IcE