Permalink
Browse files

Add subdomain input file for VHOST scanner

This commit allows the vhost scanner to take subdomains from a
text file, one subdomain per line. Lines are stripped of the top
level domain name if present before testing.
  • Loading branch information...
1 parent e39472f commit 94f8a41b57201e6aeb3cfd5d00933afc1ed86b8e RageLtMan committed Oct 3, 2012
Showing with 6 additions and 3 deletions.
  1. +6 −3 modules/auxiliary/scanner/http/vhost_scanner.rb
@@ -45,13 +45,15 @@ def initialize(info = {})
OptString.new('QUERY', [ false, "HTTP URI Query", '']),
OptString.new('DOMAIN', [ true, "Domain name", '']),
OptString.new('HEADERS', [ false, "HTTP Headers", '']),
+ OptPath.new('SUBDOM_LIST', [false, "Path to text file with subdomains"]),
], self.class)
end
def run_host(ip)
-
- valstr = [
+ valstr = ::File.file?(datastore['SUBDOM_LIST']) ?
+ IO.readlines(datastore['SUBDOM_LIST']).map {|e| e.gsub(".#{datastore['DOMAIN']}", "").chomp} :
+ [
"admin",
"services",
"webmail",
@@ -102,7 +104,8 @@ def run_host(ip)
print_error("[#{ip}] Unable to identify error response")
return
end
-
+
+ vprint_status("Running with #{valstr.length} sudomains")
valstr.each do |astr|
thost = astr+"."+datastore['DOMAIN']

0 comments on commit 94f8a41

Please sign in to comment.