pkgsrc-WIP-changes archive

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

masscan: Import masscan-1.0.5 as wip/masscan



Module Name:	pkgsrc-wip
Committed By:	Leonardo Taccari <leot%NetBSD.org@localhost>
Pushed By:	leot
Date:		Sun Oct 28 12:50:24 2018 +0100
Changeset:	30981092cfe90b2a721942016c08322c97956f39

Modified Files:
	Makefile
Added Files:
	masscan/DESCR
	masscan/Makefile
	masscan/PLIST
	masscan/distinfo
	masscan/patches/patch-Makefile
	masscan/patches/patch-src_pixie-threads.c
	masscan/patches/patch-src_rawsock-getif.c
	masscan/patches/patch-src_rawsock-getroute.c

Log Message:
masscan: Import masscan-1.0.5 as wip/masscan

This is the fastest Internet port scanner. It can scan the entire
Internet in under 6 minutes, transmitting 10 million packets per
second.

It produces results similar to nmap, the most famous port scanner.
Internally, it operates more like scanrand, unicornscan, and ZMap,
using asynchronous transmission. The major difference is that it's
faster than these other scanners. In addition, it's more flexible,
allowing arbitrary address ranges and port ranges.

NOTE: masscan uses a custom TCP/IP stack. Anything other than simple
port scans will cause conflict with the local TCP/IP stack. This
means you need to either use the -S option to use a separate IP
address, or configure your operating system to firewall the ports
that masscan uses.

XXX: This is only build and install tested, unfortunately I didn't
XXX: scan the entire Internet nor a tiny part of it!

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

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

diffstat:
 Makefile                                     |  1 +
 masscan/DESCR                                | 15 +++++++++++++
 masscan/Makefile                             | 22 +++++++++++++++++++
 masscan/PLIST                                |  3 +++
 masscan/distinfo                             | 10 +++++++++
 masscan/patches/patch-Makefile               | 27 +++++++++++++++++++++++
 masscan/patches/patch-src_pixie-threads.c    | 33 ++++++++++++++++++++++++++++
 masscan/patches/patch-src_rawsock-getif.c    | 15 +++++++++++++
 masscan/patches/patch-src_rawsock-getroute.c | 15 +++++++++++++
 9 files changed, 141 insertions(+)

diffs:
diff --git a/Makefile b/Makefile
index eab520dc08..d78881d9e5 100644
--- a/Makefile
+++ b/Makefile
@@ -2057,6 +2057,7 @@ SUBDIR+=	mapnik
 SUBDIR+=	marathon-scenarios
 SUBDIR+=	marathon-tempus-irae
 SUBDIR+=	marsyas
+SUBDIR+=	masscan
 SUBDIR+=	mashpodder
 SUBDIR+=	mat
 SUBDIR+=	matanza
