| 1 | | #!perl -w -Ilib |
|---|
| 2 | | |
|---|
| 3 | | # $Id$ |
|---|
| | 1 | #!perl -Ilib |
|---|
| | 2 | ####################################################################### |
|---|
| | 3 | # Created on: Apr 08, 2008 |
|---|
| | 4 | # File: StartManager.pl |
|---|
| | 5 | # Description: Start up script for manager-based operations. |
|---|
| | 6 | # |
|---|
| | 7 | # CVS: $Id$ |
|---|
| | 8 | # |
|---|
| | 9 | # @author knwang, kindlund |
|---|
| | 10 | # |
|---|
| | 11 | # Copyright (C) 2007-2008 The MITRE Corporation. All rights reserved. |
|---|
| | 12 | # |
|---|
| | 13 | # This program is free software; you can redistribute it and/or |
|---|
| | 14 | # modify it under the terms of the GNU General Public License |
|---|
| | 15 | # as published by the Free Software Foundation, using version 2 |
|---|
| | 16 | # of the License. |
|---|
| | 17 | # |
|---|
| | 18 | # This program is distributed in the hope that it will be useful, |
|---|
| | 19 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| | 20 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| | 21 | # GNU General Public License for more details. |
|---|
| | 22 | # |
|---|
| | 23 | # You should have received a copy of the GNU General Public License |
|---|
| | 24 | # along with this program; if not, write to the Free Software |
|---|
| | 25 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|---|
| | 26 | # 02110-1301, USA. |
|---|
| | 27 | # |
|---|
| | 28 | ####################################################################### |
|---|
| | 29 | |
|---|
| | 30 | BEGIN { |
|---|
| | 31 | our $VERSION = 1.02; |
|---|
| | 32 | } |
|---|
| | 33 | our ($VERSION); |
|---|
| | 34 | |
|---|
| | 35 | =pod |
|---|
| | 36 | |
|---|
| | 37 | =head1 NAME |
|---|
| | 38 | |
|---|
| | 39 | StartManager.pl - Perl script to start the Manager on the |
|---|
| | 40 | host system. |
|---|
| | 41 | |
|---|
| | 42 | =head1 SYNOPSIS |
|---|
| | 43 | |
|---|
| | 44 | StartManager.pl [options] [http://www.google.com http://www.cnn.com ...] |
|---|
| | 45 | |
|---|
| | 46 | Options: |
|---|
| | 47 | --help This help message. |
|---|
| | 48 | --man Print full man page. |
|---|
| | 49 | --driver_name= Name of driver to use. |
|---|
| | 50 | --master_vm_config= Absolute path to the master VM configuration to use. |
|---|
| | 51 | --url_list= File containing newline separated URLs to use. |
|---|
| | 52 | |
|---|
| | 53 | =head1 OPTIONS |
|---|
| | 54 | |
|---|
| | 55 | =over 4 |
|---|
| | 56 | |
|---|
| | 57 | =item B<--help> |
|---|
| | 58 | |
|---|
| | 59 | Print a brief help message and exits. |
|---|
| | 60 | |
|---|
| | 61 | =item B<--driver_name=> |
|---|
| | 62 | |
|---|
| | 63 | Specifies the driver name to use. If none is specified, the |
|---|
| | 64 | default will be used. |
|---|
| | 65 | |
|---|
| | 66 | =item B<--master_vm_config=> |
|---|
| | 67 | |
|---|
| | 68 | Specifies the master VM configuration file to use. If none |
|---|
| | 69 | is specified, the default will be used. |
|---|
| | 70 | |
|---|
| | 71 | =item B<--url_list=> |
|---|
| | 72 | |
|---|
| | 73 | If specified, the newline separated URLs inside this file will |
|---|
| | 74 | be parsed and fed into the Manager upon startup. |
|---|
| | 75 | |
|---|
| | 76 | =back |
|---|
| | 77 | |
|---|
| | 78 | =head1 DESCRIPTION |
|---|
| | 79 | |
|---|
| | 80 | This program starts the Manager on the host system. If URLs |
|---|
| | 81 | are specified on the command-line, the program will |
|---|
| | 82 | assign a base priority to each URL and feed them into the Manager |
|---|
| | 83 | for additional processing. |
|---|
| | 84 | |
|---|
| | 85 | This program will run until manually terminated by the user, by |
|---|
| | 86 | pressing CTRL-C. |
|---|
| | 87 | |
|---|
| | 88 | =head1 SEE ALSO |
|---|
| | 89 | |
|---|
| | 90 | L<http://www.honeyclient.org/trac> |
|---|
| | 91 | |
|---|
| | 92 | =head1 REPORTING BUGS |
|---|
| | 93 | |
|---|
| | 94 | L<http://www.honeyclient.org/trac/newticket> |
|---|
| | 95 | |
|---|
| | 96 | =head1 AUTHORS |
|---|
| | 97 | |
|---|
| | 98 | Darien Kindlund, E<lt>kindlund@mitre.orgE<gt> |
|---|
| | 99 | |
|---|
| | 100 | Kathy Wang, E<lt>knwang@mitre.orgE<gt> |
|---|
| | 101 | |
|---|
| | 102 | =head1 COPYRIGHT & LICENSE |
|---|
| | 103 | |
|---|
| | 104 | Copyright (C) 2007-2008 The MITRE Corporation. All rights reserved. |
|---|
| | 105 | |
|---|
| | 106 | This program is free software; you can redistribute it and/or |
|---|
| | 107 | modify it under the terms of the GNU General Public License |
|---|
| | 108 | as published by the Free Software Foundation, using version 2 |
|---|
| | 109 | of the License. |
|---|
| | 110 | |
|---|
| | 111 | This program is distributed in the hope that it will be useful, |
|---|
| | 112 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| | 113 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| | 114 | GNU General Public License for more details. |
|---|
| | 115 | |
|---|
| | 116 | You should have received a copy of the GNU General Public License |
|---|
| | 117 | along with this program; if not, write to the Free Software |
|---|
| | 118 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|---|
| | 119 | 02110-1301, USA. |
|---|
| | 120 | |
|---|
| | 121 | =cut |
|---|
| 36 | | # Change to 'HoneyClient::Agent::Driver::Browser::IE' or |
|---|
| 37 | | # 'HoneyClient::Agent::Driver::Browser::FF' |
|---|
| 38 | | my $driver = undef; |
|---|
| 39 | | my $config = undef; |
|---|
| 40 | | my $maxrel = undef; |
|---|
| 41 | | my $nexturl = ""; |
|---|
| 42 | | my $urllist= ""; |
|---|
| 43 | | |
|---|
| 44 | | # TODO: Need --help option, along with sanity checking. |
|---|
| 45 | | # TODO: Also need a decent POD for this code. |
|---|
| 46 | | GetOptions('driver=s' => \$driver, |
|---|
| 47 | | 'master_vm_config=s' => \$config, |
|---|
| 48 | | 'url_list=s' => \$urllist, |
|---|
| 49 | | 'max_relative_links:i' => \$maxrel); |
|---|
| 50 | | |
|---|
| 51 | | # Sanity Check. Make sure $driver is set. |
|---|
| 52 | | unless (defined($driver)) { |
|---|
| 53 | | $driver = getVar(name => "default_driver", |
|---|
| 54 | | namespace => "HoneyClient::Agent"); |
|---|
| 55 | | } |
|---|
| 56 | | |
|---|
| 57 | | # Sanity Check. Make sure $max_relative_links is set. |
|---|
| 58 | | unless (defined($maxrel)) { |
|---|
| 59 | | $maxrel = getVar(name => "max_relative_links_to_visit", |
|---|
| 60 | | namespace => "HoneyClient::Agent::Driver::Browser"); |
|---|
| 61 | | } |
|---|
| | 155 | # Inputs. |
|---|
| | 156 | my $driver_name = undef; |
|---|
| | 157 | my $master_vm_config = undef; |
|---|
| | 158 | my $url_list= ""; |
|---|
| | 159 | |
|---|
| | 160 | GetOptions('driver_name=s' => \$driver_name, |
|---|
| | 161 | 'master_vm_config=s' => \$master_vm_config, |
|---|
| | 162 | 'url_list=s' => \$url_list, |
|---|
| | 163 | 'man' => sub { pod2usage(-exitstatus => 0, -verbose => 2) }, |
|---|
| | 164 | 'version' => sub { |
|---|
| | 165 | print "MITRE HoneyClient Project (http://www.honeyclient.org)\n" . |
|---|
| | 166 | "------------------------------------------------------\n" . |
|---|
| | 167 | $0 . " (v" . $VERSION . ")\n"; |
|---|
| | 168 | exit(0); |
|---|
| | 169 | }) or pod2usage(2); |
|---|