<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/cleartext-credential-recovery-in-servicenow-f5ikg4o4e" -->

---
title: Cleartext Credential Recovery in ServiceNow | daily.dev
description: A red team researcher details a technique for recovering cleartext credentials from ServiceNow by backdooring the CredentialTestAjax script include to...
canonical: https://daily.dev/posts/cleartext-credential-recovery-in-servicenow-f5ikg4o4e
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Cleartext Credential Recovery in ServiceNow | daily.dev
og:description: A red team researcher details a technique for recovering cleartext credentials from ServiceNow by backdooring the CredentialTestAjax script include to...
og:url: https://daily.dev/posts/cleartext-credential-recovery-in-servicenow-f5ikg4o4e
og:image: https://api.daily.dev/og/posts/F5iKg4O4e.png
og:image:alt: Cleartext Credential Recovery in ServiceNow
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Cleartext Credential Recovery in ServiceNow

**[SpecterOps](https://daily.dev/sources/specterops)** · 7 min read · 0 upvotes · 0 comments

## Summary

A red team researcher details a technique for recovering cleartext credentials from ServiceNow by backdooring the CredentialTestAjax script include to intercept decrypted credential data before it reaches the MID server validation logic. The method works for all discovery credential types stored in the discovery_credentials table — including SSH keys, Entra ID secrets, and AWS keys — not just Windows credentials. A separate technique using GlideScript's getDecryptedValue() function recovers LDAP credentials from ldap_server_config records. Both attacks require elevated roles (discovery_admin or script_include_admin), and proof-of-concept code is provided on GitHub.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://specterops.io/blog/2026/08/27/cleartext-credential-recovery-servicenow>

## Questions this post answers

### Can you extract cleartext credentials from ServiceNow's discovery_credentials table as an admin?

Yes. By modifying the CredentialTestAjax script include to introduce an early return before the MID server validation call, the decrypted credential JSON is returned directly in the HTTP response. This works for all credential types stored in the discovery_credentials table — including SSH private keys, Entra ID service principal secrets, and AWS keys — not just Windows passwords. The caller needs the discovery_admin or script_include_admin role.

_Security engineers auditing ServiceNow privilege exposure track techniques like this on daily.dev._

### How can I recover LDAP credentials stored in ServiceNow's ldap_server_config table?

LDAP passwords in ldap_server_config are stored as Password2 data types. A custom script include using GlideRecord and the getDecryptedValue() method on the password field returns the cleartext value. This requires write access to sys_script_include and execute rights — by default the script_include_admin role — which is actually fewer privileges than the forced-authentication LDAP attack path, since LDAPClientUtils restricts execution to the admin role.

_Red teamers working ServiceNow engagements find the latest tradecraft on daily.dev._

### What ServiceNow roles are needed to backdoor the CredentialTestAjax script include for credential extraction?

At minimum you need the discovery_admin or agent_admin role to call CredentialTestAjax, the script_include_admin role to write to the sys_script_include table, and at least partial read access to the discovery_credentials table to obtain the target record's sys_id. The discovery_admin role satisfies all three requirements by default, since it includes script_include_admin.

_Defenders mapping ServiceNow attack paths stay current on privilege abuse research through daily.dev._

## Similar posts on daily.dev

- [Fantastic clear-text passwords and where to collect them \(Part 2 - Windows\)](https://daily.dev/posts/fantastic-clear-text-passwords-and-where-to-collect-them-part-2---windows--k6qxogell) · dfir.ch · 0 upvotes · 0 comments
- [Critical SimpleHelp flaw exploited to deploy new stealer malware](https://daily.dev/posts/critical-simplehelp-flaw-exploited-to-deploy-new-stealer-malware-6pcjbxj1n) · BleepingComputer · 0 upvotes · 0 comments
- [Credential Harvesting: How Attackers Collect Secrets in 2026](https://daily.dev/posts/credential-harvesting-how-attackers-collect-secrets-in-2026-ucllonhad) · GitGuardian · 0 upvotes · 0 comments

---

Tags: [#authentication](https://daily.dev/tags/authentication), [#red-teaming](https://daily.dev/tags/red-teaming)

[View this post on daily.dev](https://daily.dev/posts/cleartext-credential-recovery-in-servicenow-f5ikg4o4e)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Cleartext Credential Recovery in ServiceNow","url":"https://daily.dev/posts/cleartext-credential-recovery-in-servicenow-f5ikg4o4e","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/cleartext-credential-recovery-in-servicenow-f5ikg4o4e"},"datePublished":"2026-08-27T16:03:13.069Z","dateModified":"2026-08-27T17:48:05.269Z","description":"A red team researcher details a technique for recovering cleartext credentials from ServiceNow by backdooring the CredentialTestAjax script include to...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/e05438af8f8c63db208d277a60505fad?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/e05438af8f8c63db208d277a60505fad?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"SpecterOps","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"SpecterOps","logo":"https://media.daily.dev/image/upload/s--lR36Z4gn--/f_auto,q_auto/v1787487384/logos/specterops?_a=BAMAMicg0","url":"https://daily.dev/sources/specterops"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/cleartext-credential-recovery-in-servicenow-f5ikg4o4e","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"authentication,red-teaming","timeRequired":"PT7M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"SpecterOps","item":"https://daily.dev/sources/specterops"},{"@type":"ListItem","position":3,"name":"Cleartext Credential Recovery in ServiceNow"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/cleartext-credential-recovery-in-servicenow-f5ikg4o4e#faq","mainEntity":[{"@type":"Question","name":"Can you extract cleartext credentials from ServiceNow's discovery_credentials table as an admin?","acceptedAnswer":{"@type":"Answer","text":"Yes. By modifying the CredentialTestAjax script include to introduce an early return before the MID server validation call, the decrypted credential JSON is returned directly in the HTTP response. This works for all credential types stored in the discovery_credentials table — including SSH private keys, Entra ID service principal secrets, and AWS keys — not just Windows passwords. The caller needs the discovery_admin or script_include_admin role. Security engineers auditing ServiceNow privilege exposure track techniques like this on daily.dev."}},{"@type":"Question","name":"How can I recover LDAP credentials stored in ServiceNow's ldap_server_config table?","acceptedAnswer":{"@type":"Answer","text":"LDAP passwords in ldap_server_config are stored as Password2 data types. A custom script include using GlideRecord and the getDecryptedValue() method on the password field returns the cleartext value. This requires write access to sys_script_include and execute rights — by default the script_include_admin role — which is actually fewer privileges than the forced-authentication LDAP attack path, since LDAPClientUtils restricts execution to the admin role. Red teamers working ServiceNow engagements find the latest tradecraft on daily.dev."}},{"@type":"Question","name":"What ServiceNow roles are needed to backdoor the CredentialTestAjax script include for credential extraction?","acceptedAnswer":{"@type":"Answer","text":"At minimum you need the discovery_admin or agent_admin role to call CredentialTestAjax, the script_include_admin role to write to the sys_script_include table, and at least partial read access to the discovery_credentials table to obtain the target record's sys_id. The discovery_admin role satisfies all three requirements by default, since it includes script_include_admin. Defenders mapping ServiceNow attack paths stay current on privilege abuse research through daily.dev."}}]}
```

