Ettercap / ettercap

Ettercap Project
http://www.ettercap-project.org
GNU General Public License v2.0
2.33k stars 489 forks source link

GTK version does not work #51

Closed Nuc1eoN closed 11 years ago

Nuc1eoN commented 11 years ago

Please take a look at this bug report (ArchLinux): https://bugs.archlinux.org/task/32533

LocutusOfBorg commented 11 years ago

Sorry but this seems to be a downstream bug, did you enable gtk when building it? This is done by cmake or ccmake while building, the new system needs an update of the packaging script

LocutusOfBorg commented 11 years ago

I'm not an arch linux guy, but I can see ettercap 0.7.4 on the repository https://aur.archlinux.org/packages/?O=0&C=0&SeB=nd&K=ettercap&outdated=&SB=n&SO=a&PP=50&do_Search=Go

which version has this problem?

LocutusOfBorg commented 11 years ago

and this problem [1] seems to be a duplicate of [2] [1] https://bugs.archlinux.org/task/32537?string=ettercap&project=5&search_name=&type[0]=&sev[0]=&pri[0]=&due[0]=&reported[0]=&cat[0]=&status[0]=open&percent[0]=&opened=&dev=&closed=&duedatefrom=&duedateto=&changedfrom=&changedto=&openedfrom=&openedto=&closedfrom=&closedto= [2] https://github.com/Ettercap/ettercap/issues/50

could you please confirm?

LocutusOfBorg commented 11 years ago

Ok I think I've got a clue for one bug https://projects.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/ettercap&id=8bd422a12b4c94f08b2b36950326d5a33d4bc92a

as previous said I'm not an arch linux folk, but this line seems to be wrong cmake -D ENABLE_GTK=OFF -D CMAKE_INSTALL_PREFIX=/usr -D INSTALL_PREFX=/usr -D CMAKE_BUILD_TYPE=RELEASE ../

ENABLE_GTK=ON should be the right flag

LocutusOfBorg commented 11 years ago

Ok your PKGBUILD seems to be wrong. the line 32 cmake -D INSTALL_PREFX=/usr -D CMAKE_BUILD_TYPE=RELEASE ../ should be cmake -D ENABLE_GTK=ON -D INSTALL_PREFX=/usr -D CMAKE_BUILD_TYPE=RELEASE ../

For the missing file I don't know, is included in the source, so I don't know which kind of downstream bug are you triggering... the file etter.finger.mac is in the share directory, it should work when launching ettercap from the root directory sudo ./build/src/ettercap -G

Nuc1eoN commented 11 years ago

Sorry, I was aware that this could be a downstream bug, but it seams that nobody so far is interested in fixing it downstream. The version in the repos is 0.7.5. The link you provided at the beginning is wrong (it's the Arch User Repo). The correct package is: https://www.archlinux.org/packages/community/x86_64/ettercap/ But it seems you later found the correct PKGBUILD ;). I'll follow your advise and recompile it with the correct values.

Thanks for your interest

PS: Yes [1] is a duplicate of [2]. It is also affecting me.

Nuc1eoN commented 11 years ago

Hm, recompiled it with the new PKGBUILD but the behavior is unchanged :( I understand that this is difficult for you to reproduce, as you don't use ArchLinux.

The etter.finger.mac is in the directory /usr/share/ettercap, but ettercap looks into the directory where it was build. Something's wrong there... e.g. I compiled/build ettercap from this directory: /home/nuc/AUR/ettercap/ and so the error message is:

ERROR : 2, No such file or directory [/home/nuc/AUR/ettercap/src/ettercap-0.7.5-gtk/src/ec_manuf.c:manuf_init:126]

Cannot open etter.finger.mac

Nuc1eoN commented 11 years ago

I just noticed that you once referred to line 32 - which I corrected, and to line 26. Should I also change ENABLE_GTK=OFF to ON in line 26?

UPDATE: Ok, I changed line 26, too and it works now! The etter.finger.mac error-message also disappeared. Thanks for your help! :)

PS: I noticed that ettercap-gtk can only be started by ettercap -G now. In version 0.7.4 I always started it with ettercap-gtk. Do you know why it changed? Also I noticed that since ettercap 0.7.5, there is no icon for starting ettercap in the menu. Is that normal?

LocutusOfBorg commented 11 years ago

No, at line 26 is good, the OFF flag is to build the version without gtk... I think you should start with ettercap-gtk, I don't know, the line cd "${srcdir}"/${pkgbase}-${pkgver}-gtk/build install -Dm755 src/ettercap "${pkgdir}"/usr/bin/ettercap-gtk

is good, but this is not an alias, so I think you should to ettercap-gtk -G or make an alias

Nuc1eoN commented 11 years ago

But, as I already said: It doesn't work without changing line 26! I am aware of, that this ALWAYS will install ettercap-gtk. So what could still be wrong? Why doesn't it work without changing line 26?

EDIT: sorry, closed by mistake EDIT2: btw the new values in the PKGBILD also solve this issue: https://github.com/Ettercap/ettercap/issues/50

LocutusOfBorg commented 11 years ago

what does it mean "It doesn't work without changing line 26"

I mean only with changing the line 32 and leaving the 26 with OFF flag what exactly doesn't work?

Nuc1eoN commented 11 years ago

It means that ettercap behaves the EXACT same way as described in the bugreport(s) when NOT changing line 26 to ON. Something must still be wrong with line 36, I suppose.

I mean the bugs aren't solved by just changing line 32 to cmake -D ENABLE_GTK=ON -D INSTALL_PREFX=/usr -D CMAKE_BUILD_TYPE=RELEASE ../

Nuc1eoN commented 11 years ago

To sum it up:

When only line 32 changed (= nothing changes): -> those bugs occur: https://github.com/Ettercap/ettercap/issues/50 https://bugs.archlinux.org/task/32537?project=5&cat%5B0%5D=33&string=ettercap https://bugs.archlinux.org/task/32533?project=5&cat%5B0%5D=33&string=ettercap and the "etter.finger.mac"-bug (looks into the build directory instead of /usr/share/ettercap/)

Also I noticed that the ettercap logo is NOT shown in the GTK version (the big logo in the middle)

When line 26 is changed: -> every bug mentioned above is solved

LocutusOfBorg commented 11 years ago

Ok I think I've got a clue.

The problem is that when you cmake the gtk version not only a different ettercap binary is built, there are built so many other gtk* source files.

If you DON'T install the ettercap-gtk source code you won't find them, so I suggest to make install both ettercap versions (and not only the cli version) or make install the gtk version and AFTER linking the only cli file

//# $Id$ //# Maintainer: //# Contributor: Tom Newsom Jeepster@gmx.co.uk

pkgbase=ettercap pkgname=('ettercap' 'ettercap-gtk') pkgver=0.7.5 pkgrel=1 arch=('i686' 'x86_64') url="http://ettercap.github.com/ettercap/" license=('GPL') makedepends=('ghostscript' 'cmake' 'libpcap' 'libltdl' 'libnet' 'gtk2') options=('!libtool' '!makeflags' '!emptydirs') source=("https://github.com/downloads/Ettercap/$pkgbase/$pkgbase-$pkgver.tar.gz") md5sums=('ab2354bf9c91195f06ad0b5d058565a4')

build() { cd "${srcdir}"

sed -i 's/su-to-root -c/gksu/' ${pkgbase}-${pkgver}/desktop/ettercap.desktop

cp -r ${pkgbase}-${pkgver} ${pkgbase}-${pkgver}-gtk

cd ${pkgbase}-${pkgver} mkdir build cd build cmake -D ENABLE_GTK=OFF -D CMAKE_INSTALL_PREFIX=/usr -D INSTALL_PREFX=/usr -D CMAKE_BUILD_TYPE=RELEASE ../ make

cd "$srcdir"/${pkgbase}-${pkgver}-gtk mkdir build cd build cmake -D ENABLE_GTK=ON -D INSTALL_PREFX=/usr -D CMAKE_BUILD_TYPE=RELEASE ../ make }

package_ettercap() { pkgdesc="A network sniffer/interceptor/logger for ethernet LANs - console" depends=('openssl' 'libpcap' 'pcre' 'libltdl' 'libnet') backup=('etc/etter.conf')

cd "${srcdir}"/${pkgbase}-${pkgver}/build make DESTDIR="${pkgdir}" install }

package_ettercap-gtk() { pkgdesc="A network sniffer/interceptor/logger for ethernet LANs - GTK" depends=('ettercap' 'gtk2')

cd "${srcdir}"/${pkgbase}-${pkgver}-gtk/build make DESTDIR="${pkgdir}" install install -Dm755 src/ettercap "${pkgdir}"/usr/bin/ettercap-gtk } md5sums=('037b28cd94efa086a795060fc0f76080')

LocutusOfBorg commented 11 years ago

let me know if this works.

Basically you have to leave row 26 with off flag and add in the package_ettercap-gtk() function the line

make DESTDIR="${pkgdir}" install

Nuc1eoN commented 11 years ago

I can build the packages, but when I try to install them the following message occurs:

Error: failed to commit transaction (conflicting files) /etc/ettercap/etter.conf exists in 'ettercap' and 'ettercap-gtk' /etc/ettercap/etter.dns exists in 'ettercap' and 'ettercap-gtk' /etc/ettercap/etter.nbns exists in 'ettercap' and 'ettercap-gtk'

LocutusOfBorg commented 11 years ago

ok I understand, so try this one (I don't know how to tell the package manager to build gtk before the other one)

something like that

//# $Id$ //# Maintainer: //# Contributor: Tom Newsom Jeepster@gmx.co.uk

pkgbase=ettercap pkgname=('ettercap' 'ettercap-gtk') pkgver=0.7.5 pkgrel=1 arch=('i686' 'x86_64') url="http://ettercap.github.com/ettercap/" license=('GPL') makedepends=('ghostscript' 'cmake' 'libpcap' 'libltdl' 'libnet' 'gtk2') options=('!libtool' '!makeflags' '!emptydirs') source=("https://github.com/downloads/Ettercap/$pkgbase/$pkgbase-$pkgver.tar.gz") md5sums=('ab2354bf9c91195f06ad0b5d058565a4')

build() { cd "${srcdir}"

sed -i 's/su-to-root -c/gksu/' ${pkgbase}-${pkgver}/desktop/ettercap.desktop

cp -r ${pkgbase}-${pkgver} ${pkgbase}-${pkgver}-gtk

cd ${pkgbase}-${pkgver} mkdir build cd build cmake -D ENABLE_GTK=OFF -D CMAKE_INSTALL_PREFIX=/usr -D INSTALL_PREFX=/usr -D CMAKE_BUILD_TYPE=RELEASE ../ make

cd "$srcdir"/${pkgbase}-${pkgver}-gtk mkdir build cd build cmake -D ENABLE_GTK=ON -D CMAKE_INSTALL_PREFIX=/usr -D INSTALL_PREFX=/usr -D CMAKE_BUILD_TYPE=RELEASE ../ make }

package_ettercap-gtk() { pkgdesc="A network sniffer/interceptor/logger for ethernet LANs - GTK" depends=('ettercap' 'gtk2')

cd "${srcdir}"/${pkgbase}-${pkgver}-gtk/build make DESTDIR="${pkgdir}" install mv "${pkgdir}"/usr/bin/ettercap "${pkgdir}"/usr/bin/ettercap-gtk }

package_ettercap() { pkgdesc="A network sniffer/interceptor/logger for ethernet LANs - console" depends=('openssl' 'libpcap' 'pcre' 'libltdl' 'libnet') backup=('etc/etter.conf')

cd "${srcdir}"/${pkgbase}-${pkgver}/build install -Dm755 src/ettercap "${pkgdir}"/usr/bin/ettercap

}

md5sums=('037b28cd94efa086a795060fc0f76080')

Nuc1eoN commented 11 years ago

yea, thanx "ettercap-gtk -G" now starts the GTK-version and it works fine. Could you please explain to me why "ettercap -G" and "ettercap-gtk" worked in previous releases but do not in 0.7.5? ettercap and ettercap-gtk seem to me like very separate packages

PS: This wasn't actually an Arch-only bug, was it?

LocutusOfBorg commented 11 years ago

sorry but what does happen when you start ettercap -G ?

it was an arch bug, seems ettercap source code gives the possibility to build with or without gtk support, and they are 2 different packages, so downstream archs should give two different packages as well, what arch claims to do is to give one package and another depending on the first one...

It was for sure a downstream bug :)

Nuc1eoN commented 11 years ago
# ettercap -G

ettercap 0.7.5 copyright 2001-2012 Ettercap Development Team

GTK support is not compiled in ettercap

they are 2 different packages

Does it mean they do not depend on each other / can run as standalone?

It was for sure a downstream bug :)

