Skip to content
Snippets Groups Projects
Select Git revision
  • 2202762f0a44b57541e5c7a7c9d61e8aa4286538
  • zig default
  • master
  • zig-threaded
  • openat
  • chdir
  • clear
  • compll
  • v1.18.1
  • v2.2.2
  • v1.18
  • v2.2.1
  • v2.2
  • v1.17
  • v2.1.2
  • v2.1.1
  • v2.1
  • v2.0.1
  • v2.0
  • v2.0-beta3
  • v2.0-beta2
  • v2.0-beta1
  • v1.16
  • v1.15.1
  • v1.15
  • v1.14.2
  • v1.14.1
  • v1.14
28 results

exclude.c

Blame
  • sender-random.pl 1.75 KiB
    #!/usr/bin/perl
    #
    # Copyright (C) 2011-2015 Cesnet z.s.p.o
    #
    # Use of this source is governed by a BSD-style license, see LICENSE file.  
    
    use strict;
    use warnings;
    
    use Switch;
    use DateTime;
    use FindBin qw($RealBin);
    FindBin::again();
    
    use lib "$RealBin/../lib";
    use WardenClient;
    
    my $service = "test";
    
    my $detected = DateTime->from_epoch(epoch => time());
    
    my $type = "";
    switch (int(rand(10) + 0.5)) {
      case 1 { $type = 'portscan'; }
      case 2 { $type = 'bruteforce'; }
      case 3 { $type = 'spam'; }
      case 4 { $type = 'phishing'; }
      case 5 { $type = 'botnet_c_c'; }
      case 6 { $type = 'dos'; }
      case 7 { $type = 'malware'; }
      case 8 { $type = 'copyright'; }
      case 9 { $type = 'webattack'; }
      case 10 { $type = 'other'; }
      }
    
    my $source_type = "";
    switch (int(rand(3) + 0.5)) {
      case 1 { $source_type = 'IP'; }
      case 2 { $source_type = 'URL'; }
      case 3 { $source_type = 'Reply-To:'; }
      }
    
    my $source = (int(rand(254) + 0.5) + 1) . "." . (int(rand(254) + 0.5) + 1) . "." . (int(rand(254) + 0.5) + 1) . "." . (int(rand(254) + 0.5) + 1);
    
    my $target_proto = "";
    switch (int(rand(2) + 0.5)) {
      case 1 { $target_proto = 'TCP'; }
      case 2 { $target_proto = 'UDP'; }
      }
    
    my $target_port = "";
    switch (int(rand(6) + 0.5)) {
      case 1 { $target_port = '22'; }
      case 2 { $target_port = '23'; }
      case 3 { $target_port = '25'; }
      case 4 { $target_port = '443'; }
      case 5 { $target_port = '3389'; }
      case 6 { $target_port = 'null'; }
      }
    
    my $attack_scale = (int(rand(100000) + 0.5) + 1000);
    
    my $note = "This is simple note only.";
    
    my $priority = undef;
    
    my $timeout = undef;
    
    my @event = (
      $service,