From 889c5f1a7b0b3ac20ed63985f2584e9cd89cb983 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20K=C3=A1cha?= <ph@cesnet.cz> Date: Thu, 28 Nov 2013 11:27:03 +0100 Subject: [PATCH] Removed bin, not propagated into package anyway and user should adapt and use doc/example* code --- src/warden-client/bin/receiver.pl | 30 ---------- src/warden-client/bin/sender.pl | 98 ------------------------------- 2 files changed, 128 deletions(-) delete mode 100755 src/warden-client/bin/receiver.pl delete mode 100755 src/warden-client/bin/sender.pl diff --git a/src/warden-client/bin/receiver.pl b/src/warden-client/bin/receiver.pl deleted file mode 100755 index b303178..0000000 --- a/src/warden-client/bin/receiver.pl +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/perl -w -# -# receiver.pl -# -# Copyright (C) 2011-2012 Cesnet z.s.p.o -# -# Use of this source is governed by a BSD-style license, see LICENSE file. - -use strict; - -my $warden_path = '/opt/warden-client'; -require $warden_path . '/lib/WardenClientReceive.pm'; - -#my $requested_type = "copyright"; -#my $requested_type = "botnet_c_c"; -my $requested_type = "bruteforce"; -my @new_events = WardenClientReceive::getNewEvents($warden_path, $requested_type); - -print "+------------------------------------------------------------------------------------------------------------------------------------------+\n"; -print "| id | hostname | service | detected | type | source_type | source | target_proto | target_port | attack_scale | note | priority | timeout |\n"; -print "+------------------------------------------------------------------------------------------------------------------------------------------+\n"; - -foreach (@new_events) { - print "| " . join(' | ', @$_) . " |" . "\n"; -} -print "+------------------------------------------------------------------------------------------------------------------------------------------+"; -print "\n"; -print "Last events in: " . scalar(localtime(time)) . "\n"; - -exit 0; diff --git a/src/warden-client/bin/sender.pl b/src/warden-client/bin/sender.pl deleted file mode 100755 index 1881617..0000000 --- a/src/warden-client/bin/sender.pl +++ /dev/null @@ -1,98 +0,0 @@ -#!/usr/bin/perl -w -# -# sender.pl -# -# Copyright (C) 2011-2012 Cesnet z.s.p.o -# -# Use of this source is governed by a BSD-style license, see LICENSE file. - -use Switch; -use strict; -use DateTime; - -my $warden_path = '/opt/warden-client'; -require $warden_path . '/lib/WardenClientSend.pm'; - -my $service = ""; -switch (int(rand(2) + 0.5)) { - case 0 { $service = 'ScanDetector'; } - case 1 { $service = 'PhiGaro'; } - case 2 { $service = 'HoneyScan'; } - } - -my $detected = DateTime->from_epoch(epoch => time()); - -my $type = ""; -switch (int(rand(9) + 0.5)) { - case 0 { $type = 'portscan'; } - case 1 { $type = 'bruteforce'; } - case 2 { $type = 'spam'; } - case 3 { $type = 'phishing'; } - case 4 { $type = 'botnet_c_c'; } - case 5 { $type = 'dos'; } - case 6 { $type = 'malware'; } - case 7 { $type = 'copyright'; } - case 8 { $type = 'webattack'; } - case 9 { $type = 'other'; } - } - -my $source_type = ""; -switch (int(rand(2) + 0.5)) { - case 0 { $source_type = 'IP'; } - case 1 { $source_type = 'URL'; } - case 2 { $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(1) + 0.5)) { - case 0 { $target_proto = 'TCP'; } - case 1 { $target_proto = 'UDP'; } - } - -my $target_port = ""; -switch (int(rand(5) + 0.5)) { - case 0 { $target_port = '22'; } - case 1 { $target_port = '23'; } - case 2 { $target_port = '25'; } - case 3 { $target_port = '443'; } - case 4 { $target_port = '3389'; } - case 5 { $target_port = undef; } - } - -my $attack_scale = (int(rand(100000) + 0.5) + 1000); - -my $note = "tohle je takova normalni jednoducha poznamka"; - -my $priority = ""; -switch (int(rand(1) + 0.5)) { - case 0 { $priority = int(rand(255) + 0.5); } - case 1 { $priority = undef; } - } - -my $timeout = ""; -switch (int(rand(1) + 0.5)) { - case 0 { $timeout = int(rand(255) + 0.5); } - case 1 { $timeout = undef; } - } - -my @event = ( - $service, # $service - "$detected", # $detected - $type, # $type - $source_type, # $source_type - $source, # $source - $target_proto, # $target_proto - $target_port, # $target_port - $attack_scale, # $attack_scale - $note, # $note - $priority, # $priority - $timeout, # $timeout - ); - -WardenClientSend::saveNewEvent($warden_path, \@event); - -#foreach (@event) { -# print "$_\n"; -#} -- GitLab