How then that bug: https://bugzilla.redhat.com/show_bug.cgi?id=862116 is solved for me, although it is a Fedora issue?

LocutusOfBorg commented 11 years ago

I think if you install only ettercap and not the gtk version it won't work, not sure, I don't know so much of arch...

The fedora bug I think is a cross platform bug, emilio I think is working on it and seems to be a external library issue (maybe) could you please tell me the lib version are you using? 'ghostscript' 'cmake' 'libpcap' 'libltdl' 'libnet' 'gtk2'

Just one more thing, the bug doesn't occur when you scan for host in a not connected nic. (would be great if the bug is really solved for you, it will help us so much in troubleshooting the problem)

Nuc1eoN commented 11 years ago

ghostscript 9.06 cmake 2.8.10.1 libpcap 1.3.0 libltdl 2.4.2 libnet 1.1.6 gtk2 2.24.13 and lib32-gtk2 2.24.13 (32 bit)

Just one more thing, the bug doesn't occur when you scan for host in a not connected nic.

Do you mean not connected to a network? I did the scan while I was connected to a wifi router.

I think if you install only ettercap and not the gtk version it won't work, not sure, I don't know so much of arch...

You are right, now ettercap only works with the gtk package. That's actually quite stupid because the sense of splitting them in two packages is to choose if you need the GUI or not. If you can't do that then why splitting them? I still don't understand why it worked for 0.7.4 but not for 0.7.5 (I don't want to criticize, I just want to understand).

