Update to x11/driftnet

2021-02-14 Thread Claudio Jeker
Here is an update to x11/driftnet. Switch to a github repo that seems to
include some of our fixes and is a bit more current. Drop maintainer since
I don't think this program is that useful anymore. Most websites are
using secure transport now and so driftnet is rather useless.

What do other people think?
-- 
:wq Claudio

Index: Makefile
===
RCS file: /cvs/ports/x11/driftnet/Makefile,v
retrieving revision 1.16
diff -u -p -r1.16 Makefile
--- Makefile12 Jul 2019 20:51:09 -  1.16
+++ Makefile14 Feb 2021 08:26:07 -
@@ -1,36 +1,35 @@
 # $OpenBSD: Makefile,v 1.16 2019/07/12 20:51:09 sthen Exp $
 
-COMMENT=   network sniffer that grabs and displays images
+COMMENT =  network sniffer that grabs and displays images
 
-VERSION =  1.0
-DISTNAME=  driftnet_${VERSION}.orig
-PKGNAME=   driftnet-${VERSION}
-REVISION=  1
-CATEGORIES=x11
+VERSION =  1.2.0
+DISTNAME = driftnet-${VERSION}
 
-HOMEPAGE=  http://www.ex-parrot.com/~chris/driftnet/
+GH_ACCOUNT =   deiv
+GH_PROJECT =   driftnet
+GH_TAGNAME =   v1.2.0
 
-MAINTAINER=Claudio Jeker 
+CATEGORIES =   x11
+
+HOMEPAGE = http://www.ex-parrot.com/~chris/driftnet/
 
 # GPLv2+
 PERMIT_PACKAGE=Yes
 
-MASTER_SITES=  https://launchpad.net/ubuntu/+archive/primary/+files/
-
 WANTLIB += c pcap gif png pthread jpeg
 WANTLIB += glib-2.0 gobject-2.0 gdk-x11-2.0 gtk-x11-2.0
 
-LIB_DEPENDS=   graphics/giflib \
+LIB_DEPENDS =  graphics/giflib \
graphics/jpeg \
+   www/libwebsockets \
x11/gtk+2
 
-NO_TEST=   Yes
-
-WRKDIST =  ${WRKDIR}/${PKGNAME}
+NO_TEST =  Yes
 
 AUTOCONF_VERSION = 2.69
-CONFIGURE_STYLE =  autoconf
-CONFIGURE_ENV =CPPFLAGS="-I${LOCALBASE}/include/gtk-2.0" \
+AUTOMAKE_VERSION = 1.16
+CONFIGURE_STYLE =  autoreconf
+CONFIGURE_ENV =CPPFLAGS="-I${LOCALBASE}/include 
-I${LOCALBASE}/include/gtk-2.0" \
LDFLAGS="-L${LOCALBASE}/lib -L${X11BASE}/lib"
 
 .include 
Index: distinfo
===
RCS file: /cvs/ports/x11/driftnet/distinfo,v
retrieving revision 1.2
diff -u -p -r1.2 distinfo
--- distinfo24 Jun 2013 16:48:43 -  1.2
+++ distinfo10 Oct 2019 08:30:15 -
@@ -1,2 +1,2 @@
-SHA256 (driftnet_1.0.orig.tar.gz) = 
suZ17EyO7BJhmNQBCIC1edcozxflIQbX9A8KE1AA6qc=
-SIZE (driftnet_1.0.orig.tar.gz) = 151184
+SHA256 (driftnet-1.2.0.tar.gz) = TXuIjatzdB+YpBRDMDa2YdiG9uRIZmT+jPSRNEZlob8=
+SIZE (driftnet-1.2.0.tar.gz) = 144356
Index: patches/patch-Makefile_am
===
RCS file: patches/patch-Makefile_am
diff -N patches/patch-Makefile_am
--- /dev/null   1 Jan 1970 00:00:00 -
+++ patches/patch-Makefile_am   10 Oct 2019 08:37:17 -
@@ -0,0 +1,21 @@
+$OpenBSD$
+
+Index: Makefile.am
+--- Makefile.am.orig
 Makefile.am
