metasploit-framework/lib/lab
Jonathan Cran b04623616f typo, thanks kernelsmith
git-svn-id: file:///home/svn/framework3/trunk@12870 4d416f70-5f16-0410-b530-b9f4589650da
2011-06-06 19:29:15 +00:00
..
README fixup the output, better autonaming of vms when build_from_running or build_from_dir is used 2011-05-31 15:51:22 +00:00
TODO lots of fun changes to the lab plugin. added a basic TODO / README, added run_command support to remote_workstation, added support for dynagen (though it needs more testing), added a vixr controller and driver but the lack of snapshots is a little sad. see the README for more info on how to use it 2011-05-24 15:56:32 +00:00
dynagen_controller.rb lots of fun changes to the lab plugin. added a basic TODO / README, added run_command support to remote_workstation, added support for dynagen (though it needs more testing), added a vixr controller and driver but the lack of snapshots is a little sad. see the README for more info on how to use it 2011-05-24 15:56:32 +00:00
dynagen_driver.rb lots of fun changes to the lab plugin. added a basic TODO / README, added run_command support to remote_workstation, added support for dynagen (though it needs more testing), added a vixr controller and driver but the lack of snapshots is a little sad. see the README for more info on how to use it 2011-05-24 15:56:32 +00:00
remote_workstation_controller.rb fixup the output, better autonaming of vms when build_from_running or build_from_dir is used 2011-05-31 15:51:22 +00:00
remote_workstation_driver.rb handle a couple of error cases, improve the way commands run on multiple vms 2011-06-05 06:57:24 +00:00
virtualbox_controller.rb patch by Hauke of the Fidus Project to fixup my bugs in the virtualbox controller :) -- thanks! 2011-02-18 17:03:19 +00:00
virtualbox_driver.rb handle blank usernames / passwords 2011-06-04 03:11:49 +00:00
vm.rb switch the workstation driver's run_command to write a script on the vm, like remote_workstation 2011-06-04 05:57:09 +00:00
vm_controller.rb fixup the output, better autonaming of vms when build_from_running or build_from_dir is used 2011-05-31 15:51:22 +00:00
vm_driver.rb handle a couple of error cases, improve the way commands run on multiple vms 2011-06-05 06:57:24 +00:00
workstation_controller.rb lots of fun changes to the lab plugin. added a basic TODO / README, added run_command support to remote_workstation, added support for dynagen (though it needs more testing), added a vixr controller and driver but the lack of snapshots is a little sad. see the README for more info on how to use it 2011-05-24 15:56:32 +00:00
workstation_driver.rb switch the workstation driver's run_command to write a script on the vm, like remote_workstation 2011-06-04 05:57:09 +00:00
workstation_vixr_controller.rb lots of fun changes to the lab plugin. added a basic TODO / README, added run_command support to remote_workstation, added support for dynagen (though it needs more testing), added a vixr controller and driver but the lack of snapshots is a little sad. see the README for more info on how to use it 2011-05-24 15:56:32 +00:00
workstation_vixr_driver.rb typo, thanks kernelsmith 2011-06-06 19:29:15 +00:00

README

This folder contains the libraries necessary to run the lab plugin, and can also be used in a standalone way to automate virtual machines.

Currently you will need to have this code running on a linux box, and your VMHost will likely need to be linux as well. If you're interested in porting it to windows, please contact jcran@metasploit.com. 

#########
CONCEPTS:
#########


Drivers: Drivers implement the underlying command for each vm (such as start/stop/revert)

Controllers: Controllers implement the commands which apply to all vms (such as listing all running vms)

Currently Supported:
	workstation (wraps vmrun command)
	workstation_vixr (uses the vixr gem from rhythmx)
	remote_workstation (wraps vmrun command on a remote host)
	virtualbox
	dynagen (underlying vm for GNS3 - cisco hardware)
Planned:
	qemu
	qemudo
	amazon
	others?

DEPENDENCIES:
  - whatever vm software is necessary for the driver you're using
  - net/ssh - the gem (net-ssh), not the msf library. Required to perform ssh_exec in the case tools are not installed on the device. Not necessary if tools are installed.
  - net/scp - the gem (net-scp). Required to copy files to/from the devices in the case that tools are not installed. Not necessary if tools are installed. 
  - vixr - required to use the workstation_vixr driver
  - fog - required to use the fog_amazon driver

###########
LAB PLUGIN:
###########

BACKGROUND:
  The lab plugin adds a number of commands which may be useful if you're interested in automating remote hosts with rc scripts. If you are testing an IPS / IDS, or determing if an exploit was successful, you'll need to have targets which can be easily started / reverted. The lab plugin provides those commands. 

USAGE:
  msf> load lab
  msf> lab_help
  msf> lab_load <path_to_lab_file> // see data/lab/test_targets.yml for an example
  msf> lab_start vm1
  msf> lab_snapshot vm1 emosheep  
  // do some stuff
  msf> lab_revert vm1 emosheep
  msf> lab_stop  vm1

###########
STANDALONE:
###########

BACKGROUND:
  The lab libraries add tons of useful functionality that isn't exposed through the lab plugin, such as the ability to run commands on hosts. This library can serve as an excellent base for more complex operations on a remote host as well. 

USAGE:
  You must first create a yaml file which describes your vm. See data/lab/test_targets.yml for an example.  

  require 'vm_controller'
  vm_controller = ::Lab::Controllers::VmController.new(YAML.load_file(lab_def)) 
  vm_controller['vm1'].start
  vm_controller['vm1'].snapshot("clean") 
  vm_controller['vm1'].run_command("rm /etc/resolv.conf")
  vm_controller['vm1'].open_uri("http://autopwn:8080")
  vm_controller['vm1'].revert("clean")