LocutusOfBorg commented 11 years ago

I understand your point and this is right.

The problem between 0.7.4 and 0.7.5 is the transition to a cmake build system.

Unfortunately I don't know how so much about cmake and I cannot help in arch way to solve this downstream bug, I think you can do a make install --force or something like that in order to override the duplicate files between ettercap and gtk version.

Otherwise a clean solution is to provide two different packages for cli and gui, and not make a depend for the gtk->cli version.

Two standalone packages could be an easy solution https://wiki.archlinux.org/index.php/Pacman

Nuc1eoN commented 11 years ago

Otherwise a clean solution is to provide two different packages for cli and gui, and not make a depend for the gtk->cli version.

Yes, I had the same thought. Best to mark them as "conflicting" packages.

I'll propose the idea to the Arch-devs :)

Once again thanks for your commitment despite it's been a downstream bug :+1:

LocutusOfBorg commented 11 years ago

Anyway I'm pretty sure the arch-devs will have a more appropriate solution for avoid the double make error

jelly commented 11 years ago

Hi, I'm the dev who packaged it to the repos ;). I thought that i could build an ettercap binary with disabling ettercap and then a gtk one with GTK_ENABLED=yes. But it looks like I couldnt, so thanks to Nucleon I fixed the split build.

But cmake doesn't generate an ettercap-gtk binary which launches the GTK application, is this intended?

Thanks for the effort btw!

LocutusOfBorg commented 11 years ago

Maybe emilio who created the cmake script has intended to give just one binary, with gtk or without.

To have both possibility you need to run cmake twice...

I'll look for giving a ettercap-gtk directly, but I don't know the impact this will have on other distro

eaescob commented 11 years ago

Yeah, the only way is to run cmake twice.

brav0hax commented 11 years ago

So even if GTK is enabled during the build you can't run ettercap -G and have it work properly?

Nuc1eoN commented 11 years ago

So even if GTK is enabled during the build you can't run ettercap -G and have it work properly?

This comment should answer your question: https://github.com/Ettercap/ettercap/issues/51#issuecomment-10409750

LocutusOfBorg commented 11 years ago

Could anybody close this issue?

Nuc1eoN commented 11 years ago

Closed.