How to compile ettercap NG 0.7.3 on Mac OSX when you get that annoying pthread error

[Update]: If you’re trying to compile Ettercap on Leopard, check here.

I’ve been trying to get this compiled for 2 days now, finally found out how to do it. Figured I’d share for everyone else.

If you try this without making the change to the configure file it will complain about you not having support for pthreads, so here’s what you do:

Open the configure script, search for the line that say something like "$OS" != "MACOSX", you need to change this line to say "$OS" != "DARWIN", voila!
./configure && make && make install away! Enjoy ettercap!

Now if I could only get dsniff working as well… :-/

19 Comments

Filed under ettercap, mac, networking, osx, security

19 Responses to How to compile ettercap NG 0.7.3 on Mac OSX when you get that annoying pthread error

  1. Thanks for the trick.. I was simply using Gcc-4 got from fink as compiler setting CC=/sw/bin/gcc-4

    Still I get an error in the ./configure script saying
    configure: error: libnet >= 1.1.2.1 not found

    I tried to get updated version of libnet from fink too but can’t seem to make it recognizi it.
    Do you know how to get rid of that error??

    Thanks a lot.

  2. You could always try building libnet from source instead of fink. I’ve found that if you’re going to mix-and-match libraries and programs from Fink and source, it’s best to either do the program and ALL the libraries from source, or the programs and ALL the libraries from fink.

    In the fink case, fink install ettercap works great if you just need to binary installed without a lot of hassle.

  3. Tupring

    Thanks, I never would have figured that out!

  4. Pingback: Compile Ettercap-NG-0.7.3 natively on Leopard Fix « :wq

  5. Ethan

    You’re AMAZING. Your title is exactly what I would have typed into Google if I’d had any faith that it would work.

  6. Steve

    Anyone stumbling on this would be better served by doing this fix:

    – in wdg.h, add the following line after #include

    #include

  7. Steve

    filename got removed…

    sys/types.h

  8. Quentin

    Hi all.

    I ‘m trying to get Ettercap running on my 10.5.8.
    I used to have the PTHREAD Error and managed it with your trick.

    Now I have a different cool new problem. I can’t “MAKE” or “MAKE INSTALL”.

    Here it’s the message I have on the ending line :

    “checking for libnet… no
    configure: error: libnet >= 1.1.2.1 not found”

    I’m using MacPorts to manage my ports and libs.
    So I Unistall it and Reistall everyting.

    Here it’s my ports list from “port installed” command :

    “The following ports are currently installed:
    autoconf @2.64_2 (active)
    automake @1.11_0 (active)
    expat @2.0.1_0 (active)
    gettext @0.17_4 (active)
    gperf @3.0.4_0 (active)
    help2man @1.36.4_1 (active)
    libiconv @1.13_0 (active)
    libnet11 @1.1.4_0 (active)
    libpcap @1.0.0_0 (active)
    libtool @2.2.6a_0 (active)
    m4 @1.4.13_0 (active)
    ncurses @5.7_0 (active)
    ncursesw @5.7_0 (active)
    p5-locale-gettext @1.05_0 (active)
    perl5 @5.8.9_0 (active)
    perl5.8 @5.8.9_3 (active)
    pkgconfig @0.23_1 (active)
    xorg-libpthread-stubs @0.1_0 (active)
    zlib @1.2.3_3 (active)”

    So I obviously Have Libnet Installed.

    Any idea what my problem is ?

  9. newgen

    well, now we have 2010 and noone seems to have solved the problem:
    “configure: error: libnet >= 1.1.2.1 not found”
    i start thinking that osx might not be the best choice if you want to use it for serious work…

  10. Todd

    I was installing the new ettercap (as of this post 0.7.3) on snow leopard and had both the pthread error, and the lib net error. The -pthread fix described above worked excellently and was very helpful. The libnet >= 1.1.2.1 errer described above was slightly harder for me to figure out.

    Find a tar.gz of the latest libnet from any trusted source website, and download. Compile with your desired options as usual, but do not make (there’s probably a more efficient way to pull this off, but my make skills are only so good). When your ready to “make install” do it like this:
    “sudo make install -i /user/bin/”
    or you can go into your repository bin file and mv your libnet file into your /usr/bin file. I believe the problem is that the configure option is looking for the libnet file in the /usr/bin/ directory.
    If anyone can think of a more efficient fix, I’d love to hear it!

    • kparmar1

      Hi Todd yes there is a better way to do this…

      As you indicated you download libnet and install it (configure/make/make install). This will probably install into /usr/local (check output to make sure. I am assuming that you have not changed the location where libnet will be installed)

      So now we are ready to install ethercap (update the line change “$OS” != “MACOSX” to “$OS” != “DARWIN” in the file configure script as described above).

      ** The bit you are interested in **
      So simply pass the location of the libnet to configure i.e ./configure –with-libnet=/usr/local/

      (the configure script will attempt to look for libnet.h from this supplied location with /include/libnet.h appended. So the full path will be /usr/local//include/libnet.h)
      ************************************

      Then the usual make/make install ( dont forget to first add the fix as detailed above: #include line added to wdg.h).

      Hope that is clear.

  11. Tom

    Hy guys,

    Thanks a Lot for Your additional information.
    After changing the configure file described, downloaded the libnet1.2.1.1 sources… ./configure; make; make install and updating the wdg.h the installation terminates correctly and ettercap is up and running…

    I´m surprised about the quantity of applications getting up and running on a mac. After jperf and wireshark now ettercap. And.. wireshark functions correctly even using the airport adapter!

    So have good time and again – thank a lot for publishing your solutions.
    Tom

  12. Chris

    Does anyone know how to install ettercap-ng with ‘brew’ on mac os x so it includes the GTK?

  13. Alex

    Hey Chris,

    first open the config ruby file of ettercap-ng in my case -> “sudo mate /usr/local/Library/Formula/ettercap-ng.rb”
    now u have to delete the to lines
    “–disable-gtk”,
    “–disable-plugins”,
    save and quit … next step install gtk+ “brew install gtk+”
    now u can run “brew install ettercap-ng”
    and start ettercap “sudo ettercap -G”

    enjoy ettercap with gtk :-)

    best regards
    alex

  14. no sucess:

    In file included from wdg.c:23:
    ./wdg.h:189: error: expected specifier-qualifier-list before ‘u_char’
    ./wdg.h:304: error: expected ‘)’ before ‘pair’
    ./wdg.h:305: error: expected declaration specifiers or ‘…’ before ‘u_char’
    ./wdg.h:312: error: expected ‘)’ before ‘pair’
    wdg.c:81: error: expected ‘)’ before ‘pair’
    wdg.c:82: error: expected declaration specifiers or ‘…’ before ‘u_char’
    wdg.c:83: error: expected ‘)’ before ‘pair’
    wdg.c: In function ‘wdg_destroy_object’:
    wdg.c:697: error: ‘struct wdg_object’ has no member named ‘title’
    wdg.c:697: error: ‘struct wdg_object’ has no member named ‘title’
    wdg.c:697: error: ‘struct wdg_object’ has no member named ‘title’
    wdg.c: At top level:
    wdg.c:756: error: expected declaration specifiers or ‘…’ before ‘u_char’
    wdg.c: In function ‘wdg_set_color’:
    wdg.c:760: error: ‘wdg_t’ has no member named ‘screen_color’
    wdg.c:760: error: ‘pair’ undeclared (first use in this function)
    wdg.c:760: error: (Each undeclared identifier is reported only once
    wdg.c:760: error: for each function it appears in.)
    wdg.c:763: error: ‘wdg_t’ has no member named ‘title_color’
    wdg.c:766: error: ‘wdg_t’ has no member named ‘border_color’
    wdg.c:769: error: ‘wdg_t’ has no member named ‘focus_color’
    wdg.c:772: error: ‘wdg_t’ has no member named ‘window_color’
    wdg.c:775: error: ‘wdg_t’ has no member named ‘select_color’
    wdg.c: At top level:
    wdg.c:783: error: expected ‘)’ before ‘pair’
    wdg.c:791: error: expected ‘)’ before ‘pair’
    wdg.c: In function ‘wdg_set_title’:
    wdg.c:804: error: ‘struct wdg_object’ has no member named ‘align’
    wdg.c:805: error: ‘struct wdg_object’ has no member named ‘title’
    wdg.c:805: error: ‘struct wdg_object’ has no member named ‘title’
    .

    on brew i have an L3 error when making a MITM:
    SEND L3 ERROR: 28 byte packet (0800:01) destined to xxx.xxx.xxx.xxx was not forwarded (libnet_write_raw_ipv4(): -1 bytes written (Invalid argument)

    any help?

  15. Haley

    Hmm I’m still getting the damn pthread error….

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s