File tree Expand file tree Collapse file tree
modules/exploits/multi/http Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -163,6 +163,16 @@ def check
163163 return Exploit ::CheckCode ::Unknown ( "Target responded with unexpected HTTP status #{ res . code } " )
164164 end
165165
166+ correct_message = res . message == 'OK'
167+ header_url_regex = %r{^\d ,\d , <http://apache.org/dav/propset/fs/\d >$}
168+ correct_header = res . headers [ 'DAV' ] . match? ( header_url_regex )
169+
170+ unless correct_message && correct_header
171+ print_error "Target responded with an unknown message: '#{ res . message } ', should be 'OK'" unless correct_message
172+ print_error "Target responded with an unknown DAV header: '#{ res . headers [ 'DAV' ] } ', should be '#{ header_url_regex } '" unless correct_header
173+ return Exploit ::CheckCode ::Unknown ( 'Target responded with unexpected message and/or header' )
174+ end
175+
166176 # Record results!
167177 opts , service = report_webdav_service ( res , res_creds )
168178
You can’t perform that action at this time.
0 commit comments