Score:0

Inventory of all vhosts across multiple webservers

cn flag

I was tasked to create an inventory of all websites/webapps hosted on our infrastructure (couple thousand sites hosted on around 120 Linux VMs). Most of the sites are served by Apache (httpd 2.4) but there are also Apache 2.2, Nginx, Tomcat and other webservers used. As this is a massive task, I don't want to spend on it more time on it than necessary. So I'm wondering if somebody can point me to existing script, tool, Ansible role or something like that that parses the webserver configs in order to gather all the vhosts configured. I am aware that there are fuzzers like DirBuster or VHostScan that pentesters use but as I have shell access on those webservers this seems like inefficient (and probably inaccurate) way to go.

Score:1
us flag
Rob

For Apache httpd you can run the following command:

httpd -S

That shows the settings as parsed from the config file (which currently only shows the virtualhost settings, but that is exactly what you appear to need).

That returns something along the lines of:

VirtualHost configuration:
*:80                   is a NameVirtualHost
         default server www.example.com (/etc/httpd/conf.d/www.example.com.conf:19)
         port 80 namevhost www.example.com (/etc/httpd/conf.d/www.example.com.conf:19)
                 alias example.com
                 alias server.example.com
         port 80 namevhost www.example.co.uk(/etc/httpd/conf.d/www.example.co.uk.conf:1)
                 alias example.co.uk
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.