Skip to content
Snippets Groups Projects
Commit a4a37951 authored by Tomáš Plesník's avatar Tomáš Plesník
Browse files

pwd zjistovana pomoci modulu FindBin; smazany zakomentovane casti kodu;...

pwd zjistovana pomoci modulu FindBin; smazany zakomentovane casti kodu; timeout a priority nastaveny na undef
parent dacda6b4
No related branches found
No related tags found
No related merge requests found
...@@ -9,20 +9,13 @@ use warnings; ...@@ -9,20 +9,13 @@ use warnings;
use Switch; use Switch;
use DateTime; use DateTime;
use File::Basename; use FindBin qw($RealBin);
FindBin::again();
my $bin = File::Basename::dirname(__FILE__); use lib "$RealBin/../lib";
use lib "$bin/../lib";
use WardenClient; use WardenClient;
my $service = "test"; my $service = "test";
# service is needed in authorization process of the client,
# therefore it can not be set randomly
#switch (int(rand(3) + 0.5)) {
# case 1 { $service = 'ScanDetector'; }
# case 2 { $service = 'PhiGaro'; }
# case 3 { $service = 'HoneyScan'; }
# }
my $detected = DateTime->from_epoch(epoch => time()); my $detected = DateTime->from_epoch(epoch => time());
...@@ -39,7 +32,7 @@ switch (int(rand(10) + 0.5)) { ...@@ -39,7 +32,7 @@ switch (int(rand(10) + 0.5)) {
case 9 { $type = 'webattack'; } case 9 { $type = 'webattack'; }
case 10 { $type = 'other'; } case 10 { $type = 'other'; }
} }
my $source_type = ""; my $source_type = "";
switch (int(rand(3) + 0.5)) { switch (int(rand(3) + 0.5)) {
case 1 { $source_type = 'IP'; } case 1 { $source_type = 'IP'; }
...@@ -67,31 +60,26 @@ switch (int(rand(6) + 0.5)) { ...@@ -67,31 +60,26 @@ switch (int(rand(6) + 0.5)) {
my $attack_scale = (int(rand(100000) + 0.5) + 1000); my $attack_scale = (int(rand(100000) + 0.5) + 1000);
my $note = "tohle je takova normalni jednoducha poznamka"; my $note = "This is simple note only.";
my $priority = undef;
my $priority = int(rand(255) + 0.5); my $timeout = undef;
my $timeout = int(rand(255) + 0.5);
my @event = ( my @event = (
$service, # $service $service,
"$detected", # $detected $detected,
$type, # $type $type,
$source_type, # $source_type $source_type,
$source, # $source $source,
$target_proto, # $target_proto $target_proto,
$target_port, # $target_port $target_port,
$attack_scale, # $attack_scale $attack_scale,
$note, # $note $note,
$priority, # $priority $priority,
$timeout, # $timeout $timeout,
); );
WardenClient::saveNewEvent(\@event); WardenClient::saveNewEvent(\@event);
#foreach (@event) {
# print "$_\n";
#}
exit 0; exit 0;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment