Sha256: fde2bd6db7097fbb689bced560704a88bbc024819730210995dd7eecf047b083
Contents?: true
Size: 1.4 KB
Versions: 5
Compression:
Stored size: 1.4 KB
Contents
module CMSScanner class Target < WebSite module Server # Some IIS specific implementation module IIS # @param [ String ] path # @param [ Hash ] params The request params # # @return [ Symbol ] :iis def server(_path = nil, _params = {}) :IIS end # @param [ String ] path # @param [ Hash ] params The request params # # @return [ Boolean ] true if url(path) has the directory # listing enabled, false otherwise def directory_listing?(path = nil, params = {}) res = NS::Browser.get(url(path), params) res.code == 200 && res.body =~ /<H1>#{uri.host} - \// ? true : false end # @param [ String ] path # @param [ Hash ] params The request params # # @return [ Array<String> ] The first level of directories/files listed, # or an empty array if none def directory_listing_entries(path = nil, params = {}) return [] unless directory_listing?(path, params) doc = Nokogiri::HTML(NS::Browser.get(url(path), params).body) found = [] doc.css('pre a').each do |node| entry = node.text.to_s next if entry == '[To Parent Directory]' found << entry end found end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems