Merge branch 'master' into feature/task_sssoc/sessions

Conflicts:
	Gemfile
	Gemfile.lock
unstable
David Maloney 2013-06-04 14:11:41 -05:00
commit a40b6a3569
6 changed files with 19 additions and 159 deletions

View File

@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20130522041110) do
ActiveRecord::Schema.define(:version => 20130531144949) do
create_table "api_keys", :force => true do |t|
t.text "token"
@ -46,11 +46,10 @@ ActiveRecord::Schema.define(:version => 20130522041110) do
create_table "clients", :force => true do |t|
t.integer "host_id"
t.datetime "created_at"
t.string "ua_string", :limit => 1024, :null => false
t.string "ua_name", :limit => 64
t.string "ua_ver", :limit => 32
t.string "ua_string", :limit => 1024, :null => false
t.string "ua_name", :limit => 64
t.string "ua_ver", :limit => 32
t.datetime "updated_at"
t.integer "campaign_id"
end
create_table "creds", :force => true do |t|
@ -167,18 +166,11 @@ ActiveRecord::Schema.define(:version => 20130522041110) do
add_index "hosts", ["state"], :name => "index_hosts_on_state"
add_index "hosts", ["workspace_id", "address"], :name => "index_hosts_on_workspace_id_and_address", :unique => true
create_table "hosts_tags", :id => false, :force => true do |t|
create_table "hosts_tags", :force => true do |t|
t.integer "host_id"
t.integer "tag_id"
end
create_table "imported_creds", :force => true do |t|
t.integer "workspace_id", :default => 1, :null => false
t.string "user", :limit => 512
t.string "pass", :limit => 512
t.string "ptype", :limit => 16, :default => "password"
end
create_table "listeners", :force => true do |t|
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false

View File

@ -0,0 +1,14 @@
FactoryGirl.define do
factory :exported_web_vuln, :parent => :mdm_web_vuln do
blame { generate :mdm_web_vuln_blame }
description { generate :mdm_web_vuln_description }
end
sequence :mdm_web_vuln_blame do |n|
"Blame employee ##{n}"
end
sequence :mdm_web_vuln_description do |n|
"Mdm::WebVuln#description #{n}"
end
end

View File

@ -1,34 +0,0 @@
FactoryGirl.define do
factory :mdm_route, :class => Mdm::Route do
netmask { generate :mdm_route_netmask }
subnet { generate :mdm_route_subnet }
#
# Associations
#
association :session, :factory => :mdm_session
end
sequence :mdm_route_netmask do |n|
bits = 32
bitmask = n % bits
[ (~((2 ** (bits - bitmask)) - 1)) & 0xffffffff ].pack('N').unpack('CCCC').join('.')
bits = 32
shift = n % bits
mask_range = 2 ** bits
full_mask = mask_range - 1
integer_netmask = (full_mask << shift)
formatted_netmask = [integer_netmask].pack('N').unpack('CCCC').join('.')
formatted_netmask
end
sequence :mdm_route_subnet do |n|
class_c_network = n % 255
"192.168.#{class_c_network}.0"
end
end

View File

@ -1,34 +0,0 @@
FactoryGirl.define do
factory :mdm_web_form, :class => Mdm::WebForm do
#
# Associations
#
association :web_site, :factory => :mdm_web_site
# attributes that would be in web_form element from Pro export
trait :exported do
method { generate :mdm_web_form_method }
params { generate :mdm_web_form_params }
path { generate :mdm_web_form_path }
end
end
methods = ['GET', 'POST']
sequence :mdm_web_form_method do |n|
methods[n % methods.length]
end
sequence :mdm_web_form_params do |n|
[
[
"name#{n}",
"value#{n}"
]
]
end
sequence :mdm_web_form_path do |n|
"path/to/web/form/#{n}"
end
end

View File

@ -1,64 +0,0 @@
FactoryGirl.define do
factory :mdm_web_page, :class => Mdm::WebPage do
auth { generate :mdm_web_page_auth }
body { generate :mdm_web_page_body }
code { generate :mdm_web_page_code }
cookie { generate :mdm_web_page_cookie }
ctype { generate :mdm_web_page_ctype }
headers { generate :mdm_web_page_headers }
location { generate :mdm_web_page_location }
mtime { generate :mdm_web_page_mtime }
query { generate :mdm_web_page_query }
#
# Associations
#
association :web_site, :factory => :mdm_web_site
end
sequence :mdm_web_page_auth do |n|
"Authorization: #{n}"
end
sequence :mdm_web_page_body do |n|
xml = Builder::XmlMarkup.new(:indent => 2)
xml.html
xml.target!.strip
end
sequence :mdm_web_page_code do |n|
n
end
sequence :mdm_web_page_cookie do |n|
"name#{n}=value#{n}"
end
sequence :mdm_web_page_ctype do |n|
"application/x-#{n}"
end
sequence :mdm_web_page_headers do |n|
[
[
"Header#{n}",
"Value#{n}"
]
]
end
sequence :mdm_web_page_location do |n|
"http://example.com/location/#{n}"
end
sequence :mdm_web_page_mtime do |n|
past = Time.now - n
past.utc.strftime('%a, %d %b %Y %H:%M:%S %Z')
end
sequence :mdm_web_page_query do |n|
"param#{n}=value#{n}"
end
end

View File

@ -1,14 +0,0 @@
FactoryGirl.define do
factory :exported_web_vuln, :parent => :mdm_web_vuln do
blame { generate :mdm_web_vuln_blame }
description { generate :mdm_web_vuln_description }
end
sequence :mdm_web_vuln_blame do |n|
"Blame employee ##{n}"
end
sequence :mdm_web_vuln_description do |n|
"Mdm::WebVuln#description #{n}"
end
end