Commits

Tim Tomes  committed 5e8b37f

added a meta tag parser to the server_enum module.

  • Participants
  • Parent commits 48469b5

Comments (0)

Files changed (1)

File modules/recon/hosts/enum/http/server_enum.py

 # unique to module
 from random import choice
 import textwrap
+import re
 
 class Module(framework.module):
 
         self.classify = 'active'
         self.info = {
                      'Name': 'Server Side Enumerator',
-                     'Author': 'Tim Tomes (@LaNMaSteR53) and Kenan Abdullahoglu (@kyabd)',
+                     'Author': 'Tim Tomes (@LaNMaSteR53), Kenan Abdullahoglu (@kyabd), Matteo Cantoni (nothink.org)',
                      'Description': 'Analyzes response headers, cookies, and errors to determine which server-side technology is being used (PHP, .NET, JSP, CF, etc.).',
                      'Comments': []
                      }
             print 'COOKIES'.center(50, self.ruler)
             for cookie in resp.cookies:
                 self.output('%s: %s' % (cookie.name.upper(), textwrap.fill(cookie.value, 100, initial_indent='', subsequent_indent=self.spacer*2)))
+            print 'META TAGS'.center(50, self.ruler)
+            pattern = '<META NAME=["\'](.+?)["\'] CONTENT=["\'](.+?)["\'][ /]*?>'
+            tags = re.findall(pattern, resp.text, re.IGNORECASE)
+            for tag in tags:
+                self.output('%s: %s' % (tag[0].upper(), textwrap.fill(tag[1], 100, initial_indent='', subsequent_indent=self.spacer*2)))
             print 'END'.center(50, self.ruler)
 
         tdata = []
-        # check for redirect
-        if url != resp.url:
-            if verbose: tdata.append(['URL', url, '--'])
-            if verbose: tdata.append(['REDIR', resp.url, '--'])
-        else:
-            if verbose: tdata.append(['URL', resp.url, '--'])
-
         # check file ext
         from urlparse import urlparse
         path = urlparse(resp.url).path