File tree Expand file tree Collapse file tree 1 file changed +7
-11
lines changed
modules/auxiliary/dos/http Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -121,23 +121,19 @@ def potential_static_files_uris
121
121
return uris unless res
122
122
123
123
site_uri = URI . parse ( full_uri )
124
+ page = Nokogiri ::HTML ( res . body . encode ( 'UTF-8' , invalid : :replace , undef : :replace ) )
124
125
125
- Nokogiri :: HTML ( res . body ) . xpath ( '//link|//script|//style|//img' ) . each do |tag |
126
+ page . xpath ( '//link|//script|//style|//img' ) . each do |tag |
126
127
%w( href src ) . each do |attribute |
127
- begin
128
- attr_value = tag [ attribute ]
128
+ attr_value = tag [ attribute ]
129
129
130
- next unless attr_value && !attr_value . empty?
130
+ next unless attr_value && !attr_value . empty?
131
131
132
- uri = site_uri . merge ( URI . encode ( attr_value . strip ) )
132
+ uri = site_uri . merge ( URI . encode ( attr_value . strip ) )
133
133
134
- next unless uri . host == vhost || uri . host == rhost
134
+ next unless uri . host == vhost || uri . host == rhost
135
135
136
- uris << uri . path if uri . path =~ /\. [a-z]{2,}$/i # Only keep path with a file
137
- rescue => e
138
- vprint_error ( "#{ peer } - #{ e } " )
139
- next
140
- end
136
+ uris << uri . path if uri . path =~ /\. [a-z]{2,}$/i # Only keep path with a file
141
137
end
142
138
end
143
139
You can’t perform that action at this time.
0 commit comments