Compatible encoder list from Diaul

git-svn-id: file:///home/svn/framework3/trunk@4235 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
HD Moore 2006-12-28 15:47:00 +00:00
parent 214eb2a019
commit 43df6869b2
2 changed files with 33 additions and 3 deletions

View File

@ -673,6 +673,24 @@ class Exploit < Msf::Module
return payloads;
end
#
# Returns a list of compatible encoders based on architecture
#
def compatible_encoders
encoders = []
c_platform = (target and target.platform) ? target.platform : platform
c_arch = (target and target.arch) ? target.arch : (arch == []) ? nil : arch
framework.encoders.each_module(
'Arch' => c_arch) { |name, mod|
encoders << [ name, mod ]
}
return encoders;
end
#
# This method returns the number of bytes that should be adjusted to the
# stack pointer prior to executing any code. The number of bytes to adjust

View File

@ -1274,8 +1274,20 @@ protected
#
def show_encoders # :nodoc:
# If an active module has been selected and it's an exploit, get the
# list of compatible encoders and display them
if (active_module and active_module.exploit? == true)
tbl = generate_module_table("Compatible encoders")
active_module.compatible_encoders.each { |refname, encoder|
tbl << [ refname, encoder.new.name ]
}
print(tbl.to_s)
else
show_module_set("Encoders", framework.encoders)
end
end
def show_nops # :nodoc:
show_module_set("NOP Generators", framework.nops)