+@@ -4,13 +4,13 @@ SUBDIRS = src
+ dist_doc_DATA = README.md TODO
+ EXTRA_DIST = driftnet.1.in CREDITS Changelog
+ 
+-MANPAGE = driftnet.1.gz
++MANPAGE = driftnet.1
+ MAN1DIR = $(DESTDIR)$(mandir)/man1/
+ 
+ clean-local:
+   rm -f $(MANPAGE)
+ 
+ install-data-local: driftnet.1.in
+-  cat $(srcdir)/driftnet.1.in | sed s/@*VERSION@*/$(VERSION)/ | 
GZIP=$(GZIP_ENV) gzip > $(MANPAGE)
++  cat $(srcdir)/driftnet.1.in | sed s/@*VERSION@*/$(VERSION)/ > $(MANPAGE)
+   $(MKDIR_P) $(MAN1DIR)
+   $(INSTALL_DATA) $(MANPAGE) $(MAN1DIR) || exit $$?
Index: patches/patch-Makefile_in
===
RCS file: patches/patch-Makefile_in
diff -N patches/patch-Makefile_in
--- patches/patch-Makefile_in   24 Jun 2013 16:48:43 -  1.1
+++ /dev/null   1 Jan 1970 00:00:00 -
@@ -1,21 +0,0 @@
-$OpenBSD: patch-Makefile_in,v 1.1 2013/06/24 16:48:43 sebastia Exp $
 Makefile.in.orig   Sun May 12 18:33:18 2013
-+++ Makefile.inFri Jun 21 09:38:27 2013
-@@ -258,7 +258,7 @@ top_srcdir = @top_srcdir@
- SUBDIRS = src
- dist_doc_DATA = README TODO
- EXTRA_DIST = driftnet.1.in CHANGES CREDITS
--MANPAGE = driftnet.1.gz
-+MANPAGE = driftnet.1
- MAN1DIR = $(DESTDIR)$(mandir)/man1/
- all: all-recursive
- 
-@@ -773,7 +773,7 @@ clean-local:
-   rm -f $(MANPAGE)
- 
- install-data-local: driftnet.1.in
--  cat $(srcdir)/driftnet.1.in | sed s/@*VERSION@*/$(VERSION)/ | 
GZIP=$(GZIP_ENV) gzip > $(MANPAGE)
-+  cat $(srcdir)/driftnet.1.in | sed s/@*VERSION@*/$(VERSION)/ > $(MANPAGE)
-   $(MKDIR_P) $(MAN1DIR)
-   $(INSTALL_DATA) $(MANPAGE) $(MAN1DIR) || exit $$?
- 
Index: patches/patch-configure_ac
===
RCS file: /cvs/ports/x11/driftnet/patches/patch-configure_ac,v
retrieving revision 1.1
diff -u -p -r1.1 patch-configure_ac
--- patches/patch-configure_ac  24 Jun 2013 16:48:43 -  1.1
+++ patches/patch-c

Re: Update to x11/driftnet

2021-02-14 Thread Klemens Nanni
On Sun, Feb 14, 2021 at 09:32:06AM +0100, Claudio Jeker wrote:
> Here is an update to x11/driftnet. Switch to a github repo that seems to
> include some of our fixes and is a bit more current. Drop maintainer since
> I don't think this program is that useful anymore. Most websites are
> using secure transport now and so driftnet is rather useless.
> 
> What do other people think?
Regarding content extraction modulo pretty display functions, does this
port do anything which Wireshark cannot do?

I've applied your diff an ran `make install' on my X230 to test the
program:

$ driftnet
Sun Feb 14 12:26:29 2021 [driftnet] error: pcap_activate: You don't 
have permission to capture on that device
Segmentation fault (core dumped) 

$ egdb --quiet -batch -ex bt driftnet ./driftnet.core
[New process 324491]
Core was generated by `driftnet'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  pthread_cancel (thread=0x0) at /usr/src/lib/librthread/rthread.c:430
430 struct tib *tib = thread->tib;
#0  pthread_cancel (thread=0x0) at /usr/src/lib/librthread/rthread.c:430
#1  0x0f1078010e5a in ?? ()
#2  0x0f1078009d61 in ?? ()
#3  0x0f107800af7f in ?? ()
#4  0x0f1078009dec in ?? ()
#5  0x0f1078009371 in ?? ()
#6  0x in ?? ()

Even `driftnet --help' dumps core (only `-h' is recognised).

