pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

p0f: Import p0f-2.0.8nb1



Module Name:	pkgsrc-wip
Committed By:	Leonardo Taccari <leot%NetBSD.org@localhost>
Pushed By:	leot
Date:		Wed Jul 29 18:38:43 2026 +0200
Changeset:	5b9e9578d2700d30970cd8c602657cb5e18a323d

Added Files:
	p0f/DESCR
	p0f/Makefile
	p0f/PLIST
	p0f/distinfo
	p0f/patches/patch-aa
	p0f/patches/patch-ad
	p0f/patches/patch-ae
	p0f/patches/patch-p0f-query.c

Log Message:
p0f: Import p0f-2.0.8nb1

P0f v2 is a versatile passive OS fingerprinting tool. P0f can identify the
operating system on:

- machines that connect to your box (SYN mode),
- machines you connect to (SYN+ACK mode),
- machine you cannot connect to (RST+ mode),
- machines whose communications you can observe.

P0f can also do many other tricks, and can detect or measure the following:

- firewall presence or masquerading (useful for policy enforcement),
- presence of a load balancer setup,
- the distance to the remote system and its uptime,
- other guy's network hookup (DSL, OC3, avian carriers) and his ISP.

Imported from security/p0f.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=5b9e9578d2700d30970cd8c602657cb5e18a323d

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 p0f/DESCR                     | 14 +++++++++++++
 p0f/Makefile                  | 46 +++++++++++++++++++++++++++++++++++++++++++
 p0f/PLIST                     |  8 ++++++++
 p0f/distinfo                  |  9 +++++++++
 p0f/patches/patch-aa          | 31 +++++++++++++++++++++++++++++
 p0f/patches/patch-ad          | 21 ++++++++++++++++++++
 p0f/patches/patch-ae          | 22 +++++++++++++++++++++
 p0f/patches/patch-p0f-query.c | 14 +++++++++++++
 8 files changed, 165 insertions(+)

diffs:
diff --git a/p0f/DESCR b/p0f/DESCR
new file mode 100644
index 0000000000..492598e302
--- /dev/null
+++ b/p0f/DESCR
@@ -0,0 +1,14 @@
+P0f v2 is a versatile passive OS fingerprinting tool. P0f can identify the
+operating system on:
+
+- machines that connect to your box (SYN mode),
+- machines you connect to (SYN+ACK mode),
+- machine you cannot connect to (RST+ mode),
+- machines whose communications you can observe.
+
+P0f can also do many other tricks, and can detect or measure the following:
+
+- firewall presence or masquerading (useful for policy enforcement),
+- presence of a load balancer setup,
+- the distance to the remote system and its uptime,
+- other guy's network hookup (DSL, OC3, avian carriers) and his ISP.
diff --git a/p0f/Makefile b/p0f/Makefile
new file mode 100644
index 0000000000..866c6afd90
--- /dev/null
+++ b/p0f/Makefile
@@ -0,0 +1,46 @@
+# $NetBSD: Makefile,v 1.30 2013/02/06 19:31:04 jperkin Exp $
+#
+
+DISTNAME=	p0f-2.0.8
+PKGREVISION=	1
+CATEGORIES=	security net
+MASTER_SITES=	http://lcamtuf.coredump.cx/p0f/
+EXTRACT_SUFX=	.tgz
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=	http://lcamtuf.coredump.cx/p0f.shtml
+COMMENT=	Passive OS fingerprinting tool
+LICENSE=	gnu-lgpl-v2.1
+
+WRKSRC=		${WRKDIR}/p0f
+
+PKG_SYSCONFSUBDIR=	p0f
+
+MAKE_ENV+=	LIBPCAP_PREFIX=${BUILDLINK_PREFIX.libpcap}
+
+CONF_FILES=	${PREFIX}/share/examples/p0f/p0f.fp ${PKG_SYSCONFDIR}/p0f.fp
+CONF_FILES+=	${PREFIX}/share/examples/p0f/p0fa.fp ${PKG_SYSCONFDIR}/p0fa.fp
+CONF_FILES+=	${PREFIX}/share/examples/p0f/p0fr.fp ${PKG_SYSCONFDIR}/p0fr.fp
+
+SUBST_CLASSES+=		paths
+SUBST_STAGE.paths=	pre-build
+SUBST_FILES.paths=	config.h p0f.1
+SUBST_SED.paths=	-e "s|/etc/p0f|${PKG_SYSCONFDIR}|g"
+SUBST_MESSAGE.paths=	Fixing paths.
+
+INSTALLATION_DIRS=	bin ${PKGMANDIR}/man1 share/doc/p0f share/examples/p0f
+
+post-patch:
+	${LN} -s NetBSD ${WRKSRC}/mk/DragonFly
+
+do-install:
+	${INSTALL_PROGRAM} ${WRKSRC}/p0f ${DESTDIR}${PREFIX}/bin
+	${INSTALL_DATA} ${WRKSRC}/doc/README ${DESTDIR}${PREFIX}/share/doc/p0f/p0f.README
+	${INSTALL_DATA} ${WRKSRC}/p0frep ${DESTDIR}${PREFIX}/share/doc/p0f/p0frep
+	${INSTALL_DATA} ${WRKSRC}/p0f.fp ${DESTDIR}${PREFIX}/share/examples/p0f
+	${INSTALL_DATA} ${WRKSRC}/p0fa.fp ${DESTDIR}${PREFIX}/share/examples/p0f
+	${INSTALL_DATA} ${WRKSRC}/p0fr.fp ${DESTDIR}${PREFIX}/share/examples/p0f
+	${INSTALL_MAN} ${WRKSRC}/p0f.1 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1
+
+.include "../../net/libpcap/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/p0f/PLIST b/p0f/PLIST
new file mode 100644
index 0000000000..ffa4875cd0
--- /dev/null
+++ b/p0f/PLIST
@@ -0,0 +1,8 @@
+@comment $NetBSD: PLIST,v 1.7 2009/06/14 18:13:34 joerg Exp $
+bin/p0f
+man/man1/p0f.1
+share/doc/p0f/p0f.README
+share/doc/p0f/p0frep
+share/examples/p0f/p0f.fp
+share/examples/p0f/p0fa.fp
+share/examples/p0f/p0fr.fp
diff --git a/p0f/distinfo b/p0f/distinfo
new file mode 100644
index 0000000000..8f9f1a97a3
--- /dev/null
+++ b/p0f/distinfo
@@ -0,0 +1,9 @@
+$NetBSD: distinfo,v 1.23 2026/03/17 07:28:17 nia Exp $
+
+BLAKE2s (p0f-2.0.8.tgz) = e7ddbe4c96cb0edd4dcde49400e82bc39119c1d53b5e24cf810598abcd3553c6
+SHA512 (p0f-2.0.8.tgz) = ccfc512a79df7acfad007c6d67398c5c0745be165095adc9dc4ba62cf165c962f98d92e038b3be4eb23cd13e3a9231827c4bd8a0a3bf0cdf68a38286188cde4f
+Size (p0f-2.0.8.tgz) = 136877 bytes
+SHA1 (patch-aa) = 0e79fc52b7711a8cb31565f2da8a52761947853d
+SHA1 (patch-ad) = 378d9480c88d9a447684323c4a59f3c2f6f10d74
+SHA1 (patch-ae) = ffe38288367a63585be71ee45b4a4859f171523b
+SHA1 (patch-p0f-query.c) = 3d9c6c7f64c3af110399005bf4958dda28c2b059
diff --git a/p0f/patches/patch-aa b/p0f/patches/patch-aa
new file mode 100644
index 0000000000..62fd7c332f
--- /dev/null
+++ b/p0f/patches/patch-aa
@@ -0,0 +1,31 @@
+$NetBSD: patch-aa,v 1.10 2011/10/02 05:04:03 dholland Exp $
+
+--- mk/Linux.orig	2006-08-21 12:37:00.000000000 +0000
++++ mk/Linux
+@@ -7,23 +7,20 @@
+ # (C) Copyright 2000-2006 by Michal Zalewski <lcamtuf%coredump.cx@localhost>
+ #
+ 
+-CC      = gcc
+ LIBS	= -lpcap
+ STRIP   = strip
+-CFLAGS  = -O3 -Wall -fomit-frame-pointer -funroll-loops \
+-          -DUSE_BPF=\"${USE_BPF}\" \
+-	  -I/usr/include/pcap -I/usr/local/include/pcap -I/usr/local/include
++CFLAGS  += -DUSE_BPF=\"${USE_BPF}\"
+ FILE	= p0f
+ TOOLS   = test/sendack test/sendack2 test/sendsyn
+ 
+-all: $(FILE) strip	
++all: $(FILE) .WAIT strip
+ 	@echo ">> You can also try 'make p0fq' to compile a sample query"
+ 	@echo ">> client (see README for more information)."
+ 
+ static: $(FILE)-static
+ 
+ $(FILE): $(FILE).c
+-	$(CC) $(CFLAGS) -o $@ $(FILE).c $(FILE)-query.c crc32.c $(LIBS)
++	$(CC) $(CFLAGS) -o $@ $(FILE).c $(FILE)-query.c crc32.c $(LDFLAGS) $(LIBS)
+ 
+ $(FILE)-static: $(FILE).c 
+ 	$(CC) -static $(CFLAGS) -o $@ $(FILE).c $(FILE)-query.c crc32.c $(LIBS)
diff --git a/p0f/patches/patch-ad b/p0f/patches/patch-ad
new file mode 100644
index 0000000000..7fa0c5dcd2
--- /dev/null
+++ b/p0f/patches/patch-ad
@@ -0,0 +1,21 @@
+$NetBSD: patch-ad,v 1.5 2007/03/05 20:31:53 adrianp Exp $
+
+--- mk/SunOS.orig	2006-03-09 20:21:39.000000000 +0100
++++ mk/SunOS
+@@ -5,13 +5,9 @@
+ # (C) Copyright 2000-2006 by Michal Zalewski <lcamtuf%coredump.cx@localhost>
+ #
+ 
+-CC      = gcc
+-LIBS    = -lpcap -L/opt/local/lib \
+-          -L/usr/local/lib -lsocket -lnsl 
+-CFLAGS  = -O3 -Wall -fomit-frame-pointer -funroll-loops \
+-          -DBYTE_ORDER=1234 -DBIG_ENDIAN=1234 \
+-	  -DUSE_BPF=\"${USE_BPF}\" \
+-	  -I/opt/local/include  -I/usr/local/include
++#CC      = gcc
++LIBS    = $(LDFLAGS) -lpcap -lsocket -lnsl 
++CFLAGS  = -DBYTE_ORDER=1234 -DBIG_ENDIAN=1234 -DUSE_BPF=\"${USE_BPF}\"
+ FILE    = p0f
+ TOOLS   = test/sendack test/sendack2 test/sendsyn
+ 
diff --git a/p0f/patches/patch-ae b/p0f/patches/patch-ae
new file mode 100644
index 0000000000..47f8becf84
--- /dev/null
+++ b/p0f/patches/patch-ae
@@ -0,0 +1,22 @@
+$NetBSD: patch-ae,v 1.2 2011/12/21 15:52:17 dholland Exp $
+
+ - use preferred libpcap.
+ - don't use gmake.
+
+--- Build.orig	2006-03-16 07:44:34.000000000 +0000
++++ Build
+@@ -32,11 +32,12 @@ if [ ! -f mk/$SYSTEM ]; then
+   exit 1
+ fi
+ 
+-GMAKE_OK=`which gmake 2>/dev/null`
++GMAKE_OK=/nonexistent
+ 
++test "$LIBPCAP_PREFIX" = "" && LIBPCAP_PREFIX="/usr"
+ USE_BPF="pcap-bpf.h"
+ 
+-if [ ! -f "/usr/include/$USE_BPF" -a ! -f "/usr/local/include/$USE_BPF" ]; then
++if [ ! -f "$LIBPCAP_PREFIX/include/$USE_BPF" ]; then
+   USE_BPF="net/bpf.h"
+ fi
+ 
diff --git a/p0f/patches/patch-p0f-query.c b/p0f/patches/patch-p0f-query.c
new file mode 100644
index 0000000000..052f2a4ec1
--- /dev/null
+++ b/p0f/patches/patch-p0f-query.c
@@ -0,0 +1,14 @@
+$NetBSD: patch-p0f-query.c,v 1.1 2026/03/17 07:28:17 nia Exp $
+
+Fix implicit declaration of bzero.
+
+--- p0f-query.c.orig	2026-03-17 07:18:24.008587188 +0000
++++ p0f-query.c
+@@ -21,6 +21,7 @@
+ #include <sys/socket.h>
+ #endif
+ #include <string.h>
++#include <strings.h>
+ 
+ #include <time.h>
+ #include <sys/types.h>


Home | Main Index | Thread Index | Old Index