From f7ddf4eb5fc3667485277dbbc38e9576bd5c54ad Mon Sep 17 00:00:00 2001 From: Michal Ambroz <723625+xambroz@users.noreply.github.com> Date: Thu, 16 Feb 2023 05:56:38 +0100 Subject: [PATCH] packaging changes - version fix, make install, manpage (#28) * packaging changes - version fix, make install, manpage * preserve timestamps Sorry I forgot the option -p to preserve the timestamps --- Makefile | 16 +++++++++++++ onesixtyone.1 | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++ onesixtyone.c | 4 ++-- 3 files changed, 82 insertions(+), 2 deletions(-) create mode 100644 onesixtyone.1 diff --git a/Makefile b/Makefile index cf6c7d9..80155af 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,13 @@ +CC ?= gcc +DESTDIR ?= / +prefix ?= /usr +exec_prefix ?= $(prefix) +bindir ?= $(exec_prefix)/bin +datarootdir ?= $(prefix)/share +datadir ?= $(datarootdir) +mandir ?= $(datarootdir)/man +man1dir ?= $(mandir)/man1 + onesixtyone: onesixtyone.c $(CC) $(CFLAGS) $(LDFLAGS) $(CPPFLAGS) -o onesixtyone onesixtyone.c @@ -7,4 +17,10 @@ solaris: onesixtyone.c clean: rm -rf onesixtyone +install: + install -p -D onesixtyone $(DESTDIR)$(bindir)/onesixtyone + install -p -D -m 0644 dict.txt $(DESTDIR)$(datadir)/onesixtyone/dict.txt + install -p -m 0644 -D onesixtyone.1 $(DESTDIR)$(man1dir)/onesixtyone.1 + + .PHONY: solaris clean diff --git a/onesixtyone.1 b/onesixtyone.1 new file mode 100644 index 0000000..8483e39 --- /dev/null +++ b/onesixtyone.1 @@ -0,0 +1,64 @@ +.TH ONESIXTYONE +.SH NAME +onesixtyone \- efficient SNMP scanner +.SH SYNOPSIS +onesixtyone [options] +.SH DESCRIPTION +onesixtyone is an SNMP scanner which utilizes a sweep technique to achieve very +high performance. It can scan an entire class B network in under 13 minutes. +It can be used to discover devices responding to well-known community names +or to mount a dictionary attack against one or more SNMP devices. + +onesixtyone takes a different approach to SNMP scanning. It takes advantage +of the fact that SNMP is a connectionless protocol and sends all SNMP requests +as fast as it can. Then the scanner waits for responses to come back and logs +them, in a fashion similar to Nmap ping sweeps. By default onesixtyone waits +for 10 milliseconds between sending packets, which is adequate for 100Mbs +switched networks. The user can adjust this value via the -w command line +option. If set to 0, the scanner will send packets as fast as the kernel would +accept them, which may lead to packet drop. +.SH OPTIONS +.HP +.B \-c +file with community names to try +.TP +.B \-i +file with target hosts +.TP +.B \-o +output log +.TP +.B \-d +debug mode, use twice for more information +.TP +.B \-w n +wait n milliseconds (1/1000 of a second) between sending packets (default 10) +.TP +.B \-q +quiet mode, do not print log to stdout, use with \-l +.PP +examples: onesixtyone \-c dict.txt 192.168.4.1 public +.IP + \&onesixtyone \-c dict.txt \-i hosts \-o my.log \-w 100 +.HP +.B \-c +file with community names to try +.TP +.B \-i +file with target hosts +.TP +.B \-o +output log +.TP +.B \-d +debug mode, use twice for more information +.TP +.B \-w n +wait n milliseconds (1/1000 of a second) between sending packets (default 10) +.TP +.B \-q +quiet mode, do not print log to stdout, use with \-l +.PP +examples: onesixtyone \-c dict.txt 192.168.4.1 public +.IP +\&onesixtyone \-c dict.txt \-i hosts \-o my.log \-w 100 diff --git a/onesixtyone.c b/onesixtyone.c index fcb7e1e..f5851f0 100644 --- a/onesixtyone.c +++ b/onesixtyone.c @@ -1,4 +1,4 @@ -/* onesixtyone version 0.3.3 +/* onesixtyone version 0.3.4 Copyright (C) 2002,2003 solareclipse@phreedom.org This program is free software; you can redistribute it and/or modify @@ -83,7 +83,7 @@ struct { void usage() { int i; - printf("onesixtyone 0.3.3 [options] \n"); + printf("onesixtyone 0.3.4 [options] \n"); printf(" -c file with community names to try\n"); printf(" -i file with target hosts\n"); printf(" -o output log\n");