Dropping to an unprivileged user as per `-Z' only works if that user is
also able to use X:

$ doas driftnet -v -i trunk0 -Z _tcpdump
Sun Feb 14 12:36:00 2021 [driftnet] info: listening on trunk0 in 
promiscuous mode
Sun Feb 14 12:36:00 2021 [driftnet] info: dropped privileges to user 
_tcpdump
Sun Feb 14 12:36:00 2021 [driftnet] info: using temporary file 
directory /tmp//driftnet-8Idoys
Sun Feb 14 12:36:00 2021 [driftnet] info: started display child, pid 
90930
No protocol specified

(driftnet:90930): Gtk-WARNING **: 12:36:00.501: cannot open display: :0
Sun Feb 14 12:36:01 2021 [driftnet] info: child process 90930 exited 
with status 1

It also shits its pants on invalid filters:

$ doas driftnet -v -i trunk0 -Z _tcpdump foo
Sun Feb 14 12:41:01 2021 [driftnet] error: pcap_compile: syntax error 
in filter expression
Segmentation fault 


This is the log from opening http://www.ex-parrot.com/~chris/driftnet/
and http://www.ex-parrot.com/~chris/driftnet/screenshot.jpg directly in
a browser;  I fail to see the JPEG image being extracted/displayed/etc.

$ doas driftnet -v -i trunk0 -Z kn
Sun Feb 14 12:32:15 2021 [driftnet] info: listening on trunk0 in 
promiscuous mode
Sun Feb 14 12:32:15 2021 [driftnet] info: using temporary file 
directory /tmp//driftnet-pySkMn
Sun Feb 14 12:32:15 2021 [driftnet] info: started display child, pid 
42009
Sun Feb 14 12:32:24 2021 [driftnet] info: new connection: 
192.168.2.199:23160 -> 93.93.130.166:80
Sun Feb 14 12:32:24 2021 [driftnet] info: new connection: 
93.93.130.166:80 -> 192.168.2.199:23160
Sun Feb 14 12:32:29 2021 [driftnet] info: connection closing: 
93.93.130.166:80 -> 192.168.2.199:23160, 214 bytes transferred
^C
Sun Feb 14 12:32:46 2021 [driftnet] info: caught signal 2

How about you just remove this port?  OK kn to do so, but I'll gladly
take care of this myself with your OK as well.

> Index: Makefile
> ===
> RCS file: /cvs/ports/x11/driftnet/Makefile,v
> retrieving revision 1.16
> diff -u -p -r1.16 Makefile
> --- Makefile  12 Jul 2019 20:51:09 -  1.16
> +++ Makefile  14 Feb 2021 08:26:07 -
> @@ -1,36 +1,35 @@
>  # $OpenBSD: Makefile,v 1.16 2019/07/12 20:51:09 sthen Exp $
>  
> -COMMENT= network sniffer that grabs and displays images
> +COMMENT =network sniffer that grabs and displays images
>  
> -VERSION =1.0
> -DISTNAME=driftnet_${VERSION}.orig
> -PKGNAME= driftnet-${VERSION}
> -REVISION=1
> -CATEGORIES=  x11
> +VERSION =1.2.0
> +DISTNAME =   driftnet-${VERSION}
>  
> -HOMEPAGE=http://www.ex-parrot.com/~chris/driftnet/
> +GH_ACCOUNT = deiv
> +GH_PROJECT = driftnet
> +GH_TAGNAME = v1.2.0
There is https://github.com/deiv/driftnet/releases/tag/v1.3.0 available.

> -MAINTAINER=  Claudio Jeker 
> +CATEGORIES = x11
> +
> +HOMEPAGE =   http://www.ex-parrot.com/~chris/driftnet/
Has working HTTPS.

>  # GPLv2+
>  PERMIT_PACKAGE=  Yes
>  
> -MASTER_SITES=https://launchpad.net/ubuntu/+archive/primary/+files/
> -
>  WANTLIB += c pcap gif png pthread jpeg
>  WANTLIB += glib-2.0 gobject-2.0 gdk-x11-2.0 gtk-x11-2.0
>  
> -LIB_DEPENDS= gra

Re: Update to x11/driftnet

2021-02-15 Thread Claudio Jeker
On Sun, Feb 14, 2021 at 12:42:12PM +0100, Klemens Nanni wrote:
> On Sun, Feb 14, 2021 at 09:32:06AM +0100, Claudio Jeker wrote:
> > Here is an update to x11/driftnet. Switch to a github repo that seems to
> > include some of our fixes and is a bit more current. Drop maintainer since
> > I don't think this program is that useful anymore. Most websites are
> > using secure transport now and so driftnet is rather useless.
> > 
> > What do other people think?
> Regarding content extraction modulo pretty display functions, does this
> port do anything which Wireshark cannot do?
> 
> I've applied your diff an ran `make install' on my X230 to test the
> program:
> 
>   $ driftnet
>   Sun Feb 14 12:26:29 2021 [driftnet] error: pcap_activate: You don't 
> have permission to capture on that device
>   Segmentation fault (core dumped) 
> 
>   $ egdb --quiet -batch -ex bt driftnet ./driftnet.core
>   [New process 324491]
>   Core was generated by `driftnet'.
>   Program terminated with signal SIGSEGV, Segmentation fault.
>   #0  pthread_cancel (thread=0x0) at /usr/src/lib/librthread/rthread.c:430
>   430 struct tib *tib = thread->tib;
>   #0  pthread_cancel (thread=0x0) at /usr/src/lib/librthread/rthread.c:430
>   #1  0x0f1078010e5a in ?? ()
>   #2  0x0f1078009d61 in ?? ()
>   #3  0x0f107800af7f in ?? ()
>   #4  0x0f1078009dec in ?? ()
>   #5  0x0f1078009371 in ?? ()
>   #6  0x in ?? ()
> 
> Even `driftnet --help' dumps core (only `-h' is recognised).
> 
> Dropping to an unprivileged user as per `-Z' only works if that user is
> also able to use X:
> 
>   $ doas driftnet -v -i trunk0 -Z _tcpdump
>   Sun Feb 14 12:36:00 2021 [driftnet] info: listening on trunk0 in 
> promiscuous mode
>   Sun Feb 14 12:36:00 2021 [driftnet] info: dropped privileges to user 
> _tcpdump
>   Sun Feb 14 12:36:00 2021 [driftnet] info: using temporary file 
> directory /tmp//driftnet-8Idoys
>   Sun Feb 14 12:36:00 2021 [driftnet] info: started display child, pid 
> 90930
>   No protocol specified
> 
>   (driftnet:90930): Gtk-WARNING **: 12:36:00.501: cannot open display: :0
>   Sun Feb 14 12:36:01 2021 [driftnet] info: child process 90930 exited 
> with status 1
> 
> It also shits its pants on invalid filters:
> 
>   $ doas driftnet -v -i trunk0 -Z _tcpdump foo
>   Sun Feb 14 12:41:01 2021 [driftnet] error: pcap_compile: syntax error 
> in filter expression
>   Segmentation fault 
> 
> 
> This is the log from opening http://www.ex-parrot.com/~chris/driftnet/
> and http://www.ex-parrot.com/~chris/driftnet/screenshot.jpg directly in
> a browser;  I fail to see the JPEG image being extracted/displayed/etc.
> 
>   $ doas driftnet -v -i trunk0 -Z kn
>   Sun Feb 14 12:32:15 2021 [driftnet] info: listening on trunk0 in 
> promiscuous mode
>   Sun Feb 14 12:32:15 2021 [driftnet] info: using temporary file 
> directory /tmp//driftnet-pySkMn
>   Sun Feb 14 12:32:15 2021 [driftnet] info: started display child, pid 
> 42009
>   Sun Feb 14 12:32:24 2021 [driftnet] info: new connection: 
> 192.168.2.199:23160 -> 93.93.130.166:80
>   Sun Feb 14 12:32:24 2021 [driftnet] info: new connection: 
> 93.93.130.166:80 -> 192.168.2.199:23160
>   Sun Feb 14 12:32:29 2021 [driftnet] info: connection closing: 
> 93.93.130.166:80 -> 192.168.2.199:23160, 214 bytes transferred
>   ^C
>   Sun Feb 14 12:32:46 2021 [driftnet] info: caught signal 2
> 
> How about you just remove this port?  OK kn to do so, but I'll gladly
> take care of this myself with your OK as well.

Yes, driftnet is built around the assumption that every image is sent in a
seperate HTTP connection, it does not handle pipelining or embedded images
and the world moved on since the early 2000. Also not surprised about all
the crashes, it was not build to be a solid network sniffer.
I wont miss this gimmick tool and happy to remove it.
 
> > Index: Makefile
> > ===
> > RCS file: /cvs/ports/x11/driftnet/Makefile,v
> > retrieving revision 1.16
> > diff -u -p -r1.16 Makefile
> > --- Makefile12 Jul 2019 20:51:09 -  1.16
> > +++ Makefile14 Feb 2021 08:26:07 -
> > @@ -1,36 +1,35 @@
> >  # $OpenBSD: Makefile,v 1.16 2019/07/12 20:51:09 sthen Exp $
> >  
> > -COMMENT=   network sniffer that grabs and displays images
> > +COMMENT =  network sniffer that grabs and displays images
> >  
> > -VERSION =  1.0
> &