Permalink
Browse files

Space at EOF cleanup

  • Loading branch information...
egypt committed May 24, 2012
1 parent e885017 commit 5bf973871c3beca4788ec655b8ecd5e64af79e55
@@ -16,7 +16,7 @@ def mime_lookup_by_extension(extension)
end
def mime_yaml_lookup(extension)
- mime_load_extension_map unless @extension_map
+ mime_load_extension_map unless @extension_map
return @extension_map[extension] if @extension_map[extension]
return nil
end
@@ -9,7 +9,7 @@ module Auxiliary::WmapModule
attr_accessor :orderid
attr_accessor :requiredids
-
+
#
# Initializes an instance of a WMAP module
#
@@ -28,20 +28,20 @@ def register_wmap_options(options)
self.requiredids = options['Require']
end
end
-
+
def wmap_enabled
#enabled by default
true
end
-
+
def wmap_getoid
- self.orderid
+ self.orderid
end
-
+
def wmap_setoid(oid)
self.orderid = oid
end
-
+
def wmap_type
#default type
nil
View
@@ -341,7 +341,7 @@ def report_host(opts)
host.state = HostState::Alive if not host.state
host.comm = '' if not host.comm
host.workspace = wspace if not host.workspace
-
+
if host.changed?
msf_import_timestamps(opts,host)
host.save!
@@ -357,7 +357,7 @@ def report_host(opts)
#
# The opts parameter MUST contain the following entries
# +:host+:: -- the host's ip address
- # +:info+:: -- the information hash
+ # +:info+:: -- the information hash
# * 'Computer' -- the host name
# * 'OS' -- the operating system string
# * 'Architecture' -- the hardware architecture
@@ -400,36 +400,36 @@ def update_host_via_sysinfo(opts)
else
host = addr
end
-
+
res = {}
-
+
if info['Computer']
res[:name] = info['Computer']
end
-
+
if info['Architecture']
res[:arch] = info['Architecture'].split(/\s+/).first
end
-
+
if info['OS'] =~ /^Windows\s*([^\(]+)\(([^\)]+)\)/i
res[:os_name] = "Microsoft Windows"
res[:os_flavor] = $1.strip
build = $2.strip
-
+
if build =~ /Service Pack (\d+)/
res[:os_sp] = "SP" + $1
else
res[:os_sp] = "SP0"
end
end
-
+
if info["System Language"]
case info["System Language"]
when /^en_/
res[:os_lang] = "English"
end
end
-
+
# Truncate the info field at the maximum field length
if res[:info]
@@ -440,7 +440,7 @@ def update_host_via_sysinfo(opts)
if res[:name]
res[:name] = res[:name][0,255]
end
-
+
res.each { |k,v|
if (host.attribute_names.include?(k.to_s))
@@ -451,12 +451,12 @@ def update_host_via_sysinfo(opts)
dlog("Unknown attribute for Host: #{k}")
end
}
-
+
# Set default fields if needed
host.state = HostState::Alive if not host.state
host.comm = '' if not host.comm
host.workspace = wspace if not host.workspace
-
+
if host.changed?
host.save!
end
@@ -1082,7 +1082,7 @@ def report_host_tag(opts)
if wspace.kind_of? String
wspace = find_workspace(wspace)
end
-
+
host = nil
report_host(:workspace => wspace, :address => addr)
@@ -1292,13 +1292,13 @@ def report_vuln(opts)
raise ArgumentError.new("Deprecated data column for vuln, use .info instead") if opts[:data]
name = opts[:name] || return
info = opts[:info]
-
+
::ActiveRecord::Base.connection_pool.with_connection {
-
+
wspace = opts.delete(:workspace) || workspace
exploited_at = opts[:exploited_at] || opts["exploited_at"]
rids = nil
-
+
if opts[:refs]
rids = []
opts[:refs].each do |r|
@@ -1308,7 +1308,7 @@ def report_vuln(opts)
rids << find_or_create_ref(:name => r)
end
end
-
+
host = nil
addr = nil
if opts[:host].kind_of? ::Mdm::Host
@@ -1403,7 +1403,7 @@ def find_or_create_ref(opts)
ret[:ref] = ref
}
end
-
+
def get_ref(name)
::ActiveRecord::Base.connection_pool.with_connection {
::Mdm::Ref.find_by_name(name)
@@ -2843,7 +2843,7 @@ def import_spiceworks_csv(args={}, &block)
next unless ip
next if bl.include? ip
-
+
conf = {
:workspace => wspace,
:host => ip,
@@ -2856,7 +2856,7 @@ def import_spiceworks_csv(args={}, &block)
info << "Serial Number: #{serialno}" unless (serialno.blank? or serialno == name)
info << "Location: #{location}" unless location.blank?
conf[:info] = info.join(", ") unless info.empty?
-
+
host = report_host(conf)
report_import_note(wspace, host)
end
@@ -5584,7 +5584,7 @@ def normalize_host(host)
norm_host = nil
if (host.kind_of? String)
-
+
# If it's an IPv4 addr with a port on the end, strip the port
if Rex::Socket.is_ipv4?(host) and host =~ /((\d{1,3}\.){3}\d{1,3}):\d+/
norm_host = $1
@@ -221,7 +221,7 @@ def remove_event_subscriber(array, subscriber) # :nodoc:
end
attr_accessor :general_event_subscribers # :nodoc:
- attr_accessor :custom_event_subscribers # :nodoc:
+ attr_accessor :custom_event_subscribers # :nodoc:
attr_accessor :exploit_event_subscribers # :nodoc:
attr_accessor :session_event_subscribers # :nodoc:
attr_accessor :db_event_subscribers # :nodoc:
@@ -163,7 +163,7 @@ def vim_send_soap_request(soap_data)
return :noresponse unless res
if res.body.include? "NotAuthenticatedFault"
return :expired
- elsif res.body.include? "<faultstring>"
+ elsif res.body.include? "<faultstring>"
@vim_soap_error = res.body.match(/<faultstring>([^\c ]+?)<\/faultstring>/)[1]
return :error
elsif res.code != 200
@@ -251,7 +251,7 @@ def vim_terminate_session(key)
res = vim_send_soap_request(soap_data)
if res.class == Hash
return :success
- else
+ else
return res
end
end
@@ -265,7 +265,7 @@ def vim_get_domains
domains = []
domains << res['RetrievePropertiesResponse']['returnval']['propSet']['val']['string']
return domains.flatten.compact
- else
+ else
return res
end
end
@@ -434,7 +434,7 @@ def vim_get_host_hw(host)
def vim_get_all_host_summary(hw=false)
vim_setup_references
summaries = []
- @hosts.each do |host|
+ @hosts.each do |host|
details = {}
details[host] = vim_get_host_summary(host)
if details and hw
@@ -457,7 +457,7 @@ def vim_get_vm_datastore(vm)
else
return res
end
-
+
datastore_refs.each do |datastore_ref|
soap_data = vim_soap_envelope(vim_soap_retrieve_properties('info', 'Datastore' , datastore_ref))
res = vim_send_soap_request(soap_data)
@@ -587,7 +587,7 @@ def vim_take_screenshot(vm, user, pass)
res = vim_send_soap_request(soap_data)
if res.class == Hash
state = res['RetrievePropertiesResponse']['returnval']['propSet']['val']['state']
- screenshot_file = res['RetrievePropertiesResponse']['returnval']['propSet']['val']['result']
+ screenshot_file = res['RetrievePropertiesResponse']['returnval']['propSet']['val']['result']
else
return res
end
@@ -642,7 +642,7 @@ def vim_get_vms
vim_setup_references
@vmrefs = []
vmlist= []
- @dcs.each do |dc|
+ @dcs.each do |dc|
dc_vm_refs = vim_get_dc_vms(dc['ref'])
next if dc_vm_refs.nil? or dc_vm_refs.empty?
dc_vm_refs.flatten!
@@ -41,28 +41,28 @@ def self.general_handler_type
# Precalculated checkums as fallback
#
URI_CHECKSUM_PRECALC = ["Zjjaq", "pIlfv", "UvoxP", "sqnx9", "zvoVO", "Pajqy", "7ziuw", "vecYp", "yfHsn", "YLzzp", "cEzvr", "abmri", "9tvwr", "vTarp", "ocrgc", "mZcyl", "xfcje", "nihqa", "40F17", "zzTWt", "E3192", "wygVh", "pbqij", "rxdVs", "ajtsf", "wvuOh", "hwRwr", "pUots", "rvzoK", "vUwby", "tLzyk", "zxbuV", "niaoy", "ukxtU", "vznoU", "zuxyC", "ymvag", "Jxtxw", "404KC", "DE563", "0A7G9", "yorYv", "zzuqP", "czhwo", "949N8", "a1560", "5A2S3", "Q652A", "KR201", "uixtg", "U0K02", "4EO56", "H88H4", "5M8E6", "zudkx", "ywlsh", "luqmy", "09S4I", "L0GG0", "V916E", "KFI11", "A4BN8", "C3E2Q", "UN804", "E75HG", "622eB", "1OZ71", "kynyx", "0RE7F", "F8CR2", "1Q2EM", "txzjw", "5KD1S", "GLR40", "11BbD", "MR8B2", "X4V55", "W994P", "13d2T", "6J4AZ", "HD2EM", "766bL", "8S4MF", "MBX39", "UJI57", "eIA51", "9CZN2", "WH6AA", "a6BF9", "8B1Gg", "J2N6Z", "144Kw", "7E37v", "9I7RR", "PE6MF", "K0c4M", "LR3IF", "38p3S", "39ab3", "O0dO1", "k8H8A", "0Fz3B", "o1PE1", "h7OI0", "C1COb", "bMC6A", "8fU4C", "3IMSO", "8DbFH", "2YfG5", "bEQ1E", "MU6NI", "UCENE", "WBc0E", "T1ATX", "tBL0A", "UGPV2", "j3CLI", "7FXp1", "yN07I", "YE6k9", "KTMHE", "a7VBJ", "0Uq3R", "70Ebn", "H2PqB", "83edJ", "0w5q2", "72djI", "wA5CQ", "KF0Ix", "i7AZH", "M9tU5", "Hs3RE", "F9m1i", "7ecBF", "zS31W", "lUe21", "IvCS5", "j97nC", "CNtR5", "1g8gV", "7KwNG", "DB7hj", "ORFr7", "GCnUD", "K58jp", "5lKo8", "GPIdP", "oMIFJ", "2xYb1", "LQQPY", "FGQlN", "l5COf", "dA3Tn", "v9RWC", "VuAGI", "3vIr9", "aO3zA", "CIfx5", "Gk6Uc", "pxL94", "rKYJB", "TXAFp", "XEOGq", "aBOiJ", "qp6EJ", "YGbq4", "dR8Rh", "g0SVi", "iMr6L", "HMaIl", "yOY1Z", "UXr5Y", "PJdz6", "OQdt7", "EmZ1s", "aLIVe", "cIeo2", "mTTNP", "eVKy5", "hf5Co", "gFHzG", "VhTWN", "DvAWf", "RgFJp", "MoaXE", "Mrq4W", "hRQAp", "hAzYA", "oOSWV", "UKMme", "oP0Zw", "Mxd6b", "RsRCh", "dlk7Q", "YU6zf", "VPDjq", "ygERO", "dZZcL", "dq5qM", "LITku", "AZIxn", "bVwPL", "jGvZK", "XayKP", "rTYVY", "Vo2ph", "dwJYR", "rLTlS", "BmsfJ", "Dyv1o", "j9Hvs", "w0wVa", "iDnBy", "uKEgk", "uosI8", "2yjuO", "HiOue", "qYi4t", "7nalj", "ENekz", "rxca0", "rrePF", "cXmtD", "Xlr2y", "S7uxk", "wJqaP", "KmYyZ", "cPryG", "kYcwH", "FtDut", "xm1em", "IaymY", "fr6ew", "ixDSs", "YigPs", "PqwBs", "y2rkf", "vwaTM", "aq7wp", "fzc4z", "AyzmQ", "epJbr", "culLd", "CVtnz", "tPjPx", "nfry8", "Nkpif", "8kuzg", "zXvz8", "oVQly", "1vpnw", "jqaYh", "2tztj", "4tslx"]
-
+
#
# Map "random" URIs to static strings, allowing us to randomize
# the URI sent in the first request.
- #
+ #
def process_uri_resource(uri_match)
# This allows 'random' strings to be used as markers for
# the INIT and CONN request types, based on a checksum
uri_strip, uri_conn = uri_match.split('_', 2)
uri_strip.sub!(/^\//, '')
uri_check = Rex::Text.checksum8(uri_strip)
-
+
# Match specific checksums and map them to static URIs
case uri_check
when URI_CHECKSUM_INITW
- uri_match = "/INITM"
+ uri_match = "/INITM"
when URI_CHECKSUM_INITJ
uri_match = "/INITJM"
when URI_CHECKSUM_CONN
uri_match = "/CONN_" + ( uri_conn || Rex::Text.rand_text_alphanumeric(16) )
- end
-
+ end
+
uri_match
end
@@ -71,17 +71,17 @@ def process_uri_resource(uri_match)
#
def generate_uri_checksum(sum)
chk = ("a".."z").to_a + ("A".."Z").to_a + ("0".."9").to_a
- 32.times do
+ 32.times do
uri = Rex::Text.rand_text_alphanumeric(3)
chk.sort_by {rand}.each do |x|
return(uri + x) if Rex::Text.checksum8(uri + x) == sum
end
end
# Otherwise return one of the pre-calculated strings
- return URI_CHECKSUM_PRECALC[sum]
+ return URI_CHECKSUM_PRECALC[sum]
end
-
+
#
# Initializes the HTTP SSL tunneling handler.
#
@@ -108,7 +108,7 @@ def initialize(info = {})
def ipv6
self.refname.index('ipv6') ? true : false
end
-
+
#
# Create a HTTP listener
#
@@ -190,11 +190,11 @@ def on_request(cli, req, obj)
if lhost.empty? or lhost == '0.0.0.0'
lhost = Rex::Socket.source_address(cli.peerhost)
end
-
+
lhost = "[#{lhost}]" if Rex::Socket.is_ipv6?(lhost)
-
+
uri_match = process_uri_resource(req.relative_resource)
-
+
# Process the requested resource.
case uri_match
when /^\/INITJM/
Oops, something went wrong.

0 comments on commit 5bf9738

Please sign in to comment.