Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
Warden
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pavel Valach
Warden
Commits
5ead95a9
Commit
5ead95a9
authored
11 years ago
by
Jan Soukal
Browse files
Options
Downloads
Patches
Plain Diff
pridan klient umoznujici odesilani z prikazove radky (#973)
parent
a97b1cdd
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/warden-client/doc/command-line-sender.pl
+82
-0
82 additions, 0 deletions
src/warden-client/doc/command-line-sender.pl
with
82 additions
and
0 deletions
src/warden-client/doc/command-line-sender.pl
0 → 100755
+
82
−
0
View file @
5ead95a9
#!/usr/bin/perl -w
#
# Copyright (C) 2011-2013 Cesnet z.s.p.o
#
# Use of this source is governed by a BSD-style license, see LICENSE file.
use
strict
;
use
DateTime
;
use
Getopt::
Std
;
#-------------------------------------------------------------------------------
# Warden 2.2. Command-line Client, Sender
#
# Command-line warden-client sender. For detailed info how to use particular
# variables and/or values see warden-client/doc/README file.
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# Preparation of event attributes.
# Mandatory attributes
our
$opt_s
;
# service
our
$opt_d
=
""
.
DateTime
->
from_epoch
(
epoch
=>
time
())
.
"";
# time of detection
our
$opt_t
;
# type of detected event
our
$opt_o
;
# event source type
# Optional attributes
our
$opt_v
=
"";
# event source value
our
$opt_p
=
"";
# target protocol
our
$opt_r
=
"";
# target port
our
$opt_a
=
"";
# attack scale
our
$opt_n
=
"";
# note
# Other attributes
our
$opt_w
=
"
../../warden-client
";
# path to warden directory
our
$opt_h
;
# display help
# Check whether mandatory fields are given. Otherwise print help and exit.
if
(
!
getopts
("
s:d:t:o:v:p:r:a:n:w:h
")
||
!
defined
(
$opt_s
)
||
!
defined
(
$opt_t
)
||
!
defined
(
$opt_o
)
||
$opt_h
)
{
print
"
\n
Usage: ./command-line-sender.pl [-s <service>] [-d <timestamp_of_detection>] [-t <type>] [-o <source_type>] [-v <source>] [-p <protocol>] [-r <port>] [-a <attack_scale>] [-n <note>] [-w <warden_directory>] [-h]
\n
";
print
"
\n
Arguments:
\n\n
";
print
"
-s <service> - Name of detection service
\n
";
print
"
-d <timestamp_of_detection> - Timestamp of detection.
Default is current system time (
"
.
DateTime
->
from_epoch
(
epoch
=>
time
())
.
"
)
\n
";
print
"
-t <type> - Type of detected event
\n
";
print
"
-o <source_type> - Type of detected event
\
's source
\n
";
print
"
\n
";
print
"
Optional (but important) arguments:
\n\n
";
print
"
-v <source> - Source of detected event
\n
";
print
"
-p <protocol> - Protocol
\n
";
print
"
-r <port> - Port
\n
";
print
"
-a <attack_scale> - Scale of detected event
\n
";
print
"
-n <note> - Note, comment or other data
\n
";
print
"
-w <warden_directory> - Path to warden-client directory. Default is
\
'../../warden-client
\
'
\n
";
print
"
-h - Print this help
\n
";
print
"
\n
Example: ./command-line-sender.pl -s test -t webattack -o URL -v 123.123.098.098 -p TCP -r 443 -a 100 -n
\"
important notice
\"\n
";
print
"
\n
NOTE: For more information how to use particular values see warden-client/doc/README file.
\n\n
";
exit
0
;
}
my
@event
=
(
$opt_s
,
$opt_d
,
$opt_t
,
$opt_o
,
$opt_v
,
$opt_p
,
$opt_r
,
$opt_a
,
$opt_n
);
#-------------------------------------------------------------------------------
# Use of warden-client sender.
# Path to warden-client folder
my
$warden_path
=
$opt_w
;
# Inclusion of warden-client sender module
require
$warden_path
.
'
/lib/WardenClientSend.pm
';
# Sending event to Warden server
WardenClientSend::
saveNewEvent
(
$warden_path
,
\
@event
);
exit
0
;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment