Changeset 1563

Show
Ignore:
Timestamp:
02/22/08 09:02:17 (6 months ago)
Author:
till
Message:

nebula
- command line option -i for initial snort sid
- some more logging

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • nebula/trunk/src/classify.c

    r1562 r1563  
    198198 
    199199        // check for signature generation criteria here 
    200         if ((((hash*)t->data)->cl) && ((hash*)t->data)->cl->cnt > 2) { 
     200        if ((((hash*)t->data)->cl) && ((hash*)t->data)->cl->cnt > 5) { 
    201201                        printf("[=] cluster hit size threshold, generating signature.\n"); 
    202202                        if (pthread_create(&ntid, NULL, pt_siggen, (void *) ((hash*)t->data)->cl)) { 
  • nebula/trunk/src/nebula.c

    r1562 r1563  
    6060                "\t\t -c <similarity> cluster criteria (a similarity measure in percent)\n" 
    6161                "\t\t -d\t\t daemonize\n" 
     62                "\t\t -h\t\t this help\n" 
    6263                "\t\t -E <size>\t cluster element queue size\n" 
    63                 "\t\t -h <snort pid>\t send a SIGHUP to this process ID after a new rule was generated\n" 
     64                "\t\t -i <sid>\t initial snort signature ID\n" 
    6465                "\t\t -O <size>\t outlier queue size\n" 
    6566                "\t\t -p <port>\t listen on this port\n" 
     67                "\t\t -r <snort pid>\t send a SIGHUP to this process ID after a new rule was generated\n" 
    6668                "\t\t -s <secret>\t secret string for use in submissions\n" 
    6769                "\t\t -v\t\t be verbose\n" 
     
    121123 
    122124        // process args 
    123         while((option = getopt(argc, argv, "a:c:C:dE:h:O:p:s:v?")) > 0) { 
     125        while((option = getopt(argc, argv, "a:c:C:dE:hi:O:p:r:s:v?")) > 0) { 
    124126                switch(option) { 
    125127                        case 'a': 
     
    150152                                } 
    151153                                break; 
    152                         case 'h': 
    153                                 snort_pid = atoi(optarg); 
    154                                 if (!snort_pid) { 
    155                                         fprintf(stderr, "Error - Invalid process ID.\n"); 
     154                        case 'i': 
     155                                global_sid = strtoul(optarg, NULL, 10); 
     156                                if (!global_sid) { 
     157                                        fprintf(stderr, "Error - Invalid initial snort signature ID.\n"); 
    156158                                        exit(EXIT_FAILURE); 
    157159                                } 
     
    171173                                } 
    172174                                break; 
     175                        case 'r': 
     176                                snort_pid = atoi(optarg); 
     177                                if (!snort_pid) { 
     178                                        fprintf(stderr, "Error - Invalid process ID.\n"); 
     179                                        exit(EXIT_FAILURE); 
     180                                } 
     181                                break; 
    173182                        case 's': 
    174183                                secret = optarg; 
     
    177186                                verbose++; 
    178187                                break; 
     188                        case 'h': 
    179189                        case '?': 
    180190                                usage(argv[0], EXIT_SUCCESS); 
     
    195205 
    196206        if (!secret) { 
    197                 printf("Warning - No submission secret given.\n"); 
    198         } else if (verbose) printf("Submission secret: %s\n", secret); 
     207                printf("  Warning - No submission secret given.\n"); 
     208        } else if (verbose) printf("  Submission secret: %s\n", secret); 
    199209 
    200210        if (snort_pid && !rules_file) { 
    201                 printf("Warning - Snort will not be notified about updated rules: No rule filename given.\n"); 
     211                printf("  Warning - Snort will not be notified about updated rules: No rule filename given.\n"); 
    202212        } else if (!snort_pid && rules_file) { 
    203                 printf("Warning - Snort will not be notified about updated rules: No pid given.\n"); 
     213                printf("  Warning - Snort will not be notified about updated rules: No pid given.\n"); 
    204214        } else if (verbose) { 
    205                 printf("Notifying snort about rule file updates in %s.\n", rules_file); 
    206         } 
     215                printf("  Notifying snort about rule file updates in %s.\n", rules_file); 
     216        } 
     217 
     218        if (verbose) printf("  Initial snort signature ID: %u\n\n", global_sid); 
    207219 
    208220 
  • nebula/trunk/src/session.c

    r1562 r1563  
    150150                                        return(-1); 
    151151                                } 
    152                                 if (s->protocol == 6) 
    153                                         printf("[x] rejected known attack (%lu bytes from port %u/tcp)\n", s->attack_len, s->port); 
    154                                 else if (s->protocol == 17) 
    155                                         printf("[x] rejected known attack (%lu bytes from port %u/udp)\n", s->attack_len, s->port); 
     152                                printf("[x] rejected known attack\n"); 
    156153 
    157154                                session_reset(s, pfd);