Skip to content

Commit 1368c1c

Browse files
committed
Move options to lib
1 parent 8590720 commit 1368c1c

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

lib/msf/core/exploit/powershell.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ module Exploit::Powershell
66

77
def initialize(info = {})
88
super
9-
register_advanced_options(
9+
register_options(
1010
[
11+
OptBool.new('PERSIST', [true, 'Run the payload in a loop', false]),
12+
OptBool.new('PSH_OLD_METHOD', [true, 'Use powershell 1.0', false]),
1113
OptBool.new('RUN_WOW64', [
12-
false,
14+
true,
1315
'Execute powershell in 32bit compatibility mode, payloads need native arch',
1416
false
1517
]),
@@ -129,7 +131,7 @@ def run_hidden_psh(ps_code,ps_bin='powershell.exe')
129131
#
130132
# Creates cmd script to execute psh payload
131133
#
132-
def cmd_psh_payload(pay, old_psh=false)
134+
def cmd_psh_payload(pay, old_psh=datastore['PSH_OLD_METHOD'])
133135
# Allow powershell 1.0 format
134136
if old_psh
135137
psh_payload = Msf::Util::EXE.to_win32pe_psh(framework, pay)

modules/exploits/windows/smb/psexec_psh.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,6 @@ def initialize(info = {})
6868
[ 'URL', 'http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx' ]
6969
]
7070
))
71-
72-
register_options([
73-
OptBool.new('PERSIST', [false, 'Run the payload in a loop']),
74-
OptBool.new('PSH_OLD_METHOD', [false, 'Use powershell 1.0', false]),
75-
], self.class)
7671
end
7772

7873

0 commit comments

Comments
 (0)