Sha256: 3299e9bc3e0d47cc0f995bffd4cfee3087d232c0ba8afac5017da7e6bb608c05
Contents?: true
Size: 1.29 KB
Versions: 18
Compression:
Stored size: 1.29 KB
Contents
module CMSScanner class Target < WebSite module Platform # Some PHP specific implementation module PHP DEBUG_LOG_PATTERN = /\[[^\]]+\] PHP (?:Warning|Error|Notice):/ FPD_PATTERN = /Fatal error:.+? in (.+?) on/ # @param [ String ] path # @param [ Hash ] params The request params # # @return [ Boolean ] true if url(path) is a debug log, false otherwise def debug_log?(path = nil, params = {}) res = NS::Browser.get(url(path), params.merge(headers: { 'range' => 'bytes=0-700' })) res.body =~ DEBUG_LOG_PATTERN ? true : false end # @param [ String ] path # @param [ Hash ] params The request params # # @return [ Boolean ] true if url(path) contains a FPD, false otherwise def full_path_disclosure?(path = nil, params = {}) !full_path_disclosure_entries(path, params).empty? end # @param [ String ] path # @param [ Hash ] params The request params # # @return [ Array<String> ] The FPD found, or an empty array if none def full_path_disclosure_entries(path = nil, params = {}) res = NS::Browser.get(url(path), params) res.body.scan(FPD_PATTERN).flatten end end end end end
Version data entries
18 entries across 18 versions & 1 rubygems