Clean up a little CMDStager methods
parent
8db7ec683f
commit
37d0dd59e8
|
@ -132,10 +132,17 @@ module Exploit::CmdStager
|
||||||
print_status("Command Stager progress - %7s done (%d/%d bytes)" % [percent, sent, total])
|
print_status("Command Stager progress - %7s done (%d/%d bytes)" % [percent, sent, total])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
#
|
||||||
|
# Create an instance of the flavored stager
|
||||||
|
#
|
||||||
def create_stager
|
def create_stager
|
||||||
STAGERS[flavor].new(exe)
|
STAGERS[flavor].new(exe)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
#
|
||||||
|
# Guess the default decoder stub if there is one defined for
|
||||||
|
# the flavor
|
||||||
|
#
|
||||||
def guess_decoder
|
def guess_decoder
|
||||||
return nil unless STUBS.key?(flavor)
|
return nil unless STUBS.key?(flavor)
|
||||||
|
|
||||||
|
@ -185,21 +192,20 @@ module Exploit::CmdStager
|
||||||
end
|
end
|
||||||
|
|
||||||
def guess_flavor
|
def guess_flavor
|
||||||
c_platform = nil
|
return nil unless target_platform.names.length == 1
|
||||||
if target_platform.names.length == 1
|
c_platform = target_platform.names.first
|
||||||
c_platform = target_platform.names.first
|
|
||||||
end
|
|
||||||
case c_platform
|
case c_platform
|
||||||
when 'linux', 'Linux'
|
when /linux/i
|
||||||
return :bourne
|
:bourne
|
||||||
when 'osx', 'OSX'
|
when /osx/i
|
||||||
return :bourne
|
:bourne
|
||||||
when 'unix', 'Unix'
|
when /unix/i
|
||||||
return :bourne
|
:bourne
|
||||||
when 'win', 'Windows'
|
when /win/i
|
||||||
return :vbs
|
:vbs
|
||||||
|
else
|
||||||
|
nil
|
||||||
end
|
end
|
||||||
return nil
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def target_flavor
|
def target_flavor
|
||||||
|
@ -212,7 +218,6 @@ module Exploit::CmdStager
|
||||||
target_flavor.nil? || target_flavor == flavor || target_flavor.include?(flavor)
|
target_flavor.nil? || target_flavor == flavor || target_flavor.include?(flavor)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Methods to override - not used internally
|
# Methods to override - not used internally
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in New Issue