autosec-devel Mailing List for Automated Security Tools (Page 5)
Brought to you by:
red0x
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(30) |
Aug
(53) |
Sep
(4) |
Oct
(39) |
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
|
Feb
|
Mar
(1) |
Apr
(31) |
May
(15) |
Jun
(1) |
Jul
(1) |
Aug
(7) |
Sep
(42) |
Oct
(37) |
Nov
(39) |
Dec
(15) |
2004 |
Jan
(10) |
Feb
(17) |
Mar
(2) |
Apr
(56) |
May
(22) |
Jun
(17) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
2005 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(10) |
2007 |
Jan
(2) |
Feb
(7) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: red0x <re...@us...> - 2004-04-02 08:58:56
|
Update of /cvsroot/autosec/sonar/plugins In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31678/plugins Modified Files: rfc793.c Log Message: minor bug fix Index: rfc793.c =================================================================== RCS file: /cvsroot/autosec/sonar/plugins/rfc793.c,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** rfc793.c 31 Mar 2004 11:53:19 -0000 1.41 --- rfc793.c 2 Apr 2004 08:46:50 -0000 1.42 *************** *** 178,182 **** if((i>=6 && strncasecmp(arg, "prog=\"", (i<6)?i:6)) == 0) { ! endval=strchr(arg,'"'); //escape quotes while(endval!=NULL && *(endval-1)=='\\') --- 178,182 ---- if((i>=6 && strncasecmp(arg, "prog=\"", (i<6)?i:6)) == 0) { ! endval=strchr(arg,'\"'); //escape quotes while(endval!=NULL && *(endval-1)=='\\') |
From: <no...@so...> - 2004-03-02 02:50:26
|
The following bug has been RESOLVED. ======================================================================= http://autosec.sourceforge.net/helpDesk/mantis/view_bug_page.php?f_id=0000045 ======================================================================= Reporter: pharkas Handler: red0x ======================================================================= Project: sonar Bug ID: 0000045 Category: Bugs Reproducibility: always Severity: major Priority: high Status: resolved Resolution: fixed ======================================================================= Date Submitted: 02-28-04 04:37 PST Last Modified: 03-01-04 18:45 PST ======================================================================= Summary: sigint not handled while sleeping Description: sleep is called for a iPostDelay, but while it is sleeping the program cannot be interrupted. This sucks if you accidentally enter in a large sleep amount. ======================================================================= ----------------------------------------------------------------------- red0x - 03-01-04 18:45 PST ----------------------------------------------------------------------- usleep seems to fix it. I am using usleep for now. If that turns out to be non-portable, I will upgrade to nanosleep. |
From: <no...@so...> - 2004-03-02 02:49:55
|
The following bug has been ASSIGNED. ======================================================================= http://autosec.sourceforge.net/helpDesk/mantis/view_bug_page.php?f_id=0000045 ======================================================================= Reporter: pharkas Handler: red0x ======================================================================= Project: sonar Bug ID: 0000045 Category: Bugs Reproducibility: always Severity: major Priority: high Status: assigned ======================================================================= Date Submitted: 02-28-04 04:37 PST Last Modified: 03-01-04 18:45 PST ======================================================================= Summary: sigint not handled while sleeping Description: sleep is called for a iPostDelay, but while it is sleeping the program cannot be interrupted. This sucks if you accidentally enter in a large sleep amount. ======================================================================= |
From: <no...@so...> - 2004-02-28 12:53:35
|
The following bug has been RESOLVED. ======================================================================= http://autosec.sourceforge.net/helpDesk/mantis/view_bug_page.php?f_id=44 ======================================================================= Reporter: red0x Handler: pharkas ======================================================================= Project: sonar Bug ID: 0000044 Category: Other Reproducibility: N/A Severity: tweak Priority: normal Status: resolved Resolution: fixed ======================================================================= Date Submitted: 02-05-04 19:36 PST Last Modified: 02-28-04 04:50 PST ======================================================================= Summary: Duplicate options structures are clutter Description: The two structures, sonarContext and pluginContext are clutter. I would like to get rid of them, and make one options structure, that holds the values for all the global options (ie, options in the main sonar engine usage). ======================================================================= ----------------------------------------------------------------------- pharkas - 02-28-04 04:50 PST ----------------------------------------------------------------------- Fixed, but minimally tested |
From: <no...@so...> - 2004-02-28 12:47:36
|
A BUGNOTE has been added to this bug. ======================================================================= http://autosec.sourceforge.net/helpDesk/mantis/view_bug_page.php?f_id=0000043 ======================================================================= Reporter: red0x Handler: red0x ======================================================================= Project: sonar Bug ID: 0000043 Category: Bugs Reproducibility: always Severity: feature Priority: normal Status: assigned ======================================================================= Date Submitted: 12-05-03 14:26 PST Last Modified: 02-28-04 04:44 PST ======================================================================= Summary: Parallel scanning broken Description: Scanning with two different types in parallel is broken. ======================================================================= ----------------------------------------------------------------------- red0x - 02-02-04 18:04 PST ----------------------------------------------------------------------- CVS code seems to address this pretty well, however, the ACK scan (rfc793.c) still breaks the parallelism of our scanning. ----------------------------------------------------------------------- red0x - 02-28-04 04:44 PST ----------------------------------------------------------------------- I'm going to wait until the options structure is updated to address this issue. I am leaving the bug assigned to me, but open. |
From: <no...@so...> - 2004-02-28 12:42:24
|
The following bug has been ASSIGNED. ======================================================================= http://autosec.sourceforge.net/helpDesk/mantis/view_bug_page.php?f_id=44 ======================================================================= Reporter: red0x Handler: pharkas ======================================================================= Project: sonar Bug ID: 0000044 Category: Other Reproducibility: N/A Severity: tweak Priority: normal Status: assigned ======================================================================= Date Submitted: 02-05-04 19:36 PST Last Modified: 02-28-04 04:39 PST ======================================================================= Summary: Duplicate options structures are clutter Description: The two structures, sonarContext and pluginContext are clutter. I would like to get rid of them, and make one options structure, that holds the values for all the global options (ie, options in the main sonar engine usage). ======================================================================= |
From: <no...@so...> - 2004-02-28 12:41:04
|
The following NEW bug has been ADDED. ======================================================================= http://autosec.sourceforge.net/helpDesk/mantis/view_bug_page.php?f_id=45 ======================================================================= Reporter: pharkas Handler: ======================================================================= Project: sonar Bug ID: 0000045 Category: Bugs Reproducibility: always Severity: major Priority: high Status: new ======================================================================= Date Submitted: 02-28-04 04:37 PST Last Modified: 02-28-04 04:37 PST ======================================================================= Summary: sigint not handled while sleeping Description: sleep is called for a iPostDelay, but while it is sleeping the program cannot be interrupted. This sucks if you accidentally enter in a large sleep amount. ======================================================================= |
From: <no...@so...> - 2004-02-28 12:29:15
|
The following bug has been CLOSED ======================================================================= http://autosec.sourceforge.net/helpDesk/mantis/view_bug_page.php?f_id=0000040 ======================================================================= Reporter: Anonymous Handler: red0x ======================================================================= Project: sonar Bug ID: 0000040 Category: Compile Problems Reproducibility: always Severity: major Priority: normal Status: closed ======================================================================= Date Submitted: 09-25-03 02:29 PDT Last Modified: 02-28-04 04:26 PST ======================================================================= Summary: If doxygen is not installed 'make' falls !!! Description: I wrote it on http://sourceforge.net/tracker/index.php?func=detail&aid=812327&group_id=51027&atid=461807 ======================================================================= ----------------------------------------------------------------------- red0x - 09-25-03 09:46 PDT ----------------------------------------------------------------------- Bug fixed in CVS, A patch will be made available here. ----------------------------------------------------------------------- red0x - 09-25-03 09:50 PDT ----------------------------------------------------------------------- To attach a patch. ----------------------------------------------------------------------- red0x - 09-25-03 09:52 PDT ----------------------------------------------------------------------- Patch uploaded. ----------------------------------------------------------------------- red0x - 02-28-04 04:26 PST ----------------------------------------------------------------------- Fixed in older version |
From: <no...@so...> - 2004-02-28 12:29:07
|
The following bug has been CLOSED ======================================================================= http://autosec.sourceforge.net/helpDesk/mantis/view_bug_page.php?f_id=0000039 ======================================================================= Reporter: Anonymous Handler: red0x ======================================================================= Project: sonar Bug ID: 0000039 Category: Bugs Reproducibility: always Severity: feature Priority: normal Status: closed ======================================================================= Date Submitted: 07-26-03 19:26 PDT Last Modified: 02-28-04 04:26 PST ======================================================================= Summary: Plugin error when specifying a particular port (-pp port)! Description: An error occurs when specifying a particular port for a host. The error reads: " send_ipv4 failed: Invalid argument [date]: Sweep ended with a plugin error" reported by: code_monkeyboy ======================================================================= ----------------------------------------------------------------------- red0x - 09-27-03 17:43 PDT ----------------------------------------------------------------------- Ports are no longer specified like this. ----------------------------------------------------------------------- red0x - 02-28-04 04:26 PST ----------------------------------------------------------------------- Fixed in older version |
From: <no...@so...> - 2004-02-28 12:28:57
|
The following bug has been CLOSED ======================================================================= http://autosec.sourceforge.net/helpDesk/mantis/view_bug_page.php?f_id=0000036 ======================================================================= Reporter: code_monkeyboy Handler: red0x ======================================================================= Project: sonar Bug ID: 0000036 Category: Other Reproducibility: always Severity: tweak Priority: normal Status: closed ======================================================================= Date Submitted: 04-28-03 20:59 PDT Last Modified: 02-28-04 04:25 PST ======================================================================= Summary: Tweak the ACK Scan Plugin's output Description: The output of the ACK Scan Plugin states if the host is online or offline and if the specified port is filtered or unfiltered, so when the specified port is closed the output just states if the host is online/offline and states that the port is unfiltered. Bascially, the output needs to state the status of the port correctly. For example, if the port is closed the status of the port should state that the port is closed not unfiltered. ======================================================================= ----------------------------------------------------------------------- red0x - 09-27-03 17:54 PDT ----------------------------------------------------------------------- ACK scans dont tell you if a port is open or closed. They just tell you if they are filtered or not. ----------------------------------------------------------------------- red0x - 02-28-04 04:25 PST ----------------------------------------------------------------------- Fixed in older version |
From: <no...@so...> - 2004-02-28 12:28:37
|
The following bug has been CLOSED ======================================================================= http://autosec.sourceforge.net/helpDesk/mantis/view_bug_page.php?f_id=0000033 ======================================================================= Reporter: red0x Handler: red0x ======================================================================= Project: sonar Bug ID: 0000033 Category: Feature Requests Reproducibility: N/A Severity: feature Priority: normal Status: closed ======================================================================= Date Submitted: 04-21-03 21:21 PDT Last Modified: 02-28-04 04:25 PST ======================================================================= Summary: Not all hostmasks supported Description: Only 5 hostmasks are supported. /0 /8 /16 /24 and /32. We need to make it accept any hostmask in between. ======================================================================= ----------------------------------------------------------------------- red0x - 09-28-03 03:17 PDT ----------------------------------------------------------------------- Fixed! ----------------------------------------------------------------------- red0x - 02-28-04 04:25 PST ----------------------------------------------------------------------- Fixed in older version |
From: <no...@so...> - 2004-02-28 12:28:32
|
The following bug has been CLOSED ======================================================================= http://autosec.sourceforge.net/helpDesk/mantis/view_bug_page.php?f_id=0000035 ======================================================================= Reporter: red0x Handler: red0x ======================================================================= Project: sonar Bug ID: 0000035 Category: Feature Requests Reproducibility: N/A Severity: feature Priority: normal Status: closed ======================================================================= Date Submitted: 04-28-03 17:24 PDT Last Modified: 02-28-04 04:25 PST ======================================================================= Summary: sonar does not support input plugins. Description: We need support for using input plugins. ======================================================================= ----------------------------------------------------------------------- red0x - 09-28-03 03:02 PDT ----------------------------------------------------------------------- Input plugins are supported ----------------------------------------------------------------------- red0x - 02-28-04 04:25 PST ----------------------------------------------------------------------- Fixed in older version |
From: <no...@so...> - 2004-02-06 03:37:09
|
The following bug has been ASSIGNED. ======================================================================= http://autosec.sourceforge.net/helpDesk/mantis/view_bug_page.php?f_id=0000043 ======================================================================= Reporter: red0x Handler: red0x ======================================================================= Project: sonar Bug ID: 0000043 Category: Bugs Reproducibility: always Severity: feature Priority: normal Status: assigned ======================================================================= Date Submitted: 12-05-03 14:26 PST Last Modified: 02-05-04 19:37 PST ======================================================================= Summary: Parallel scanning broken Description: Scanning with two different types in parallel is broken. ======================================================================= ----------------------------------------------------------------------- red0x - 02-02-04 18:04 PST ----------------------------------------------------------------------- CVS code seems to address this pretty well, however, the ACK scan (rfc793.c) still breaks the parallelism of our scanning. |
From: <no...@so...> - 2004-02-06 03:36:54
|
The following NEW bug has been ADDED. ======================================================================= http://autosec.sourceforge.net/helpDesk/mantis/view_bug_page.php?f_id=44 ======================================================================= Reporter: red0x Handler: ======================================================================= Project: sonar Bug ID: 0000044 Category: Other Reproducibility: N/A Severity: tweak Priority: normal Status: new ======================================================================= Date Submitted: 02-05-04 19:36 PST Last Modified: 02-05-04 19:36 PST ======================================================================= Summary: Duplicate options structures are clutter Description: The two structures, sonarContext and pluginContext are clutter. I would like to get rid of them, and make one options structure, that holds the values for all the global options (ie, options in the main sonar engine usage). ======================================================================= |
From: <re...@us...> - 2004-02-04 04:35:30
|
Update of /cvsroot/autosec/sonar/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18406/src Modified Files: sonar.c Log Message: Verbosity sanity check missing, constrained value to <5, >0 Index: sonar.c =================================================================== RCS file: /cvsroot/autosec/sonar/src/sonar.c,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** sonar.c 3 Feb 2004 01:49:57 -0000 1.29 --- sonar.c 4 Feb 2004 04:33:11 -0000 1.30 *************** *** 300,304 **** if(errno==LONG_MAX) verbosity=MAX_VERBOSE; ! mthis.sCon.iVerbose=verbosity; } else { mthis.sCon.iVerbose=1; --- 300,307 ---- if(errno==LONG_MAX) verbosity=MAX_VERBOSE; ! /* red0x: added sanity check */ ! verbosity = sanity_check(verbosity, 5, MORE); ! mthis.sCon.iVerbose = ! sanity_check(verbosity, 0, LESS); } else { mthis.sCon.iVerbose=1; |
From: <no...@so...> - 2004-02-03 02:04:03
|
A BUGNOTE has been added to this bug. ======================================================================= http://autosec.sourceforge.net/helpDesk/mantis/view_bug_page.php?f_id=0000043 ======================================================================= Reporter: red0x Handler: ======================================================================= Project: sonar Bug ID: 0000043 Category: Bugs Reproducibility: always Severity: feature Priority: normal Status: new ======================================================================= Date Submitted: 12-05-03 14:26 PST Last Modified: 02-02-04 18:04 PST ======================================================================= Summary: Parallel scanning broken Description: Scanning with two different types in parallel is broken. ======================================================================= ----------------------------------------------------------------------- red0x - 02-02-04 18:04 PST ----------------------------------------------------------------------- CVS code seems to address this pretty well, however, the ACK scan (rfc793.c) still breaks the parallelism of our scanning. |
From: <ph...@us...> - 2004-02-03 01:58:39
|
Update of /cvsroot/autosec/sonar/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28692 Modified Files: sonar.1.in Log Message: Updated to reflect verbosity changes Index: sonar.1.in =================================================================== RCS file: /cvsroot/autosec/sonar/doc/sonar.1.in,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** sonar.1.in 10 Nov 2003 10:36:38 -0000 1.1 --- sonar.1.in 3 Feb 2004 01:56:31 -0000 1.2 *************** *** 64,70 **** Fork into background (daemon mode). All output is dumped to syslog. .TP ! .B \-v ! Increase Verbosity. Maximum is 5, default is 0. Try \-vvvvv for all the ! output you could ever handle. .TP .B \-c, \--scan_count=count --- 64,69 ---- Fork into background (daemon mode). All output is dumped to syslog. .TP ! .B \-v[0-5] ! Set verbosity to the given level. If no level is given the level is set to 1. .TP .B \-c, \--scan_count=count |
From: <ph...@us...> - 2004-02-03 01:52:42
|
Update of /cvsroot/autosec/sonar/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23558 Modified Files: popts.c Log Message: Added a newline to the error message Index: popts.c =================================================================== RCS file: /cvsroot/autosec/sonar/src/popts.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** popts.c 29 Jan 2004 23:43:52 -0000 1.5 --- popts.c 3 Feb 2004 01:50:33 -0000 1.6 *************** *** 54,58 **** fprintf(stderr, "\t[-?|--help] [--usage]\n"); if(error) ! fprintf(stderr, "%s: %s", error, addl); exit(exitcode); } --- 54,58 ---- fprintf(stderr, "\t[-?|--help] [--usage]\n"); if(error) ! fprintf(stderr, "%s: %s\n", error, addl); exit(exitcode); } |
From: <ph...@us...> - 2004-02-03 01:52:05
|
Update of /cvsroot/autosec/sonar/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22416 Modified Files: sonar.c sonar.h Log Message: Added numeric arguments to the verbosity flag Index: sonar.c =================================================================== RCS file: /cvsroot/autosec/sonar/src/sonar.c,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** sonar.c 29 Jan 2004 23:43:52 -0000 1.28 --- sonar.c 3 Feb 2004 01:49:57 -0000 1.29 *************** *** 24,28 **** --- 24,31 ---- #include <assert.h> + #include <getopt.h> #include <stdarg.h> + #include <errno.h> + #include "types.h" #include "sonar.h" *************** *** 39,46 **** #endif - #ifdef HAVE_GETOPT_H - # include <getopt.h> - #endif - static const char rcsid[] = "\100$ autosec/sonar: $Id$"; --- 42,45 ---- *************** *** 122,125 **** --- 121,125 ---- int cur = 0, opt = 0, ret, opt_ind = 1; int plugin_selected = 0, i; + int verbosity=0; target_t *first_target; struct timeval ts, te; *************** *** 165,169 **** } ! while((opt = getopt_long(argc, argv, "vqrfd:c:s:i:o:p:w:t:h:be:?", optionsTable, &opt_ind)) >= 0) { // core options, handled first --- 165,170 ---- } ! while((opt = getopt_long(argc, argv, "v::qrfd:c:s:i:o:p:w:t:h:be:?", ! optionsTable, &opt_ind)) >= 0) { // core options, handled first *************** *** 291,296 **** break; case 'v': ! if(mthis.sCon.iVerbose == 0) ! mthis.sCon.iVerbose++; log_write(LOG_DBUG, "verbosity = %d;\n", mthis.sCon.iVerbose); --- 292,307 ---- break; case 'v': ! if(optarg!=NULL) { ! verbosity=atoi(optarg); ! if(errno==EINVAL) ! verbosity=0; ! if(errno==LONG_MIN) ! verbosity=-1; ! if(errno==LONG_MAX) ! verbosity=MAX_VERBOSE; ! mthis.sCon.iVerbose=verbosity; ! } else { ! mthis.sCon.iVerbose=1; ! } log_write(LOG_DBUG, "verbosity = %d;\n", mthis.sCon.iVerbose); Index: sonar.h =================================================================== RCS file: /cvsroot/autosec/sonar/src/sonar.h,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** sonar.h 29 Jan 2004 23:43:52 -0000 1.28 --- sonar.h 3 Feb 2004 01:49:57 -0000 1.29 *************** *** 24,27 **** --- 24,29 ---- /// Ok #define SONAR_OK 1 + // Trying to avoid magic numbers + #define MAX_VERBOSE 5 /* #define DEFAULT_OPTIONS {"fork", 'f', POPT_ARG_NONE, 0, 'd', \ |
From: <re...@pr...> - 2004-02-02 09:35:28
|
Update of /cvsroot/autosec/sonar In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8487 Modified Files: Makefile.am Makefile.in Log Message: Makefile fix: called make instead of $(MAKE) Index: Makefile.am =================================================================== RCS file: /cvsroot/autosec/sonar/Makefile.am,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Makefile.am 4 Nov 2003 23:50:05 -0000 1.14 --- Makefile.am 2 Feb 2004 09:33:27 -0000 1.15 *************** *** 41,45 **** debug: ! cd libltdl && make && cd .. @list='$(SUBDIRS)'; for subdir in $$list; do \ if [ "$$subdir" != "libltdl" ]; then \ --- 41,45 ---- debug: ! cd libltdl && $(MAKE) && cd .. @list='$(SUBDIRS)'; for subdir in $$list; do \ if [ "$$subdir" != "libltdl" ]; then \ Index: Makefile.in =================================================================== RCS file: /cvsroot/autosec/sonar/Makefile.in,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** Makefile.in 4 Nov 2003 23:50:05 -0000 1.29 --- Makefile.in 2 Feb 2004 09:33:27 -0000 1.30 *************** *** 512,516 **** debug: ! cd libltdl && make && cd .. @list='$(SUBDIRS)'; for subdir in $$list; do \ if [ "$$subdir" != "libltdl" ]; then \ --- 512,516 ---- debug: ! cd libltdl && $(MAKE) && cd .. @list='$(SUBDIRS)'; for subdir in $$list; do \ if [ "$$subdir" != "libltdl" ]; then \ |
From: <re...@pr...> - 2004-01-31 04:43:31
|
Update of /cvsroot/autosec/sonar In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22861 Modified Files: configure config.h.in configure.in Log Message: removed libpopt and ltdlopen from configure. We may need to leave lt_dlopen in configure somehow... its distributed in the soruce tree, but not everyone has it. Index: configure =================================================================== RCS file: /cvsroot/autosec/sonar/configure,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** configure 29 Jan 2004 23:43:52 -0000 1.33 --- configure 31 Jan 2004 04:41:51 -0000 1.34 *************** *** 8308,8486 **** # Checks for libraries. ! ! for ac_func in lt_dlopen ! do ! as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` ! echo "$as_me:$LINENO: checking for $ac_func" >&5 ! echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 ! if eval "test \"\${$as_ac_var+set}\" = set"; then ! echo $ECHO_N "(cached) $ECHO_C" >&6 ! else ! cat >conftest.$ac_ext <<_ACEOF ! /* confdefs.h. */ ! _ACEOF ! cat confdefs.h >>conftest.$ac_ext ! cat >>conftest.$ac_ext <<_ACEOF ! /* end confdefs.h. */ ! /* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. ! For example, HP-UX 11i <limits.h> declares gettimeofday. */ ! #define $ac_func innocuous_$ac_func ! ! /* System header to define __stub macros and hopefully few prototypes, ! which can conflict with char $ac_func (); below. ! Prefer <limits.h> to <assert.h> if __STDC__ is defined, since ! <limits.h> exists even on freestanding compilers. */ ! ! #ifdef __STDC__ ! # include <limits.h> ! #else ! # include <assert.h> ! #endif ! ! #undef $ac_func ! ! /* Override any gcc2 internal prototype to avoid an error. */ ! #ifdef __cplusplus ! extern "C" ! { ! #endif ! /* We use char because int might match the return type of a gcc2 ! builtin and then its argument prototype would still apply. */ ! char $ac_func (); ! /* The GNU C library defines this for functions which it implements ! to always fail with ENOSYS. Some functions are actually named ! something starting with __ and the normal name is an alias. */ ! #if defined (__stub_$ac_func) || defined (__stub___$ac_func) ! choke me ! #else ! char (*f) () = $ac_func; ! #endif ! #ifdef __cplusplus ! } ! #endif ! ! int ! main () ! { ! return f != $ac_func; ! ; ! return 0; ! } ! _ACEOF ! rm -f conftest.$ac_objext conftest$ac_exeext ! if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ! (eval $ac_link) 2>conftest.er1 ! ac_status=$? ! grep -v '^ *+' conftest.er1 >conftest.err ! rm -f conftest.er1 ! cat conftest.err >&5 ! echo "$as_me:$LINENO: \$? = $ac_status" >&5 ! (exit $ac_status); } && ! { ac_try='test -z "$ac_c_werror_flag" ! || test ! -s conftest.err' ! { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ! (eval $ac_try) 2>&5 ! ac_status=$? ! echo "$as_me:$LINENO: \$? = $ac_status" >&5 ! (exit $ac_status); }; } && ! { ac_try='test -s conftest$ac_exeext' ! { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ! (eval $ac_try) 2>&5 ! ac_status=$? ! echo "$as_me:$LINENO: \$? = $ac_status" >&5 ! (exit $ac_status); }; }; then ! eval "$as_ac_var=yes" ! else ! echo "$as_me: failed program was:" >&5 ! sed 's/^/| /' conftest.$ac_ext >&5 ! ! eval "$as_ac_var=no" ! fi ! rm -f conftest.err conftest.$ac_objext \ ! conftest$ac_exeext conftest.$ac_ext ! fi ! echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 ! echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 ! if test `eval echo '${'$as_ac_var'}'` = yes; then ! cat >>confdefs.h <<_ACEOF ! #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 ! _ACEOF ! ! else ! echo "$as_me:$LINENO: checking for lt_dlopen in -lltdl" >&5 ! echo $ECHO_N "checking for lt_dlopen in -lltdl... $ECHO_C" >&6 ! if test "${ac_cv_lib_ltdl_lt_dlopen+set}" = set; then ! echo $ECHO_N "(cached) $ECHO_C" >&6 ! else ! ac_check_lib_save_LIBS=$LIBS ! LIBS="-lltdl $LIBS" ! cat >conftest.$ac_ext <<_ACEOF ! /* confdefs.h. */ ! _ACEOF ! cat confdefs.h >>conftest.$ac_ext ! cat >>conftest.$ac_ext <<_ACEOF ! /* end confdefs.h. */ ! ! /* Override any gcc2 internal prototype to avoid an error. */ ! #ifdef __cplusplus ! extern "C" ! #endif ! /* We use char because int might match the return type of a gcc2 ! builtin and then its argument prototype would still apply. */ ! char lt_dlopen (); ! int ! main () ! { ! lt_dlopen (); ! ; ! return 0; ! } ! _ACEOF ! rm -f conftest.$ac_objext conftest$ac_exeext ! if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ! (eval $ac_link) 2>conftest.er1 ! ac_status=$? ! grep -v '^ *+' conftest.er1 >conftest.err ! rm -f conftest.er1 ! cat conftest.err >&5 ! echo "$as_me:$LINENO: \$? = $ac_status" >&5 ! (exit $ac_status); } && ! { ac_try='test -z "$ac_c_werror_flag" ! || test ! -s conftest.err' ! { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ! (eval $ac_try) 2>&5 ! ac_status=$? ! echo "$as_me:$LINENO: \$? = $ac_status" >&5 ! (exit $ac_status); }; } && ! { ac_try='test -s conftest$ac_exeext' ! { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ! (eval $ac_try) 2>&5 ! ac_status=$? ! echo "$as_me:$LINENO: \$? = $ac_status" >&5 ! (exit $ac_status); }; }; then ! ac_cv_lib_ltdl_lt_dlopen=yes ! else ! echo "$as_me: failed program was:" >&5 ! sed 's/^/| /' conftest.$ac_ext >&5 ! ! ac_cv_lib_ltdl_lt_dlopen=no ! fi ! rm -f conftest.err conftest.$ac_objext \ ! conftest$ac_exeext conftest.$ac_ext ! LIBS=$ac_check_lib_save_LIBS ! fi ! echo "$as_me:$LINENO: result: $ac_cv_lib_ltdl_lt_dlopen" >&5 ! echo "${ECHO_T}$ac_cv_lib_ltdl_lt_dlopen" >&6 ! if test $ac_cv_lib_ltdl_lt_dlopen = yes; then ! DYNAMIC_LD_LIBS="-lltdl" ! else ! { { echo "$as_me:$LINENO: error: lt_dlopen not found: You should have libtool dlopen installed." >&5 ! echo "$as_me: error: lt_dlopen not found: You should have libtool dlopen installed." >&2;} ! { (exit 1); exit 1; }; } ! fi ! ! fi ! done ! --- 8308,8315 ---- # Checks for libraries. ! #AC_CHECK_FUNCS(lt_dlopen,, ! # [AC_CHECK_LIB(ltdl,lt_dlopen, ! # DYNAMIC_LD_LIBS="-lltdl", ! # AC_MSG_ERROR(lt_dlopen not found: You should have libtool dlopen installed.))]) *************** *** 8561,8643 **** - - echo "$as_me:$LINENO: checking for poptGetContext in -lpopt" >&5 - echo $ECHO_N "checking for poptGetContext in -lpopt... $ECHO_C" >&6 - if test "${ac_cv_lib_popt_poptGetContext+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - ac_check_lib_save_LIBS=$LIBS - LIBS="-lpopt $LIBS" - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - - /* Override any gcc2 internal prototype to avoid an error. */ - #ifdef __cplusplus - extern "C" - #endif - /* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ - char poptGetContext (); - int - main () - { - poptGetContext (); - ; - return 0; - } - _ACEOF - rm -f conftest.$ac_objext conftest$ac_exeext - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_popt_poptGetContext=yes - else - echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_popt_poptGetContext=no - fi - rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_lib_save_LIBS - fi - echo "$as_me:$LINENO: result: $ac_cv_lib_popt_poptGetContext" >&5 - echo "${ECHO_T}$ac_cv_lib_popt_poptGetContext" >&6 - if test $ac_cv_lib_popt_poptGetContext = yes; then - cat >>confdefs.h <<_ACEOF - #define HAVE_LIBPOPT 1 - _ACEOF - - LIBS="-lpopt $LIBS" - - else - echo "You need libpopt for parsing options. libpopt is available at http://freshmeat.net/projects/popt/"; exit - fi - - - - # Checks for header files. --- 8390,8393 ---- Index: config.h.in =================================================================== RCS file: /cvsroot/autosec/sonar/config.h.in,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** config.h.in 29 Jan 2004 23:43:52 -0000 1.21 --- config.h.in 31 Jan 2004 04:41:52 -0000 1.22 *************** *** 47,59 **** #undef HAVE_INTTYPES_H - /* Define to 1 if you have the `popt' library (-lpopt). */ - #undef HAVE_LIBPOPT - /* Define to 1 if you have the `pthread' library (-lpthread). */ #undef HAVE_LIBPTHREAD - /* Define to 1 if you have the `lt_dlopen' function. */ - #undef HAVE_LT_DLOPEN - /* Define to 1 if your system has a GNU libc compatible `malloc' function, and to 0 otherwise. */ --- 47,53 ---- Index: configure.in =================================================================== RCS file: /cvsroot/autosec/sonar/configure.in,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** configure.in 29 Jan 2004 23:43:52 -0000 1.30 --- configure.in 31 Jan 2004 04:41:52 -0000 1.31 *************** *** 40,54 **** # Checks for libraries. ! AC_CHECK_FUNCS(lt_dlopen,, ! [AC_CHECK_LIB(ltdl,lt_dlopen, ! DYNAMIC_LD_LIBS="-lltdl", ! AC_MSG_ERROR(lt_dlopen not found: You should have libtool dlopen installed.))]) AC_CHECK_LIB([pthread], [pthread_create], , [echo "You need pthreads or GNU Pth installed to use this program. Get GNU Pth at http://www.gnu.org/software/pth"; exit]) - AC_CHECK_LIB([popt], [poptGetContext], ,[echo "You need libpopt for parsing options. libpopt is available at http://freshmeat.net/projects/popt/"; exit ]) - - - # Checks for header files. AC_HEADER_DIRENT --- 40,50 ---- # Checks for libraries. ! #AC_CHECK_FUNCS(lt_dlopen,, ! # [AC_CHECK_LIB(ltdl,lt_dlopen, ! # DYNAMIC_LD_LIBS="-lltdl", ! # AC_MSG_ERROR(lt_dlopen not found: You should have libtool dlopen installed.))]) AC_CHECK_LIB([pthread], [pthread_create], , [echo "You need pthreads or GNU Pth installed to use this program. Get GNU Pth at http://www.gnu.org/software/pth"; exit]) # Checks for header files. AC_HEADER_DIRENT |
From: <re...@pr...> - 2004-01-31 00:12:04
|
Update of /cvsroot/autosec/sonar/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8422/src Modified Files: log.c plugin.h popts.c popts.h sonar.c sonar.h util.c util.h Log Message: removed libpopt dependency Index: log.c =================================================================== RCS file: /cvsroot/autosec/sonar/src/log.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** log.c 5 Dec 2003 22:44:38 -0000 1.5 --- log.c 29 Jan 2004 23:43:52 -0000 1.6 *************** *** 37,49 **** va_start(ap, msg); ! if(flags & LOG_DBUG) { - #ifdef DEBUG fprintf(stderr, "DEBUG: "); vfprintf(stderr, msg, ap); return; - #endif } if(flags & LOG_CONSOLE) { --- 37,49 ---- va_start(ap, msg); ! ! #ifdef DEBUG if(flags & LOG_DBUG) { fprintf(stderr, "DEBUG: "); vfprintf(stderr, msg, ap); return; } + #endif if(flags & LOG_CONSOLE) { *************** *** 51,55 **** if(!mthis.sCon.bFork && mthis.sCon.iVerbose >= 0) { ! /*fprintf(stderr, " "); */ vfprintf(stderr, msg, ap); } --- 51,57 ---- if(!mthis.sCon.bFork && mthis.sCon.iVerbose >= 0) { ! #ifdef DEBUG ! fprintf(stderr, "CONSOLE: "); ! #endif vfprintf(stderr, msg, ap); } Index: plugin.h =================================================================== RCS file: /cvsroot/autosec/sonar/src/plugin.h,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** plugin.h 17 Jan 2004 03:12:31 -0000 1.33 --- plugin.h 29 Jan 2004 23:43:52 -0000 1.34 *************** *** 342,346 **** /*! \page pluginapi Plugin API Manual ! \section v5 Version 5 This page will explain the use and programming of sonar plugins. Sonar has been trimmed down, diverting most --- 342,346 ---- /*! \page pluginapi Plugin API Manual ! \section v6 Version 6 This page will explain the use and programming of sonar plugins. Sonar has been trimmed down, diverting most *************** *** 349,354 **** for input, output, and network plugins. That means you can create your own plugins to drive different kinds of scans using ! different types of plugins. Version 5 of the API is used in sonar ! 1.2.0 and above. \n\n \subsection contents Contents --- 349,354 ---- for input, output, and network plugins. That means you can create your own plugins to drive different kinds of scans using ! different types of plugins. Version 6 of the API is used in sonar ! 1.2.2 and above. \n\n \subsection contents Contents Index: popts.c =================================================================== RCS file: /cvsroot/autosec/sonar/src/popts.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** popts.c 28 Apr 2003 23:07:29 -0000 1.4 --- popts.c 29 Jan 2004 23:43:52 -0000 1.5 *************** *** 34,38 **** "\100$ autosec/sonar: $Id$"; ! void sonar_popt_usage(poptContext optCon, int exitcode, char *error, char *addl) { --- 34,38 ---- "\100$ autosec/sonar: $Id$"; ! void sonar_opt_usage(int exitcode, char *error, char *addl) { *************** *** 47,57 **** #endif fprintf(stderr, "FREE for NON-COMMERCIAL USE\n"); ! poptPrintUsage(optCon, stderr, 0); if(error) ! fprintf(stderr, "%s: %s\n", error, addl); exit(exitcode); } ! void sonar_popt_help(poptContext optCon, int exitcode) { #ifndef DEBUG --- 47,62 ---- #endif fprintf(stderr, "FREE for NON-COMMERCIAL USE\n"); ! fprintf(stderr, "Usage: %s [options] <scan-type> <target(s)>\n", PACKAGE_NAME); ! fprintf(stderr, " options: [-f|--fork] [-v|--verbose] [-q|--quiet] [-r|--randomize]\n"); ! fprintf(stderr, "\t[--scan_delay=seconds] [-c|--count cycles] [-s|--scan_type plugin]\n"); ! fprintf(stderr, "\t[-i|--input plugin] [-o|--output plugin] [-p|--plugin_opt option_string]\n"); ! fprintf(stderr, "\t[--post_delay=mseconds] [--timeout=mseconds] [-e|--exe program_string]\n"); ! fprintf(stderr, "\t[-?|--help] [--usage]\n"); if(error) ! fprintf(stderr, "%s: %s", error, addl); exit(exitcode); } ! void sonar_opt_help(int exitcode) { #ifndef DEBUG *************** *** 65,69 **** #endif fprintf(stderr, "FREE for NON-COMMERCIAL USE\n"); ! poptPrintHelp(optCon, stderr, 0); exit(exitcode); } --- 70,90 ---- #endif fprintf(stderr, "FREE for NON-COMMERCIAL USE\n"); ! fprintf(stderr, "Usage: sonar [options] <scan-type> <target(s)>\n"); ! fprintf(stderr, " -f, --fork fork into background (daemon mode)\n"); ! fprintf(stderr, " -v, --verbose increase verbosity\n"); ! fprintf(stderr, " -q, --quiet no output, just return\n"); ! fprintf(stderr, " -r, --randomize randomize target order\n"); ! fprintf(stderr, " --scan_delay=seconds delay between scans (default: 0)\n"); ! fprintf(stderr, " -c, --count=cycles number of times to scan (default: 1)\n"); ! fprintf(stderr, " -s, --scan_type=plugin scan plugin to use\n"); ! fprintf(stderr, " -i, --input=plugin input plugin to use\n"); ! fprintf(stderr, " -o, --output=plugin output plugin to use\n"); ! fprintf(stderr, " -p, --plugin_opt=option plugin option\n"); ! fprintf(stderr, " --post_delay=mseconds delay after each scan type (default: 0)\n"); ! fprintf(stderr, " --timeout=mseconds timeout for probes (per host) (default: 5000)\n"); ! fprintf(stderr, " --delay=mseconds time to wait inbetween hosts (default: 0)\n"); ! fprintf(stderr, " -e, --execute=program program to execute if host is online\n"); ! fprintf(stderr, " -?, --help this cruft.\n"); ! fprintf(stderr, " --usage simple usage\n"); exit(exitcode); } Index: popts.h =================================================================== RCS file: /cvsroot/autosec/sonar/src/popts.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** popts.h 28 Apr 2003 23:07:39 -0000 1.2 --- popts.h 29 Jan 2004 23:43:52 -0000 1.3 *************** *** 25,35 **** #ifdef HAVE_CONFIG_H ! #include <config.h> #endif ! #ifdef HAVE_POPT_H ! #include <popt.h> #else ! #error Must have popt.h. Please install libpopt #endif --- 25,35 ---- #ifdef HAVE_CONFIG_H ! # include <config.h> #endif ! #ifdef HAVE_GETOPT_H ! # include <getopt.h> #else ! # error Must have getopt.h. #endif *************** *** 38,48 **** #define OUTPUT_SELECT 4 #define PLUGIN_OPTION 5 - #define HELP 6 - #define USAGE 7 - #define OUTFILE 8 ! void sonar_popt_usage(poptContext optCon, int exitcode, char *error, char *addl); ! void sonar_popt_help(poptContext optCon, int exitcode); --- 38,45 ---- #define OUTPUT_SELECT 4 #define PLUGIN_OPTION 5 ! void sonar_opt_usage(int exitcode, char *error, char *addl); ! void sonar_opt_help(int exitcode); Index: sonar.c =================================================================== RCS file: /cvsroot/autosec/sonar/src/sonar.c,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** sonar.c 17 Jan 2004 03:12:32 -0000 1.27 --- sonar.c 29 Jan 2004 23:43:52 -0000 1.28 *************** *** 36,40 **** #ifdef HAVE_SYSLOG_H ! #include <syslog.h> #endif --- 36,44 ---- #ifdef HAVE_SYSLOG_H ! # include <syslog.h> ! #endif ! ! #ifdef HAVE_GETOPT_H ! # include <getopt.h> #endif *************** *** 49,53 **** extern target_t *vectors; ! poptContext optCon; // context for parsing command-line options sonar_t mthis; --- 53,57 ---- extern target_t *vectors; ! /*poptContext optCon; // context for parsing command-line options*/ sonar_t mthis; *************** *** 116,120 **** { ! int cur = 0, opt = 0, ret; int plugin_selected = 0, i; target_t *first_target; --- 120,124 ---- { ! int cur = 0, opt = 0, ret, opt_ind = 1; int plugin_selected = 0, i; target_t *first_target; *************** *** 124,134 **** int n; ! struct poptOption optionsTable[] = { ! DEFAULT_OPTIONS {"help", '?', 0, 0, HELP, NULL, 0}, ! {"usage", '\0', 0, 0, USAGE, NULL, 0}, ! //POPT_AUTOHELP ! {NULL, 0, 0, NULL, 0} ! }; ! //setup mthis (sonar_t) --- 128,137 ---- int n; ! struct option optionsTable[] = { ! GETOPT_OPTIONS ! {"help", 0, NULL, '?'}, ! {"usage", 0, NULL, 'U'}, ! {0, 0, 0, 0} ! }; //setup mthis (sonar_t) *************** *** 139,145 **** clear_plugin_context(&(mthis.pCon)); ! optCon = poptGetContext(NULL, argc, (const char **) argv, optionsTable, 1); ! poptSetOtherOptionHelp(optCon, "[options] <scan-type> <target(s)>"); //these will be fatal errors, as plugins become the --- 142,148 ---- clear_plugin_context(&(mthis.pCon)); ! /*optCon = poptGetContext(NULL, argc, (const char **) argv, optionsTable, 1); ! poptSetOtherOptionHelp(optCon, "[options] <scan-type> <target(s)>");*/ //these will be fatal errors, as plugins become the *************** *** 148,152 **** if(plugin_start(&mthis) != PLUGIN_OK) ! sonar_popt_usage(optCon, -1, "Fatal", "Could not initialize plugin API\n"); --- 151,155 ---- if(plugin_start(&mthis) != PLUGIN_OK) ! sonar_opt_usage(-1, "Fatal", "Could not initialize plugin API\n"); *************** *** 154,166 **** if(plugin_loadall(&mthis) != PLUGIN_OK) ! sonar_popt_usage(optCon, -1, "Fatal", "Could not load any plugins\n"); if(argc < 2) { ! sonar_popt_usage(optCon, 0, NULL, NULL); } ! while((opt = poptGetNextOpt(optCon)) >= 0) { // core options, handled first --- 157,169 ---- if(plugin_loadall(&mthis) != PLUGIN_OK) ! sonar_opt_usage(-1, "Fatal", "Could not load any plugins\n"); if(argc < 2) { ! sonar_opt_usage(0, "error", "no arguments\n"); } ! while((opt = getopt_long(argc, argv, "vqrfd:c:s:i:o:p:w:t:h:be:?", optionsTable, &opt_ind)) >= 0) { // core options, handled first *************** *** 168,175 **** { ! case PLUGIN_SELECT: ! plugin = (char *) poptGetOptArg(optCon); if(!plugin) ! sonar_popt_usage(optCon, 1, "fatal", "no plugin selected"); for(i = 0; i < num_net; i++) --- 171,178 ---- { ! case 's': ! plugin = (char *) optarg; if(!plugin) ! sonar_opt_usage(-1, "fatal", "no plugin selected"); for(i = 0; i < num_net; i++) *************** *** 203,210 **** } break; ! case INPUT_SELECT: ! plugin = (char *) poptGetOptArg(optCon); if(!plugin) ! sonar_popt_usage(optCon, 1, "fatal", "no plugin selected"); for(i = 0; i < num_inp; i++) --- 206,213 ---- } break; ! case 'i': ! plugin = (char *) optarg; if(!plugin) ! sonar_opt_usage(-1, "fatal", "no plugin selected"); for(i = 0; i < num_inp; i++) *************** *** 238,245 **** } break; ! case OUTPUT_SELECT: ! plugin = (char *) poptGetOptArg(optCon); if(!plugin) ! sonar_popt_usage(optCon, 1, "fatal", "no plugin selected"); for(i = 0; i < num_out; i++) --- 241,248 ---- } break; ! case 'o': ! plugin = (char *) optarg; if(!plugin) ! sonar_opt_usage(-1, "fatal", "no plugin selected"); for(i = 0; i < num_out; i++) *************** *** 275,282 **** break; ! ! ! case PLUGIN_OPTION: ! plugin = (char *) poptGetOptArg(optCon); log_write(LOG_DBUG, "plugin_command_handler(%c, %s);\n", --- 278,283 ---- break; ! case 'p': ! plugin = (char *) optarg; log_write(LOG_DBUG, "plugin_command_handler(%c, %s);\n", *************** *** 290,294 **** break; case 'v': ! mthis.sCon.iVerbose++; log_write(LOG_DBUG, "verbosity = %d;\n", mthis.sCon.iVerbose); --- 291,296 ---- break; case 'v': ! if(mthis.sCon.iVerbose == 0) ! mthis.sCon.iVerbose++; log_write(LOG_DBUG, "verbosity = %d;\n", mthis.sCon.iVerbose); *************** *** 297,314 **** mthis.sCon.iVerbose = -1; break; case 'r': mthis.sCon.bRandom = 1; break; ! case 'd': daemon_proc(argv[0], LOG_DAEMON); break; ! case HELP: ! sonar_popt_help(optCon, 1); break; ! case USAGE: ! sonar_popt_usage(optCon, 1, NULL, NULL); break; default: ! sonar_popt_usage(optCon, 1, "Bad Argument", "unknown argument passed"); break; --- 299,340 ---- mthis.sCon.iVerbose = -1; break; + case 'd': + mthis.sCon.iScanDelay = sanity_check(atoi(optarg), 0, LESS); + break; + case 'c': + mthis.sCon.iCount = sanity_check(atoi(optarg), 0, LESS); + break; + case 'w': + mthis.pCon.iPostDelay = sanity_check(atoi(optarg), 0, LESS); + break; + case 't': + mthis.pCon.iTimeout = sanity_check(atoi(optarg), 0, LESS); + if(mthis.pCon.iTimeout < 500) + log_write(LOG_CONSOLE, "low timeout chosen, results could be unreliable\n"); + break; + case 'h': + mthis.pCon.iHostDelay = sanity_check(atoi(optarg), 0, LESS); + break; + case 'b': + mthis.pCon.bSockDebug++; + break; + case 'e': + mthis.pCon.prog = strdup(optarg); + escape_shell(&(mthis.pCon.prog)); + break; case 'r': mthis.sCon.bRandom = 1; break; ! case 'f': daemon_proc(argv[0], LOG_DAEMON); break; ! case '?': ! sonar_opt_help(0); break; ! case 'U': ! sonar_opt_usage(0, NULL, NULL); break; default: ! sonar_opt_usage(-1, "Bad Argument", "unknown argument passed"); break; *************** *** 318,326 **** if(plugin_selected == 0) { ! sonar_popt_usage(optCon, 1, "fatal", "no plugin(s) selected"); } /* no hostnames on the command line */ ! if(poptPeekArg(optCon) == NULL) { int i, bypass = 0, iplug = 0, n; --- 344,353 ---- if(plugin_selected == 0) { ! sonar_opt_usage(-1, "fatal", "no plugin(s) selected"); } /* no hostnames on the command line */ ! log_write(LOG_DBUG, "optind: %d, argc: %d\n", optind, argc); ! if(optind >= argc) { int i, bypass = 0, iplug = 0, n; *************** *** 385,398 **** if(bypass == 0) { ! sonar_popt_usage(optCon, -1, "ERROR", "no target host/ip"); } } } - escape_shell(&(mthis.pCon.prog)); sonar_commandline(argv, argc, &(mthis.sCon.sCommandLine)); ! while(poptPeekArg(optCon) != NULL) { ! plugin = (char *) poptGetArg(optCon); // pass off anything left as targets --- 412,424 ---- if(bypass == 0) { ! sonar_opt_usage(-1, "ERROR", "no target host/ip"); } } } sonar_commandline(argv, argc, &(mthis.sCon.sCommandLine)); ! while(optind < argc) { ! plugin = (char *) argv[optind++]; // pass off anything left as targets *************** *** 475,479 **** /* XXX: i took LOG_SLOG out because it would hang in daemon mode */ log_write(LOG_CONSOLE | LOG_PLUGINS, "Scan took %.2f seconds\n", dif); ! poptFreeContext(optCon); if(plugin_killall() != PLUGIN_OK) err_msg("Could not unload plugins\n"); --- 501,505 ---- /* XXX: i took LOG_SLOG out because it would hang in daemon mode */ log_write(LOG_CONSOLE | LOG_PLUGINS, "Scan took %.2f seconds\n", dif); ! if(plugin_killall() != PLUGIN_OK) err_msg("Could not unload plugins\n"); Index: sonar.h =================================================================== RCS file: /cvsroot/autosec/sonar/src/sonar.h,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** sonar.h 17 Jan 2004 03:12:32 -0000 1.27 --- sonar.h 29 Jan 2004 23:43:52 -0000 1.28 *************** *** 24,28 **** /// Ok #define SONAR_OK 1 ! #define DEFAULT_OPTIONS {"fork", 'f', POPT_ARG_NONE, 0, 'd', \ "fork into background (daemon mode)", NULL}, \ --- 24,28 ---- /// Ok #define SONAR_OK 1 ! /* #define DEFAULT_OPTIONS {"fork", 'f', POPT_ARG_NONE, 0, 'd', \ "fork into background (daemon mode)", NULL}, \ *************** *** 70,74 **** {"exe", 'e', POPT_ARG_STRING, &(mthis.pCon.prog), 0, \ "program to execute if host is online", "program"}, ! int h_errno; --- 70,90 ---- {"exe", 'e', POPT_ARG_STRING, &(mthis.pCon.prog), 0, \ "program to execute if host is online", "program"}, ! */ ! #define GETOPT_OPTIONS {"fork", 0, NULL, 'f'}, \ ! {"verbose", 0, NULL, 'v'}, \ ! {"quiet", 0, NULL, 'q'}, \ ! {"randomize", 0, NULL, 'r'}, \ ! {"scan_delay", 1, NULL, 'd'}, \ ! {"count", 1, NULL, 'c'}, \ ! {"scan_type", 1, NULL, 's'}, \ ! {"input", 1, NULL, 'i'}, \ ! {"output", 1, NULL, 'o'}, \ ! {"plugin_opt", 1, NULL, 'p'}, \ ! {"post_delay", 1, NULL, 'w'}, \ ! {"timeout", 1, NULL, 't'}, \ ! {"delay", 1, NULL, 'h'}, \ ! {"debug", 0, NULL, 'b'}, \ ! {"execute", 1, NULL, 'e'}, ! int h_errno; Index: util.c =================================================================== RCS file: /cvsroot/autosec/sonar/src/util.c,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** util.c 17 Jan 2004 03:12:32 -0000 1.22 --- util.c 29 Jan 2004 23:43:52 -0000 1.23 *************** *** 37,41 **** extern int sonar_rawoutput(char *msg, ...); extern int sonar_sweep(void); - extern poptContext optCon; extern sonar_t mthis; --- 37,40 ---- *************** *** 50,54 **** void sonar_usage(const char *err) { ! sonar_popt_usage(optCon, -1, "error", (char *) err); } --- 49,53 ---- void sonar_usage(const char *err) { ! sonar_opt_usage(-1, "error", (char *) err); } *************** *** 457,458 **** --- 456,471 ---- return hosts2; } + + int sanity_check(int value, int min, int dir) + { + if(dir == LESS) + { + if(value < min) + value = min; + return value; + } + if(value > min) + value = min; + return value; + + } Index: util.h =================================================================== RCS file: /cvsroot/autosec/sonar/src/util.h,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** util.h 17 Jan 2004 03:12:32 -0000 1.22 --- util.h 29 Jan 2004 23:43:52 -0000 1.23 *************** *** 52,55 **** --- 52,58 ---- /* was 64 */ + #define LESS 1 + #define MORE 0 + extern FILE *raw_output; extern int main(int, char **); *************** *** 70,73 **** --- 73,77 ---- void escape_shell(char **myfunc); target_t *randomize(target_t * in); + int sanity_check(int value, int min, int dir); #endif |
From: <re...@pr...> - 2004-01-30 22:55:38
|
Update of /cvsroot/autosec/sonar In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8422 Modified Files: config.h.in configure configure.in Log Message: removed libpopt dependency Index: config.h.in =================================================================== RCS file: /cvsroot/autosec/sonar/config.h.in,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** config.h.in 17 Jan 2004 03:04:36 -0000 1.20 --- config.h.in 29 Jan 2004 23:43:52 -0000 1.21 *************** *** 35,38 **** --- 35,41 ---- #undef HAVE_GETHOSTNAME + /* Define to 1 if you have the <getopt.h> header file. */ + #undef HAVE_GETOPT_H + /* Define to 1 if you have the `gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY *************** *** 75,81 **** #undef HAVE_NETINET_IN_H - /* Define to 1 if you have the <popt.h> header file. */ - #undef HAVE_POPT_H - /* Define to 1 if your system has a GNU libc compatible `realloc' function, and to 0 otherwise. */ --- 78,81 ---- Index: configure =================================================================== RCS file: /cvsroot/autosec/sonar/configure,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** configure 12 Jan 2004 09:26:10 -0000 1.32 --- configure 29 Jan 2004 23:43:52 -0000 1.33 *************** *** 9148,9152 **** ! for ac_header in arpa/inet.h fcntl.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h syslog.h unistd.h popt.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` --- 9148,9152 ---- ! for ac_header in arpa/inet.h fcntl.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h syslog.h unistd.h getopt.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` Index: configure.in =================================================================== RCS file: /cvsroot/autosec/sonar/configure.in,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** configure.in 12 Jan 2004 09:26:10 -0000 1.29 --- configure.in 29 Jan 2004 23:43:52 -0000 1.30 *************** *** 54,58 **** AC_HEADER_DIRENT AC_HEADER_STDC ! AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h syslog.h unistd.h popt.h], , [echo "missing required headers"; exit]) # Checks for typedefs, structures, and compiler characteristics. --- 54,58 ---- AC_HEADER_DIRENT AC_HEADER_STDC ! AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h syslog.h unistd.h getopt.h], , [echo "missing required headers"; exit]) # Checks for typedefs, structures, and compiler characteristics. |
From: <re...@us...> - 2004-01-18 02:37:14
|
Update of /cvsroot/autosec/sonar/plugins In directory sc8-pr-cvs1:/tmp/cvs-serv29490/plugins Modified Files: rfc793.c rfc793.h Log Message: Checksum fix, intermediate timing rework Index: rfc793.c =================================================================== RCS file: /cvsroot/autosec/sonar/plugins/rfc793.c,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** rfc793.c 17 Jan 2004 03:12:31 -0000 1.32 --- rfc793.c 18 Jan 2004 02:37:11 -0000 1.33 *************** *** 339,346 **** { recd.start = clock(); ! recd.max += recd.start + ! (timeout * CLOCKS_PER_SEC) / 1000; ! recd.hosts++; // += (targets->num_ports - 1); ! targets->num_ports--; } for(i = 0; i < 65536; i++) --- 339,348 ---- { recd.start = clock(); ! recd.max = recd.start + ! (timeout * targets->num_ports * CLOCKS_PER_SEC) / 1000; ! //recd.hosts++; // += (targets->num_ports - 1); ! ! recd.ports = targets->num_ports; ! targets->num_ports = 0; //--; } for(i = 0; i < 65536; i++) *************** *** 352,355 **** --- 354,358 ---- if(targets->extra_hosts > 0) { + recd.start = clock(); recd.max += (timeout * *************** *** 357,360 **** --- 360,364 ---- CLOCKS_PER_SEC) / 1000; recd.hosts += targets->extra_hosts; + targets->extra_hosts = 0; if(mthis->sCon.iVerbose > 0) err_msg("Increasing timeout, netmask detected: %d", recd.max); *************** *** 413,417 **** srand(getpid() ^ (uid_t) time(NULL)); gethostname(name, 255); ! ai = mthis->resolve(name, NULL, 0, PF_INET); memcpy(my_ports, target->ports, 65537 * sizeof(int)); for(j = 0; j <= target->extra_hosts; j++) --- 417,421 ---- srand(getpid() ^ (uid_t) time(NULL)); gethostname(name, 255); ! ai = mthis->resolve(name, NULL, PF_INET, 0); memcpy(my_ports, target->ports, 65537 * sizeof(int)); for(j = 0; j <= target->extra_hosts; j++) *************** *** 426,437 **** memset(name, 0, 256); ! ! if(ai) { ! memcpy(&nt.src, ai->ai_addr, ai->ai_addrlen); } ! else ! return PLUGIN_RESOLVE; ! if(mthis->pCon.iSrcPort != -1) --- 430,447 ---- memset(name, 0, 256); ! if(!ai) ! return PLUGIN_RESOLVE; ! while(ai->ai_family != PF_INET) { ! fprintf(stderr, "non ipv4 address:\n"); ! ai = ai->ai_next; ! if(!ai) ! { ! fprintf(stderr, "no more addresses"); ! return PLUGIN_RESOLVE; ! } } ! sa = (struct sockaddr_in *) ai->ai_addr; ! memcpy(&nt.src, &(sa->sin_addr), sizeof(struct in_addr)); if(mthis->pCon.iSrcPort != -1) *************** *** 503,507 **** double triptime; unsigned long unreach = 0, filt = 0, unfilt = 0; ! struct timeval tv; int bread, ret; char buf[MAX_PACKET], *adr = NULL; --- 513,517 ---- double triptime; unsigned long unreach = 0, filt = 0, unfilt = 0; ! struct timeval tv, ts; int bread, ret; char buf[MAX_PACKET], *adr = NULL; *************** *** 527,531 **** rec->responses = 0; while((done == 0 || clock() <= rec->max) ! && rec->responses < rec->hosts) { /* dont do anything up here, or we'll eat CPU */ --- 537,541 ---- rec->responses = 0; while((done == 0 || clock() <= rec->max) ! && rec->responses < rec->hosts * rec->ports) { /* dont do anything up here, or we'll eat CPU */ *************** *** 576,584 **** } /* XXX: timestamping should be on a per-packet basis */ ! gettimeofday(&tv, &(tz)); ! ! tvsub(&tv, &tp); ! triptime = tv.tv_sec * 1000 + (tv.tv_usec / 1000); ! iphdr = (struct ip *) buf; iphdrlen = iphdr->ip_hl * 4; // number of 32-bit words *4 = bytes --- 586,591 ---- } /* XXX: timestamping should be on a per-packet basis */ ! gettimeofday(&tv, &(tz)); ! tvsub(&tv, &tp); iphdr = (struct ip *) buf; iphdrlen = iphdr->ip_hl * 4; // number of 32-bit words *4 = bytes *************** *** 635,638 **** --- 642,650 ---- } // we get something other than a RST, it should be filtered + + + + + triptime = tv.tv_sec * 1000 + (tv.tv_usec / 1000); if((tcp->th_flags & TH_RST)) { *************** *** 843,848 **** mthis->message("ACK Scan complete:\n"); mthis->message ! (" Scanned %d hosts/ports, %d hosts online, %d filtered, %d unfiltered, %d hosts unreachable\n", ! rec->hosts, rec->responses - unreach, filt, unfilt, unreach); } --- 855,860 ---- mthis->message("ACK Scan complete:\n"); mthis->message ! (" Scanned %d hosts/ %d ports, %d hosts online, %d filtered, %d unfiltered, %d hosts unreachable\n", ! rec->hosts, rec->ports, rec->responses - unreach, filt, unfilt, unreach); } *************** *** 895,900 **** else mthis->output("-"); ! mthis->output(") offset: %d window: %d seq: %d ack: %d\n", ! tcp->th_off, tcp->th_win, tcp->th_seq, tcp->th_ack); } --- 907,912 ---- else mthis->output("-"); ! mthis->output(") offset: 0x%04x window: %04x seq: 0x%04x ack: 0x%04x cksum: 0x%04x\n", ! tcp->th_off, tcp->th_win, tcp->th_seq, tcp->th_ack, tcp->th_sum); } *************** *** 930,938 **** struct _fakehead fakehead; int sum; memset(&tcp, 0, sizeof(tcp)); memset(&fakehead, 0, sizeof(fakehead)); ! tcp.th_dport = nt->dport; --- 942,951 ---- struct _fakehead fakehead; int sum; + struct timeval tv; memset(&tcp, 0, sizeof(tcp)); memset(&fakehead, 0, sizeof(fakehead)); ! gettimeofday(&tv, &tz); tcp.th_dport = nt->dport; *************** *** 944,951 **** sum = in_cksum((u_short *) & fakehead, sizeof(fakehead)); tcp.th_off = TCP_SIZE >> 2; ! tcp.th_seq = 1 + (int) (65535.0 * rand() / (RAND_MAX + 1.0)); ! tcp.th_ack = 1 + (int) (65535.0 * rand() / (RAND_MAX + 1.0)); tcp.th_flags |= flags; /* ADD the flags */ ! tcp.th_win = 0; sum += in_cksum((u_short *) & tcp, sizeof(tcp)); tcp.th_sum = CKSUM_CARRY(sum); --- 957,964 ---- sum = in_cksum((u_short *) & fakehead, sizeof(fakehead)); tcp.th_off = TCP_SIZE >> 2; ! tcp.th_seq = ntohl(1 + (unsigned long) (4294967296.0 * rand() / (RAND_MAX + 1.0))); ! tcp.th_ack = ntohl(1 + (unsigned long) (4294967296.0 * rand() / (RAND_MAX + 1.0))); tcp.th_flags |= flags; /* ADD the flags */ ! tcp.th_win = htons((getpid() * 1024 + rand()) % 1024); sum += in_cksum((u_short *) & tcp, sizeof(tcp)); tcp.th_sum = CKSUM_CARRY(sum); Index: rfc793.h =================================================================== RCS file: /cvsroot/autosec/sonar/plugins/rfc793.h,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** rfc793.h 1 Oct 2003 07:13:29 -0000 1.25 --- rfc793.h 18 Jan 2004 02:37:11 -0000 1.26 *************** *** 118,121 **** --- 118,128 ---- }; + struct tcp_timestamp + { + uint8_t kind; /* TCPOPT_TIMESTAMP */ + uint8_t len; /* 10 */ + uint32_t tsval; /* my timestamp */ + uint32_t tsecho; /* server's timestamp */ + }; struct recv_t *************** *** 123,128 **** /// socket to listen on (must already be open) int socket, errs; ! /// number of hosts we pinged uint32_t hosts; /// set the number of responses uint32_t responses; --- 130,136 ---- /// socket to listen on (must already be open) int socket, errs; ! /// number of hosts and ports we pinged uint32_t hosts; + uint32_t ports; /// set the number of responses uint32_t responses; |
From: <re...@us...> - 2004-01-17 03:12:35
|
Update of /cvsroot/autosec/sonar/src In directory sc8-pr-cvs1:/tmp/cvs-serv14128/src Modified Files: plugin.h sonar.c sonar.h target.c target.h util.c util.h Log Message: Removed results_t and placed it all in target_t Index: plugin.h =================================================================== RCS file: /cvsroot/autosec/sonar/src/plugin.h,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** plugin.h 6 Dec 2003 00:14:41 -0000 1.32 --- plugin.h 17 Jan 2004 03:12:31 -0000 1.33 *************** *** 29,33 **** #define DEFAULT_COUNT 1 #define DEFAULT_TIMEOUT 5000 ! #define API_VER 5 /** \name Error and Success Values --- 29,33 ---- #define DEFAULT_COUNT 1 #define DEFAULT_TIMEOUT 5000 ! #define API_VER 6 /** \name Error and Success Values *************** *** 104,107 **** --- 104,116 ---- #define PORT_UNFILTERED 7 + typedef struct stats_s stats_t; + + struct stats_s + { + unsigned int packets_sent; + unsigned int packets_recvd; + unsigned short ttl; + double rtt_min, rtt_max, rtt_avg; + }; typedef struct target_s target_t; *************** *** 113,118 **** /// user specified entry char *entry; - /// canonical hostname - //char *hostname; /// list of ports to scan int ports[65537]; --- 122,125 ---- *************** *** 125,148 **** /// number of ports in this host uint32_t num_ports; ! }; ! ! typedef struct result_s result_t; ! ! struct result_s ! { ! /// next result for plugins that return all results at once ! result_t *next; ! /// hostname ! char *hostname; ! /// ports state structure ! unsigned char ports[65537]; ! /// address information ! struct addrinfo *ainfo; ! /// round trip time ! double rtt; ! /// time to live ! unsigned int ttl; ! /// extra data? ! void *user_data; }; --- 132,137 ---- /// number of ports in this host uint32_t num_ports; ! /// statistics ! stats_t stats; }; *************** *** 225,229 **** int (*plugin_output) (char *msg, va_list * ap); /// output plugins result output function ! int (*plugin_results) (result_t *result); /// prints, via sonar_t->output(), line(s) to add to sonar_usage() --- 214,218 ---- int (*plugin_output) (char *msg, va_list * ap); /// output plugins result output function ! int (*plugin_results) (target_t *result, unsigned int num); /// prints, via sonar_t->output(), line(s) to add to sonar_usage() *************** *** 292,302 **** /// Pointer to sonar's output to console function (no timestamp) int (*output) (char *msg, ...); - - /// point to sonar's result collecting function - int (*results) (result_t *results, unsigned long num_records); - /// insert results into a linked list of results - int (*insert_results) (result_t *results, result_t *insertion); - /// free a results linked list - void (*free_results) (result_t *results); /// Pointer to usage function, for error reports --- 281,284 ---- *************** *** 307,310 **** --- 289,294 ---- /// Pointer to a function to drop root priveleges int (*dropprivs) (uid_t); + /// find a target, for updating + target_t *(*find_target) (struct sonar_s *this, struct addrinfo *ai); /// Name of file we are (for permissions checking) Index: sonar.c =================================================================== RCS file: /cvsroot/autosec/sonar/src/sonar.c,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** sonar.c 10 Nov 2003 10:22:34 -0000 1.26 --- sonar.c 17 Jan 2004 03:12:32 -0000 1.27 *************** *** 95,104 **** mthis->resolve = &Host_serv; mthis->output = &sonar_rawoutput; - mthis->results = &sonar_result_hook; - mthis->insert_results = &insert_results; - mthis->free_results = &free_results; mthis->usage = &sonar_usage; mthis->getprivs = &sonar_getprivs; mthis->dropprivs = &sonar_dropprivs; // no targets yet ;) mthis->vectors = NULL; --- 95,102 ---- mthis->resolve = &Host_serv; mthis->output = &sonar_rawoutput; mthis->usage = &sonar_usage; mthis->getprivs = &sonar_getprivs; mthis->dropprivs = &sonar_dropprivs; + mthis->find_target = &sonar_find_target; // no targets yet ;) mthis->vectors = NULL; *************** *** 118,122 **** { ! int cur = 0, opt = 0; int plugin_selected = 0, i; target_t *first_target; --- 116,120 ---- { ! int cur = 0, opt = 0, ret; int plugin_selected = 0, i; target_t *first_target; *************** *** 124,127 **** --- 122,126 ---- float dif = 0; static char *plugin; + int n; struct poptOption optionsTable[] = { *************** *** 436,439 **** --- 435,439 ---- if(gettimeofday(&ts, NULL) != 0) err_ret("gettimeofday failed"); + for(i = 0; i < num_net; i++) { *************** *** 451,456 **** } if(err == PLUGIN_OK) /* the meaning of this has changed slightly, */ ! { /* it just means everything went alright, no errors */ ! } cur++; --- 451,456 ---- } if(err == PLUGIN_OK) /* the meaning of this has changed slightly, */ ! { /* it just means everything went alright, no errors */ ! } cur++; *************** *** 459,462 **** --- 459,472 ---- sleep(mthis.sCon.iScanDelay); } + for(n = 0; n < num_out; n++) + { + if(output_list[n].plug->selected && output_list[n].plug->ready) + { + /* let each plugin parse its own results */ + ret = output_list[n].plug->plugin_results(mthis.vectors, mthis.num_targets); + if(ret != PLUGIN_OK) + log_write(LOG_CONSOLE | LOG_SLOG, "output plugin \'%s\' had trouble writing output\n", output_list[i].plug->shortname); + } + } if(gettimeofday(&te, NULL) != 0) err_ret("gettimeofday failed"); *************** *** 597,603 **** } if(status != PLUGIN_OK) ! return SONAR_ERROR; } ! return status; } --- 607,613 ---- } if(status != PLUGIN_OK) ! return status; } ! return SONAR_OK; } *************** *** 608,636 **** * @todo Fix up plugins to use this function to report results, instead of printing out */ ! int sonar_result_hook(result_t *results, unsigned long num_records) ! { ! int i, ret = SONAR_OK; ! unsigned long j = 0; ! assert(results != NULL); ! ! /* go through the number of records */ ! /* we use '<=' here because we want a stub for hosts that did not return any info */ ! while(j <= num_records && results != NULL) ! { ! /* go through the output plugins and send it to the selected ones */ ! for(i=0; i < num_out; i++) ! { ! if(output_list[i].plug->selected && output_list[i].plug->ready) ! { ! /* let each plugin parse its own results */ ! ret = output_list[i].plug->plugin_results(results); ! if(ret != PLUGIN_OK) ! log_write(LOG_CONSOLE | LOG_SLOG, "output plugin \'%s\' had trouble writing output\n", output_list[i].plug->shortname); ! } ! } ! j++; ! results = results->next; ! } ! ! return ret; ! } --- 618,647 ---- * @todo Fix up plugins to use this function to report results, instead of printing out */ ! // ! // int sonar_result_hook(result_t *results, unsigned long num_records) ! // { ! // int i, ret = SONAR_OK; ! // unsigned long j = 0; ! // assert(results != NULL); ! // ! // /* go through the number of records */ ! // /* we use '<=' here because we want a stub for hosts that did not return any info */ ! // while(j <= num_records && results != NULL) ! // { ! // /* go through the output plugins and send it to the selected ones */ ! // for(i=0; i < num_out; i++) ! // { ! // if(output_list[i].plug->selected && output_list[i].plug->ready) ! // { ! // /* let each plugin parse its own results */ ! // ret = output_list[i].plug->plugin_results(results); ! // if(ret != PLUGIN_OK) ! // log_write(LOG_CONSOLE | LOG_SLOG, "output plugin \'%s\' had trouble writing output\n", output_list[i].plug->shortname); ! // } ! // } ! // j++; ! // results = results->next; ! // } ! // ! // return ret; ! // } Index: sonar.h =================================================================== RCS file: /cvsroot/autosec/sonar/src/sonar.h,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** sonar.h 5 Dec 2003 22:47:21 -0000 1.26 --- sonar.h 17 Jan 2004 03:12:32 -0000 1.27 *************** *** 77,81 **** void sonar_status_report(sonar_t mthis); int sonar_rawoutput(char *msg, ...); - int sonar_result_hook(result_t *results, unsigned long num_records); int sonar_sweep(target_t *targets); void default_context(void *in); --- 77,80 ---- Index: target.c =================================================================== RCS file: /cvsroot/autosec/sonar/src/target.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** target.c 5 Dec 2003 22:47:52 -0000 1.8 --- target.c 17 Jan 2004 03:12:32 -0000 1.9 *************** *** 28,31 **** --- 28,33 ---- #include "sonar.h" + #include <string.h> + extern sonar_t mthis; *************** *** 33,37 **** "\100$ autosec/sonar: $Id$"; ! static unsigned long check_netmask(target_t *target); static int parse_target_ports(char *ports, target_t **target); static int load_default_ports(target_t **target); --- 35,39 ---- "\100$ autosec/sonar: $Id$"; ! static unsigned long check_netmask(sonar_t *this, target_t *target); static int parse_target_ports(char *ports, target_t **target); static int load_default_ports(target_t **target); *************** *** 53,62 **** len = strlen(entry); ! // copy the entry over ! hostname = (char *) malloc(len + 1); ! if(!hostname) ! err_sys("sonar_add_target: malloc error"); ! memset((char *) hostname, 0, len + 1); ! strncpy(hostname, entry, len); ports = mask = hostname; --- 55,61 ---- len = strlen(entry); ! /* copy the entry over */ ! hostname = strndup(entry, len); ! ports = mask = hostname; *************** *** 100,115 **** if(target == NULL) err_sys("sonar_add_target: malloc error"); // start filling in needed values ! target->entry = (char *) malloc(len + 1); ! if(!target->entry) ! err_sys("sonar_add_target: malloc error"); ! memset(target->entry, 0,len + 1); ! strncpy(target->entry, entry, len); target->netmask = imask; //parse list of ports. num_ports = parse_target_ports(ports, &(target)); - // See if we have an ipv4 hostname, and wrap it - // call Wrapped host_serv so we dont have to check for errors. addr = Host_serv(hostname, NULL, 0, 0); --- 99,110 ---- if(target == NULL) err_sys("sonar_add_target: malloc error"); + memset(target, 0, sizeof(target_t)); + // start filling in needed values ! target->entry = hostname; /*strndup(entry, len);*/ target->netmask = imask; //parse list of ports. num_ports = parse_target_ports(ports, &(target)); // call Wrapped host_serv so we dont have to check for errors. addr = Host_serv(hostname, NULL, 0, 0); *************** *** 118,122 **** target->num_ports = num_ports; target->next = NULL; ! num_hosts = check_netmask(target); ent = this->vectors; --- 113,117 ---- target->num_ports = num_ports; target->next = NULL; ! num_hosts = check_netmask(this, target); ent = this->vectors; *************** *** 131,141 **** this->num_targets++; - /* XXX: Fix this, put it in target_t */ - this->num_ports += num_ports; - return SONAR_OK; } ! static unsigned long check_netmask(target_t *target) { unsigned long retval = 0, longtmp; --- 126,204 ---- this->num_targets++; return SONAR_OK; } ! /* find a target in the linked list by address info */ ! target_t *sonar_find_target(sonar_t *this, struct addrinfo *ai) ! { ! target_t *res = NULL; ! uint32_t start, end, longtmp; ! struct sockaddr_in *sa; ! ! if(!ai || !this) /* meaningless answer to a retarded question */ ! return NULL; ! if(!this->vectors) ! return NULL; ! ! res = this->vectors; ! ! if(res->addrinfo) ! { ! assert(res->addrinfo->ai_addr != NULL); ! switch(res->addrinfo->ai_family) ! { ! case PF_INET: ! sa = (struct sockaddr_in *) res->addrinfo->ai_addr; ! longtmp = ntohl(sa->sin_addr.s_addr); ! start = longtmp & (unsigned long) (0 - (1 << (32 - res->netmask))); ! end = longtmp | (unsigned long) ((1<<(32 - res->netmask)) - 1); ! /* if its in range, we have a match */ ! sa = (struct sockaddr_in *) ai->ai_addr; ! assert(sa != NULL); ! longtmp = ntohl(sa->sin_addr.s_addr); ! ! if(longtmp <= end && longtmp >= start) ! return res; ! break; ! default: ! log_write(LOG_DBUG, "IPv4 supported only\n"); ! return NULL; ! } ! if(memcmp(res->addrinfo, ai, sizeof(struct addrinfo)) == 0) ! return res; ! } ! while(res->next) ! { ! res = res->next; ! if(res->addrinfo) ! { ! assert(res->addrinfo->ai_addr != NULL); ! switch(res->addrinfo->ai_family) ! { ! case PF_INET: ! sa = (struct sockaddr_in *) res->addrinfo->ai_addr; ! longtmp = ntohl(sa->sin_addr.s_addr); ! start = longtmp & (unsigned long) (0 - (1 << (32 - res->netmask))); ! end = longtmp | (unsigned long) ((1<<(32 - res->netmask)) - 1); ! /* if its in range, we have a match */ ! sa = (struct sockaddr_in *) ai->ai_addr; ! assert(sa != NULL); ! longtmp = ntohl(sa->sin_addr.s_addr); ! ! if(longtmp <= end && longtmp >= start) ! return res; ! break; ! default: ! log_write(LOG_DBUG, "IPv4 supported only\n"); ! return NULL; ! } ! if(memcmp(res->addrinfo, ai, sizeof(struct addrinfo)) == 0) ! return res; ! } ! } ! return NULL; ! } ! ! static unsigned long check_netmask(sonar_t *this, target_t *target) { unsigned long retval = 0, longtmp; *************** *** 151,158 **** start = longtmp & (unsigned long) (0 - (1 << (32 - target->netmask))); if(((start << 24) >> 24) == 0) ! mthis.pCon.bBroadcast++; end = longtmp | (unsigned long) ((1<<(32 - target->netmask)) - 1); if(((end << 24) >> 24) == 0xff) ! mthis.pCon.bBroadcast++; if(start > end) err_msg("Invalid netmask\n"); --- 214,221 ---- start = longtmp & (unsigned long) (0 - (1 << (32 - target->netmask))); if(((start << 24) >> 24) == 0) ! this->pCon.bBroadcast++; end = longtmp | (unsigned long) ((1<<(32 - target->netmask)) - 1); if(((end << 24) >> 24) == 0xff) ! this->pCon.bBroadcast++; if(start > end) err_msg("Invalid netmask\n"); *************** *** 173,177 **** unsigned int ret = 0; ! if(!*target){ *target = malloc(sizeof(target_t)); if(!*target) --- 236,241 ---- unsigned int ret = 0; ! if(!*target) ! { *target = malloc(sizeof(target_t)); if(!*target) *************** *** 181,187 **** /* get default ports from /etc/services */ if(!ports) - { return load_default_ports(target); - } len = strlen(ports); --- 245,249 ---- *************** *** 199,207 **** } - log_write(LOG_DBUG, " clearing port list\n"); - //clear the port list - for(i = 0; i < 65537; i++) - (*target)->ports[i] = 0; - dest = strtok(ports, ","); --- 261,264 ---- *************** *** 238,242 **** while((se = getservent()) != NULL) { ! (*target)->ports[se->s_port] = 1; } endservent(); --- 295,299 ---- while((se = getservent()) != NULL) { ! (*target)->ports[se->s_port] = PORT_SCAN; } endservent(); *************** *** 248,260 **** int sonar_debug_targets(target_t *target) { ! int i = 0; while(target) { ! err_msg(" target debug:"); err_msg(" entry: %s", target->entry); err_msg(" hostname: %s", target->addrinfo->ai_canonname); err_msg(" ports:"); for(i = 0; i < 65536; i++) ! if(target->ports[i] == 1) printf("%d,",i); err_msg(""); --- 305,317 ---- int sonar_debug_targets(target_t *target) { ! int i = 0,n = 0; while(target) { ! err_msg(" target debug[%d]:", n++); err_msg(" entry: %s", target->entry); err_msg(" hostname: %s", target->addrinfo->ai_canonname); err_msg(" ports:"); for(i = 0; i < 65536; i++) ! if(target->ports[i] == PORT_SCAN) printf("%d,",i); err_msg(""); Index: target.h =================================================================== RCS file: /cvsroot/autosec/sonar/src/target.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** target.h 4 Nov 2003 23:48:40 -0000 1.5 --- target.h 17 Jan 2004 03:12:32 -0000 1.6 *************** *** 26,29 **** --- 26,30 ---- #define ALL_PORTS 65537 + target_t *sonar_find_target(sonar_t *this, struct addrinfo *ai); int sonar_add_target(sonar_t * this, char *entry); Index: util.c =================================================================== RCS file: /cvsroot/autosec/sonar/src/util.c,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** util.c 10 Nov 2003 10:24:41 -0000 1.21 --- util.c 17 Jan 2004 03:12:32 -0000 1.22 *************** *** 457,637 **** return hosts2; } - - static int copy_ainfo(struct addrinfo **dest, struct addrinfo *src, int num) - { - int len; - struct addrinfo *first = NULL; - - /* for some reason, we didn't want to copy anything */ - if(num < 1) - return PLUGIN_OK; - - if(!(*dest)) - { - (*dest) = (struct addrinfo *) malloc(sizeof(struct addrinfo)); - if(!(*dest)) - err_sys("memory exhausted\n"); - memset((*dest), 0, sizeof(struct addrinfo)); - } - - first = *dest; - while(num > 0) - { - (*dest)->ai_flags = src->ai_flags; - (*dest)->ai_family = src->ai_family; - (*dest)->ai_socktype = src->ai_socktype; - (*dest)->ai_protocol = src->ai_protocol; - (*dest)->ai_addrlen = src->ai_addrlen; - (*dest)->ai_addr = (struct sockaddr *) malloc(src->ai_addrlen); - if(!(*dest)->ai_addr) - err_sys("memory exhausted\n"); - memset((*dest)->ai_addr, 0, src->ai_addrlen); - memcpy((*dest)->ai_addr, src->ai_addr, src->ai_addrlen); - if(src->ai_canonname) - { - len = strlen(src->ai_canonname); - (*dest)->ai_canonname = (char *) malloc(len+1); - if(!(*dest)->ai_canonname) - err_sys("Memory exhausted\n"); - memset((*dest)->ai_canonname, 0, len+1); - strncpy((*dest)->ai_canonname, src->ai_canonname, len); - } - else - { - (*dest)->ai_canonname = NULL; - } - (*dest)->ai_next = NULL; - if(--num > 0) /* we need more of the list */ - { - /* this only makes sense if there is more to copy */ - assert(src->ai_next != NULL); - (*dest)->ai_next = (struct addrinfo *) malloc(sizeof(struct addrinfo)); - if(!(*dest)->ai_next) - err_sys("memory exhausted\n"); - /* advance the lists */ - (*dest) = (*dest)->ai_next; - src = src->ai_next; - } - } - *dest = first; - return PLUGIN_OK; - } - - /** - * @fn insert_results(result_t *results, result_t *insertion) - * Insert a result into the results linked list - * @param results Results linked list - * @param insertion result_t structure to insert - * @return PLUGIN_OK if everything went well. - */ - int insert_results(result_t *results, result_t *insertion) - { - int len, i, match = 0; - size_t in_len, cmp_len; - result_t *wait = NULL; - assert(results != NULL); - assert(insertion != NULL); - assert(insertion->ainfo != NULL); - assert(insertion->ainfo->ai_addr != NULL); - - /* we are comparing by address data */ - in_len = insertion->ainfo->ai_addrlen; - while(results) - { - /* no records yet */ - if(!(results->ainfo)) - { - /* copy the address info */ - copy_ainfo(&(results->ainfo), insertion->ainfo, 1); - /* straight up copy it, no need to remalloc */ - /*memcpy(results, insertion, sizeof(result_t)); XXX: doing this memcpy will - overwrite the addrinfo, causing random segfaults later*/ - results->hostname = insertion->hostname; - memcpy(results->ports, insertion->ports, sizeof(unsigned char) * 65537); - results->rtt = insertion->rtt; - results->ttl = insertion->ttl; - results->user_data = insertion->user_data; - results->next = NULL; - /* we're done, dood */ - return PLUGIN_OK; - } - /* this crap should not happen */ - assert(results->ainfo != NULL); - assert(results->ainfo->ai_addr != NULL); - - /* do we have a match? */ - cmp_len = results->ainfo->ai_addrlen; - len = (in_len < cmp_len) ? in_len: cmp_len; - if(memcmp(results->ainfo->ai_addr, insertion->ainfo->ai_addr, len) == 0) - { - match++; - /* the only thing that should be different is the ports, so update that */ - for(i=0; i < 65537; i++) - { - /* port has a state we wish to update associated with it */ - if(results->ports[i] < PORT_OPENED) - results->ports[i] = insertion->ports[i]; - } - } - - wait = results; - results = results->next; - } - /* no addresses matched, so make a new one */ - if(!match) - { - int len; - /* we need a new record */ - /* rewind the list*/ - results = wait; - /* insert a new record */ - results->next = (result_t *) malloc(sizeof(result_t)); - if(!(results->next)) - err_sys("No memory\n"); - /* fast forward */ - results = results->next; - memset(results, 0, sizeof(result_t)); - /* remalloc the addrinfo so as not to get cleared out */ - copy_ainfo(&(results->ainfo), insertion->ainfo, 1); - results->hostname = insertion->hostname; - memcpy(results->ports, insertion->ports, sizeof(unsigned char) * 65537); - results->rtt = insertion->rtt; - results->ttl = insertion->ttl; - results->user_data = insertion->user_data; - len = strlen(insertion->hostname); - /*results->ainfo->ai_canonname = (char *) malloc(len +1); - if(!results->ainfo->ai_canonname) - err_sys("Memory exhausted\n"); - memset(results->ainfo->ai_canonname, 0, len + 1); - strncpy(results->ainfo->ai_canonname, insertion->hostname, len);*/ - results->next = NULL; - } - return PLUGIN_OK; - } - - #define xfree(x) free(x); x = NULL - - /** - * @fn free_results(result_t *results) - * Free the memory associated with a results linked list - * @param results Results linked list to free. - */ - void free_results(result_t *results) - { - result_t *wait; - - while(results != NULL) - { - wait = results; - - /* XXX: sometimes this dies */ - freeaddrinfo(results->ainfo); - - xfree(results->ainfo); - xfree(results->user_data); - xfree(results->hostname); - results = results->next; - /* for some reason, this dies */ - /*xfree(wait);*/ - } - } --- 457,458 ---- Index: util.h =================================================================== RCS file: /cvsroot/autosec/sonar/src/util.h,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** util.h 10 Nov 2003 10:25:23 -0000 1.21 --- util.h 17 Jan 2004 03:12:32 -0000 1.22 *************** *** 70,75 **** void escape_shell(char **myfunc); target_t *randomize(target_t * in); - int insert_results(result_t *results, result_t *insertion); - void free_results(result_t *results); #endif --- 70,73 ---- |