From d4f569dddf74f08bff800468926a252c03ab4bd7 Mon Sep 17 00:00:00 2001 From: Matt Miller Date: Wed, 13 Jul 2005 18:54:41 +0000 Subject: [PATCH] switched to x86 from ia32 git-svn-id: file:///home/svn/incoming/trunk@2745 4d416f70-5f16-0410-b530-b9f4589650da --- lib/msf/core/constants.rb | 4 +- lib/msf/core/module/platform.rb | 52 +++++++++++++++++++ modules/encoders/x86/call4_dword_xor.rb | 4 +- modules/encoders/x86/jmp_call_additive.rb | 4 +- modules/nops/x86/single_byte.rb | 14 ++--- .../singles/linux/x86/shell_reverse_tcp.rb | 4 +- modules/payloads/singles/windows/adduser.rb | 2 +- modules/payloads/singles/windows/exec.rb | 2 +- .../singles/windows/shell_reverse_tcp.rb | 2 +- .../payloads/stagers/windows/reverse_tcp.rb | 2 +- modules/payloads/stages/windows/shell.rb | 2 +- user_interfaces/test.rb | 2 +- 12 files changed, 71 insertions(+), 23 deletions(-) diff --git a/lib/msf/core/constants.rb b/lib/msf/core/constants.rb index 7f1aa40795..172139c1e8 100644 --- a/lib/msf/core/constants.rb +++ b/lib/msf/core/constants.rb @@ -11,13 +11,13 @@ module Msf # Architecture constants # ARCH_ANY = '_any_' -ARCH_IA32 = 'ia32' +ARCH_X86 = 'x86' ARCH_MIPS = 'mips' ARCH_PPC = 'ppc' ARCH_SPARC = 'sparc' ARCH_TYPES = [ - ARCH_IA32, + ARCH_X86, ARCH_MIPS, ARCH_PPC, ARCH_SPARC diff --git a/lib/msf/core/module/platform.rb b/lib/msf/core/module/platform.rb index 155ea8ba3b..d369d90ab8 100644 --- a/lib/msf/core/module/platform.rb +++ b/lib/msf/core/module/platform.rb @@ -173,6 +173,15 @@ class Msf::Module::Platform private_class_method :build_child_platform_abbrev private_class_method :find_portion + ## + # + # Builtin platforms + # + ## + + # + # Windows + # class Windows < Msf::Module::Platform Rank = 100 # Windows 95 @@ -279,36 +288,79 @@ class Msf::Module::Platform end end + # + # Linux + # class Linux < Msf::Module::Platform Rank = 100 Alias = "lnx" end + # + # Solaris + # class Solaris < Msf::Module::Platform Rank = 100 + class V4 + Rank = 100 + Alias = "4" + end + class V5 + Rank = 200 + Alias = "5" + end + class V6 + Rank = 300 + Alias = "6" + end + class V7 + Rank = 400 + Alias = "7" + end + class V8 + Rank = 400 + Alias = "7" + end end + # + # OSX + # class OSX < Msf::Module::Platform Rank = 100 end + # # Generic BSD + # class BSD < Msf::Module::Platform Rank = 100 end + # + # OpenBSD + # class OpenBSD < Msf::Module::Platform Rank = 100 end + # + # BSDi + # class BSDi < Msf::Module::Platform Rank = 100 end + # + # NetBSD + # class NetBSD < Msf::Module::Platform Rank = 100 end + # + # FreeBSD + # class FreeBSD < Msf::Module::Platform Rank = 100 end diff --git a/modules/encoders/x86/call4_dword_xor.rb b/modules/encoders/x86/call4_dword_xor.rb index 62ec8a41ce..90d4d599fa 100644 --- a/modules/encoders/x86/call4_dword_xor.rb +++ b/modules/encoders/x86/call4_dword_xor.rb @@ -2,7 +2,7 @@ require 'msf/core' module Msf module Encoders -module Ia32 +module X86 class Call4Dword < Msf::Encoder::Xor @@ -12,7 +12,7 @@ class Call4Dword < Msf::Encoder::Xor 'Version' => '$Revision$', 'Description' => 'Call+4 Dword XOR Encoder', 'Author' => [ 'hdm', 'spoonm' ], - 'Arch' => ARCH_IA32, + 'Arch' => ARCH_X86, 'Decoder' => { 'KeySize' => 4, diff --git a/modules/encoders/x86/jmp_call_additive.rb b/modules/encoders/x86/jmp_call_additive.rb index ca6e84c011..da19e361aa 100644 --- a/modules/encoders/x86/jmp_call_additive.rb +++ b/modules/encoders/x86/jmp_call_additive.rb @@ -2,7 +2,7 @@ require 'msf/core' module Msf module Encoders -module Ia32 +module X86 class JmpCallAdditive < Msf::Encoder::XorAdditiveFeedback @@ -12,7 +12,7 @@ class JmpCallAdditive < Msf::Encoder::XorAdditiveFeedback 'Version' => '$Revision$', 'Description' => 'Jump/Call XOR Additive Feedback', 'Author' => 'skape', - 'Arch' => ARCH_IA32, + 'Arch' => ARCH_X86, 'Decoder' => { 'Stub' => diff --git a/modules/nops/x86/single_byte.rb b/modules/nops/x86/single_byte.rb index 3d2ab6a298..21536224f5 100644 --- a/modules/nops/x86/single_byte.rb +++ b/modules/nops/x86/single_byte.rb @@ -2,14 +2,14 @@ require 'msf/core' module Msf module Nops -module Ia32 +module X86 ### # # SingleByte # ---------- # -# This class implements single-byte NOP generation for IA32. It takes from +# This class implements single-byte NOP generation for X86. It takes from # ADMmutate and from spoonfu. # ### @@ -85,15 +85,15 @@ SINGLE_BYTE_SLED = 'Version' => '$Revision$', 'Description' => 'Single-byte NOP generator', 'Author' => 'spoonm', - 'Arch' => ARCH_IA32) + 'Arch' => ARCH_X86) register_advanced_options( [ OptBool.new('RandomNops', [ false, "Generate a random NOP sled", true ]) - ], Msf::Nops::Ia32::SingleByte) + ], Msf::Nops::X86::SingleByte) end - # Generate a single-byte NOP sled for IA32 + # Generate a single-byte NOP sled for X86 def generate_sled(length, opts) sled_hash = SINGLE_BYTE_SLED sled_max_idx = sled_hash.length @@ -148,7 +148,3 @@ SINGLE_BYTE_SLED = end end end end - -x = Msf::Nops::Ia32::SingleByte.new - -x.generate_sled(200, {}) diff --git a/modules/payloads/singles/linux/x86/shell_reverse_tcp.rb b/modules/payloads/singles/linux/x86/shell_reverse_tcp.rb index 9cf9d9c962..a4ef5c03db 100644 --- a/modules/payloads/singles/linux/x86/shell_reverse_tcp.rb +++ b/modules/payloads/singles/linux/x86/shell_reverse_tcp.rb @@ -5,7 +5,7 @@ module Msf module Payloads module Singles module Linux -module Ia32 +module X86 module Shell @@ -18,7 +18,7 @@ module Shell 'Description' => 'Connect back to attacker and spawn a command shell', 'Author' => 'skape', 'Platform' => 'linux', - 'Arch' => ARCH_IA32, + 'Arch' => ARCH_X86, 'Handler' => Msf::Handler::ReverseTcp, 'Payload' => { diff --git a/modules/payloads/singles/windows/adduser.rb b/modules/payloads/singles/windows/adduser.rb index 0b9b75dac2..0a43da8f9f 100644 --- a/modules/payloads/singles/windows/adduser.rb +++ b/modules/payloads/singles/windows/adduser.rb @@ -27,7 +27,7 @@ module AddUser 'Description' => 'Create a new user and add them to local administration group', 'Author' => 'hdm', 'Platform' => 'win', - 'Arch' => ARCH_IA32, + 'Arch' => ARCH_X86, 'Privileged' => true)) # Register command execution options diff --git a/modules/payloads/singles/windows/exec.rb b/modules/payloads/singles/windows/exec.rb index 02b81c0dbe..d1e27b5ae6 100644 --- a/modules/payloads/singles/windows/exec.rb +++ b/modules/payloads/singles/windows/exec.rb @@ -25,7 +25,7 @@ module Exec 'Description' => 'Execute an arbitrary command', 'Author' => 'vlad902', 'Platform' => 'win', - 'Arch' => ARCH_IA32, + 'Arch' => ARCH_X86, 'Payload' => { 'Offsets' => diff --git a/modules/payloads/singles/windows/shell_reverse_tcp.rb b/modules/payloads/singles/windows/shell_reverse_tcp.rb index a376b42937..85b69a2d73 100644 --- a/modules/payloads/singles/windows/shell_reverse_tcp.rb +++ b/modules/payloads/singles/windows/shell_reverse_tcp.rb @@ -18,7 +18,7 @@ module Shell 'Description' => 'Connect back to attacker and spawn a command shell', 'Author' => 'vlad902', 'Platform' => 'win', - 'Arch' => ARCH_IA32, + 'Arch' => ARCH_X86, 'Handler' => Msf::Handler::ReverseTcp, 'Payload' => { diff --git a/modules/payloads/stagers/windows/reverse_tcp.rb b/modules/payloads/stagers/windows/reverse_tcp.rb index 50854bb889..12b8b52375 100644 --- a/modules/payloads/stagers/windows/reverse_tcp.rb +++ b/modules/payloads/stagers/windows/reverse_tcp.rb @@ -18,7 +18,7 @@ module ReverseTcp 'Description' => 'Connect back to the attacker', 'Author' => 'hdm', 'Platform' => 'win', - 'Arch' => ARCH_IA32, + 'Arch' => ARCH_X86, 'Handler' => Msf::Handler::ReverseTcp, 'Stager' => { diff --git a/modules/payloads/stages/windows/shell.rb b/modules/payloads/stages/windows/shell.rb index cc97fe5c62..7dc1f7d184 100644 --- a/modules/payloads/stages/windows/shell.rb +++ b/modules/payloads/stages/windows/shell.rb @@ -16,7 +16,7 @@ module Shell 'Description' => 'Spawn a command shell', 'Author' => 'hdm', 'Platform' => 'win', - 'Arch' => ARCH_IA32, + 'Arch' => ARCH_X86, 'Stage' => { 'Offsets' => diff --git a/user_interfaces/test.rb b/user_interfaces/test.rb index 76881fce66..f1e436a93c 100755 --- a/user_interfaces/test.rb +++ b/user_interfaces/test.rb @@ -18,7 +18,7 @@ framework.encoders.each_module { |mod| } framework.encoders.each_module( - 'arch' => Msf::ARCH_IA32) { |mod| + 'arch' => Msf::ARCH_X86) { |mod| puts "arch filter: got encoder #{mod}" }