Changeset 202
- Timestamp:
- 03/06/07 23:52:27 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
honeyclient/branches/exp/flindiakos-multi_urls/bin/StartManager.pl
r131 r202 15 15 use MIME::Base64 qw(encode_base64 decode_base64); 16 16 17 # Include Getoptions parser 18 use Getopt::Long; 19 17 20 use HoneyClient::Manager; 18 21 19 22 # We expect that the user will supply a single argument to this script. 20 23 # Namely, the initial URL that they want the Agent to use. 24 # They can however supply multiple urls which will be processed in order 25 26 my $driver = "IE"; 27 my $config = "/vm/Agent.Master-7/winXPPro.cfg"; 28 my $maxrel = 5; 29 my $nexturl = ""; 30 my $urllist= ""; 31 32 GetOptions( 'driver=s' => \$driver, 33 'config=s' => \$config, 34 'urllist=s' => \$urllist, 35 'maxrel=i' => \$maxrel ); 36 37 # Go through the list of urls to create the array 38 # Anything not associated with an option is a URL 39 # Grab those first and then get the ones from the file specified 40 my @urls; 41 push( @urls, @ARGV ); 42 if( -e $urllist ){ 43 open URL, $urllist; 44 push(@urls, <URL>); 45 } 46 47 # Get the first url from the list 48 # Create an array in the form: url => 1 for links_to_visit 49 # I did it this way to keep the same order 50 chomp @urls; 51 my $firsturl = shift @urls; 52 my @remaining_urls; 53 foreach(@urls){ 54 push(@remaining_urls,($_,1)); 55 } 21 56 22 57 my $agentState = HoneyClient::Manager->run( 23 driver => 'IE', # Change to 'IE' or 'FF'24 master_vm_config => '/vm/Agent.Master-7/winXPPro.cfg',58 driver => $driver, # Change to 'IE' or 'FF' 59 master_vm_config => $config, 25 60 agent_state => encode_base64(nfreeze({ 26 IE=> { # Change to 'IE' or 'FF'27 next_link_to_visit => $ ARGV[0],61 $driver => { # Change to 'IE' or 'FF' 62 next_link_to_visit => $firsturl, 28 63 # Enable this line, if you want to only go to the 29 64 # first 5 links for each domain. 30 max_relative_links_to_visit => 5, 65 max_relative_links_to_visit => $maxrel, 66 links_to_visit => { @remaining_urls } 31 67 }, 32 68 })),