diff --git a/masscan/DESCR b/masscan/DESCR
new file mode 100644
index 0000000000..6031f3e48b
--- /dev/null
+++ b/masscan/DESCR
@@ -0,0 +1,15 @@
+This is the fastest Internet port scanner. It can scan the entire
+Internet in under 6 minutes, transmitting 10 million packets per
+second.
+
+It produces results similar to nmap, the most famous port scanner.
+Internally, it operates more like scanrand, unicornscan, and ZMap,
+using asynchronous transmission. The major difference is that it's
+faster than these other scanners. In addition, it's more flexible,
+allowing arbitrary address ranges and port ranges.
+
+NOTE: masscan uses a custom TCP/IP stack. Anything other than simple
+port scans will cause conflict with the local TCP/IP stack. This
+means you need to either use the -S option to use a separate IP
+address, or configure your operating system to firewall the ports
+that masscan uses.
diff --git a/masscan/Makefile b/masscan/Makefile
new file mode 100644
index 0000000000..8699b8b62b
--- /dev/null
+++ b/masscan/Makefile
@@ -0,0 +1,22 @@
+# $NetBSD$
+
+DISTNAME=	masscan-1.0.5
+CATEGORIES=	net
+MASTER_SITES=	${MASTER_SITE_GITHUB:=robertdavidgraham/}
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=	https://github.com/robertdavidgraham/masscan/
+COMMENT=	TCP port scanner, spews SYN packets asynchronously
+LICENSE=	gnu-agpl-v3
+
+USE_TOOLS+=	gmake
+
+INSTALLATION_DIRS+=	bin ${PKGMANDIR}/man8
+
+do-install:
+	${INSTALL_PROGRAM} ${WRKSRC}/bin/masscan ${DESTDIR}${PREFIX}/bin/masscan
+	${INSTALL_MAN} ${WRKSRC}/doc/masscan.8 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man8
+
+.include "../../mk/pthread.buildlink3.mk"
+.include "../../net/libpcap/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/masscan/PLIST b/masscan/PLIST
new file mode 100644
index 0000000000..0c6a688322
--- /dev/null
+++ b/masscan/PLIST
@@ -0,0 +1,3 @@
+@comment $NetBSD$
+bin/masscan
+man/man8/masscan.8
diff --git a/masscan/distinfo b/masscan/distinfo
new file mode 100644
index 0000000000..e4ff9d67d5
--- /dev/null
+++ b/masscan/distinfo
@@ -0,0 +1,10 @@
+$NetBSD$
+
+SHA1 (masscan-1.0.5.tar.gz) = fbe0a87f355688bf7b38bf3ba64f0902c6dda50b
+RMD160 (masscan-1.0.5.tar.gz) = d3b86be1ac263a592e846405ab2705bd7358b1aa
+SHA512 (masscan-1.0.5.tar.gz) = 55d58234994ebea10bcb3f45a24cdb51b020350faa116aee3a48861a119f66c339d1f533c978f52e37ccf5266be6fd2802765f13461d94eb28ec8d18c68e2f88
+Size (masscan-1.0.5.tar.gz) = 353901 bytes
+SHA1 (patch-Makefile) = 7233a8c919c85d029bc4e215f0993084fbcc78bc
+SHA1 (patch-src_pixie-threads.c) = 0790a0898605d1d7ada27c9b0370d790a7347934
+SHA1 (patch-src_rawsock-getif.c) = 19194dfc5c4689db2c05272b32af7a0f281cef7a
+SHA1 (patch-src_rawsock-getroute.c) = 85b538570f1436fdde2ef1474ffa4da77517df01
diff --git a/masscan/patches/patch-Makefile b/masscan/patches/patch-Makefile
new file mode 100644
index 0000000000..1c4755d64c
--- /dev/null
+++ b/masscan/patches/patch-Makefile
@@ -0,0 +1,27 @@
+$NetBSD$
+
+- Treats NetBSD like {Free,Open}BSD
+- Do not force optimizations in CFLAGS and honor user-defined CFLAGS
+
+--- Makefile.orig	2018-03-08 11:45:23.000000000 +0000
++++ Makefile
+@@ -65,11 +65,18 @@ INCLUDES = -I.
+ FLAGS2 =
+ endif
+ 
++# NetBSD
++ifneq (, $(findstring netbsd, $(SYS)))
++LIBS = -lm -pthread
++INCLUDES = -I.
++FLAGS2 =
++endif
++
+ # this works on llvm or real gcc
+ CC = clang
+ 
+ DEFINES = 
+-CFLAGS = -g -ggdb $(FLAGS2) $(INCLUDES) $(DEFINES) -Wall -O3
++CFLAGS += $(FLAGS2) $(INCLUDES) $(DEFINES) -Wall
+ .SUFFIXES: .c .cpp
+ 
+ all: bin/masscan 
diff --git a/masscan/patches/patch-src_pixie-threads.c b/masscan/patches/patch-src_pixie-threads.c
new file mode 100644
index 0000000000..171fbf1a95
--- /dev/null
+++ b/masscan/patches/patch-src_pixie-threads.c
@@ -0,0 +1,33 @@
+$NetBSD$
+
+Treats NetBSD like {Free,Open}BSD
+
+--- src/pixie-threads.c.orig	2017-06-06 03:59:39.000000000 +0000
++++ src/pixie-threads.c
+@@ -12,7 +12,7 @@
+ #include <errno.h>
+ #endif
+ 
+-#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__)
++#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
+ #include <sys/types.h>
+ #include <sys/sysctl.h>
+ #endif
+@@ -122,7 +122,7 @@ pixie_cpu_get_count(void)
+         return 1;
+     else
+         return count;
+-#elif defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__)
++#elif defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
+     /* BSD - use sysctl() function */
+         int x;
+         int mib[2];
+@@ -180,7 +180,7 @@ pixie_begin_thread(
+ #if defined(WIN32)
+     UNUSEDPARM(flags);
+     return _beginthread(worker_thread, 0, worker_data);
+-#elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__kFreeBSD__) || defined(__OpenBSD__)
++#elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__kFreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
+ 
+     typedef void *(*PTHREADFUNC)(void*);
+     pthread_t thread_id = 0;
diff --git a/masscan/patches/patch-src_rawsock-getif.c b/masscan/patches/patch-src_rawsock-getif.c
new file mode 100644
index 0000000000..4326218175
--- /dev/null
+++ b/masscan/patches/patch-src_rawsock-getif.c
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Treats NetBSD like {Free,Open}BSD
+
+--- src/rawsock-getif.c.orig	2017-06-06 03:59:39.000000000 +0000
++++ src/rawsock-getif.c
+@@ -9,7 +9,7 @@
+ 
+ #include "ranges.h" /*for parsing IPv4 addresses */
+ 
+-#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__)
++#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
+ #include <unistd.h>
+ #include <sys/socket.h>
+ #include <net/route.h>
diff --git a/masscan/patches/patch-src_rawsock-getroute.c b/masscan/patches/patch-src_rawsock-getroute.c
new file mode 100644
index 0000000000..cba48bb97a
--- /dev/null
+++ b/masscan/patches/patch-src_rawsock-getroute.c
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Treats NetBSD like {Free,Open}BSD
+
+--- src/rawsock-getroute.c.orig	2017-06-06 03:59:39.000000000 +0000
++++ src/rawsock-getroute.c
+@@ -10,7 +10,7 @@
+ #include "ranges.h" /*for parsing IPv4 addresses */
+ 
+ 
+-#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__)
++#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
+ #include <unistd.h>
+ #include <sys/socket.h>
+ #include <net/route.h>


Home | Main Index | Thread Index | Old Index