How I Hacked A Company (My First Red Team Engagement 🚩)Permalink
The author found SQL injection vulnerabilities that exposed plain-text passwords, plus credentials from GitHub dorking, and used them to gain initial access to a FinTech company's network. Through password spraying, LSASS dumping, and lateral movement, they eventually compromised a Domain Admin account and dumped the entire Active Directory database.
Published on aidenpearce369.github.io
Hello World! I haven’t posted a blog on my website in a long time.Since the middle of 2022, I’ve been devoting my time and energy to learning Red Teaming techniques and am still exploring the vast ocean.During my training, I practised with vulnerable environments (Hack the Box machines and other vulnerable VMs set up…
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Context
This is an account of a first red team engagement against a large FinTech company with a vast network. The engagement was run as an adversary simulation under an Assume Breach Scenario. The target had many domains on the internet hosting applications for employees and customers, and the work moved from external web application testing through to full domain compromise.
The author frames the methodology as his own and notes that it may differ from how other red teamers work. The write-up is organised around the phases he followed: enumeration, web application pentesting, credential gathering, cloud access, and on-premises lateral movement.
Setup
The tools and techniques named in the report are:
subfinderfor subdomain enumeration, integrated with many API keys.httpxfor probing subdomains and checking whether they are reachable from the public internet.sqlmapfor confirming and dumping SQL injection, with request files captured for reuse.Burpsuitefor fuzzing and manual reproduction.- Shodan and GitHub dorking for exposed infrastructure and leaked credentials.
O365 Sprayerfor password spraying against the target domain.- The
Azure ADPowerShell module for cloud enumeration. SharpHoundandBloodHoundfor AD data collection and analysis.procdump.exefor dumpingLSASS.exe.MimikatzandInvoke-Mimikatzfor analysing dumps and pass-the-hash.PowerCatfor a reverse shell, with a custom Go binary written by a colleague.secretsdumpfor extracting hashes from the domain controller.
No versions are given for any of these tools.
Finding it
The starting point was information gathering on the public internet. The report lists the enumeration tactics required before probing the internal network directly:
- Subdomain Enumeration
- GitHub Dorking
- Shodan Dorking
- Google Dorking
- External Application Pentesting
- Familiarising with Enterprise Architecture
Subdomain enumeration was run over a list of target domains:
cat targetDomains.txt | while read -r domain; do
( echo $domain | subfinder -silent >>subdomains.txt );
done
Each domain is piped into subfinder in silent mode and the results are appended to subdomains.txt. The subdomains were then probed for reachability, with status codes shown:
cat subdomains.txt | httpx -silent -sc
This surfaced many subdomains named for internal web applications that are not accessible from the public internet, but most were accessible. Those accessible applications became the pentest targets.
Most of the applications were static sites for business marketing. The author notes that the more dynamic the feature, the more interesting it becomes. The team found many web application vulnerabilities across the scope. His personal favourites for red team engagements are SQL Injection, XML External Entity and Open Redirection. His reasoning: SQL injection and XXE are injection-based attacks that retrieve sensitive real-time data from the backend or server, which can then support lateral movement in the next phase. Open redirection is often treated as an ordinary bug that bug bounty platforms have normalised, but red teamers value it because it can lure a victim from the enterprise: the redirect to the attacker's URL originates from the enterprise domain name, and mostly non-technical employees fall for it.
While looking for web vulnerabilities, team members found many SQL injections across the scope. The author aggregated the domains and manually fuzzed to identify the database in use, using PortSwigger's SQL Injection Cheat Sheet as a reference.
A common pattern emerged: specific groups of sites shared the same tech stack, with .NET on the front end, IIS Server for hosting, and MSSQL for the back end (identified by manual fuzzing).
# Typical Enterprise Web Application Stack
Front End (.NET) <---> Server (IIS) <---> Back End (MSSQL)
Separately, the estate also used Wordpress applications and apps built on PHP + MySQL that behaved similarly to WordPress but were not WordPress.
Exploitation
Step 1: Dumping databases with sqlmap
The author used sqlmap against captured requests. The command set, in the order given in the report, is:
#Fuzz for SQL Injection
sqlmap -r request.txt
#Specifying Database
sqlmap -r request.txt --dbms MySQL --level 3 --risk 3
#Fuzzing Vulnerable Param
sqlmap -r request.txt --dbms MySQL --level 3 --risk 3 -p <PARAM_NAME_VULNERABLE_TO_SQLi>
#Dump database names
sqlmap -r request.txt --dbms MySQL --level 3 --risk 3 --dbs
#Dump table names
sqlmap -r request.txt --dbms MySQL --level 3 --risk 3 --tables
#Dump all data from the given database & table
sqlmap -r request.txt --dbms MySQL --level 3 --risk 3 -D <DB_NAME> -T <TABLE_NAME> --dump
Each command reuses a saved HTTP request (request.txt), pins the DBMS to MySQL, and raises --level and --risk to 3. The -p flag targets the specific vulnerable parameter, --dbs and --tables enumerate metadata, and -D/-T with --dump extracts the contents of a chosen table.
With this, the author dumped the entire database from the MySQL instance. The other sites, including the MSSQL ones where a common database was synced with many web applications, had Blind SQLi, which took longer to brute force and dump. Dumping database and table names alone gave a good understanding of the internal domains and internal web applications.
The SQL dumps were described as a gold mine: they contained many email IDs and their passwords stored in plain text, which the author calls a bad security practice.
Step 2: Shodan and GitHub dorking
Shodan dorking produced many exposed internal domains with their IPs, leaked through their SSL certificates. It also revealed an open RDP port 3389 into the organisation.
GitHub dorking produced a pair of credentials: internal developers had written scripts to test API functionality and left them in a git commit without removing them. The same activity yielded a bunch of internal email IDs for the enterprise.
Step 3: Consolidating credentials
Using grep commands and bash automation, the author wrote the credentials from the SQL injection dumps and the dorking into a single file containing nearly 340 credentials. He treats that number as evidence the enterprise was not following good security compliance and mitigations.
Step 4: The Exchange Server rabbit hole
Before actively using the credentials, the author continued exploring subdomains. He came across a MS Exchange Server for the domain with an OWA Portal (Outlook Web App Portal) login page. Having followed security researchers on Twitter, he immediately recognised that ProxyShell could be attempted against it, and cites Orange Tsai's talk and blog on ProxyLogon as references.
He fuzzed the OWA app with Burpsuite and found the Exchange Server version in a response header. He then ran publicly available exploits, specifically the horizon3ai ProxyShell exploit, and a friend who had reproduced the exploit helped with his perspective on attacking it. The exploit got him a shell, but he could not successfully run commands. He reproduced the exploit manually using Burp and his own Python scripts, and concluded that the email IDs in the Exchange Server were a rabbit hole: the FQDN and email IDs had been placed inside the server specifically to lure a red teamer. He describes this as his first encounter with blue team tactics and says he spent nearly four days on this exploit before his belief in it broke.
Step 5: Confirming federation
Moving on to other subdomains, some sites redirected to an SSO login page. He queried the following endpoint:
https://login.microsoftonline.com/getuserrealm.srf?json=1&login=[redacted]
This confirmed that the domains run as a Federated Service for AD, meaning the company is connected to Microsoft Cloud (O365).
Step 6: Spraying the harvested credentials
He sprayed the prepared credentials with O365 Sprayer over the target domain. Only one credential worked. He calls this the turning point of the engagement. The password for the valid credential was a simple combination used by the domain.
Step 7: Connecting to Azure AD
Using the valid credential, he logged in as the user in their domain via the Azure AD PowerShell module. Connecting to Azure Cloud requires the Tenant ID of the domain, which he obtained from:
https://login.microsoftonline.com/<TARGET_DOMAIN>/v2.0/.well-known/openid-configuration
The Tenant ID comes back in the response. He then connected:
Connect-AzureAD -TenantId <TENANT_ID>
Step 8: Enumerating Azure AD
With the connection established, enumeration via the Azure AD PS Module became much easier. The commands he names are Get-AzureADUser -All $true, Get-AzureADGroup -All $true and Get-AzureADDevice -All $true, plus Get-AzureADDomain to check the authentication type for the domains connected to it. From the enumerated users he could obtain all email IDs used in the domain.
Step 9: Second password spray
He performed a Password Spray with default combinations for the domain, taking the Account Lockout Policy and its cool down period into account. Nearly 60 accounts were compromised by weak, predictable passwords.
Step 10: Initial access and EDR constraints
Using these credentials he got into a machine with a default AD user privilege account. The machine ran several EDRs (not the top rated) and AV products, which he describes as a problem for a newbie red teamer. He listed processes and found the defending products running on the machine. When he tried to view offensive PowerShell scripts in the browser, they were flagged as malicious sites.
He reasoned that dropping an executable on disk would be flagged, and that reproducing the same EDR scenario locally to compile binaries would take too long. PowerShell memory was the only option. Downloading the offensive PowerShell scripts directly from GitHub was flagged, but Base64 encoding them and loading them into PowerShell memory was not:
# Store the Base64 encoded file
$file = <BASE64_ENCODED_CONTENT_FILE>
$data = Get-Content $file
[System.Text.Encoding]::ASCII.GetString([System.Convert]::FromBase64String($data)) | IEX
# Delete the Base64 encoded file
The file content is read, decoded from Base64 as ASCII, and piped into IEX for execution in memory. The code includes a comment noting the encoded file is then deleted. The scripts loaded without being caught.
He attempted Local privilege escalation but found nothing to escalate.
Step 11: BloodHound analysis
He ran SharpHound and moved the ingested data to his local machine for BloodHound. Loading the data took time because of thousands of AD objects. He advises always looking for Outbound ACLs, because they are the hidden link between two AD objects. Some compromised users had PS-Session over some machines. He used those accounts to gain the PS Session and enumerated privileges.
Step 12: LSASS dump with procdump
Some users had Full Privileges over their respective machines. He used that to dump LSASS.exe with procdump.exe, noting this is stealthy because procdump.exe is a Microsoft-signed binary that does not get flagged by AV/EDRs.
He moved the .dmp file to his local machine and ran Mimikatz against it, obtaining the NTLM hash of a user who is a member of a privileged group. He did not have Local Administrator Privilege over his controlled machine, so he could only perform pass-the-hash over the PS-Session.
Step 13: Reverse shell and pass-the-hash
A colleague wrote an undetectable reverse shell in Go. They copied that binary to the remote computer with the PS-Session and tried PTH using Invoke-Mimikatz to run the reverse shell with PowerCat. It ran and they got the privileged group user rights, but they stopped because of an issue: they were inside a firewall and could not query the DC directly for further movement. He also notes he did not realise at that point that he had a plain text password for the same user in the dump.
Step 14: ACL abuse and LAPS
From the user through which he got initial access, he was able to change an account password with GenericAll ACL rights. After using the password-changed account, he was able to view the LAPS password via AllExtendedRights over a machine. That machine turned out to be a waste of time to proceed with.
Step 15: Domain Admin and domain controller
BloodHound showed that the compromised user from the LSASS dump had a session on a machine where one of the domain admins also had a session. Using the plain text password, he did lateral movement with PS-Session and dumped LSASS with procdump.exe again. This time he got the plain text password for Domain Admin.
Logging into the DC, he dumped the NTDS.dit file and the Registry Hives. He added the accounts he required for persistence and dumped all hashes from the enterprise using secretsdump. The output on his machine was:
aidenpearce369@jackdaw:~/DC5-LSASSDump$ ls
RegHive allHashes.txt log.dmp ntds.dit
aidenpearce369@jackdaw:~/DC5-LSASSDump$ cat allHashes.txt | grep ':::' | grep -v "$:" | wc -l
43856
aidenpearce369@jackdaw:~/DC5-LSASSDump$ cat allHashes.txt | grep ':::' | grep "$:" | wc -l
48587
aidenpearce369@jackdaw:~/DC5-LSASSDump$
The two counts separate user account hashes from machine account hashes: 43856 user account hashes and 48587 machine account hashes.
Root cause
The report does not present a single code-level flaw. The compromise came from a chain of weaknesses, each of which the report describes:
- SQL injection in multiple web applications, including blind injection in MSSQL-backed sites where a common database was synced across many applications. This exposed email IDs and passwords stored in plain text.
- Plain text password storage, which the author calls a bad security practice.
- Credentials committed to a git repository by internal developers testing API functionality, and not removed from the commit.
- SSL certificates on internal domains exposing those domains and their IPs to Shodan, plus an open RDP port on 3389.
- Weak, predictable passwords: one harvested credential worked against O365, and a second spray with default combinations for the domain compromised nearly 60 accounts while respecting the lockout policy.
- Excessive AD permissions:
GenericAllon an account,AllExtendedRightsover a machine,Full Privilegesover machines, and PS-Session access for ordinary users. - A domain admin session on a machine where a compromised user also had a session, which allowed the LSASS dump to yield the Domain Admin plain text password.
The EDR and AV products on the initial machine did not stop in-memory PowerShell execution or the Microsoft-signed procdump.exe, which is why the author describes those as the paths that worked. The report does not say which products were deployed.
Impact
Under the conditions described, the chain gave the team:
- Full database contents from MySQL-backed applications, and data from blind MSSQL injection, including email IDs and plain text passwords.
- Knowledge of internal domains and internal web applications from database and table names.
- Exposed internal domains with IPs and an open RDP port into the organisation.
- A working O365 credential, then Azure AD enumeration of users, groups, devices and domains.
- Nearly 60 compromised accounts from the second spray.
- A privileged group user's NTLM hash and plain text password, and later the Domain Admin plain text password.
- The
NTDS.ditfile and registry hives from the DC, with43856user account hashes and48587machine account hashes extracted, plus persistence accounts added.
The report does not quantify what data the client's business held or what the client's response was. The Exchange Server episode is explicitly described as a decoy that produced a shell but no working command execution.
Fix
The report does not describe remediation performed by the client. The weaknesses it identifies point to the following, which are the author's observations rather than a stated fix list:
- Eliminate SQL injection in the web applications and stop storing passwords in plain text.
- Remove credentials from git history and stop committing test scripts with secrets.
- Reduce what SSL certificates and exposed services reveal, and close unnecessary RDP exposure.
- Enforce strong password policy so that default combinations and simple domain-based combinations do not work, and so that spraying does not yield dozens of accounts.
- Review AD ACLs, in particular
GenericAll,AllExtendedRightsandFull Privilegesgrants, and limit PS-Session access. - Limit where domain admin sessions are established, since a domain admin session on a shared machine was the step that yielded the Domain Admin password.
Variants to test
- Run the same subdomain pipeline against another scope and probe with
httpx -silent -sc. A positive result is a set of live subdomains, especially ones named for internal applications that answer from the public internet. - Test dynamic parameters for SQL injection and identify the DBMS by manual fuzzing. A positive result is error or timing behaviour that differs by DBMS, which then justifies the
sqlmaprequest-file workflow above. - Query the federation endpoint for each in-scope domain. A positive result is a response showing the domain is federated, which makes O365 spraying relevant.
- Fetch the OpenID configuration for the tenant and use the returned
Tenant IDwithConnect-AzureAD. A positive result is a successful connection that allowsGet-AzureADUser,Get-AzureADGroupandGet-AzureADDeviceenumeration. - Spray a small, lockout-aware set of default combinations. A positive result is any valid credential, which then feeds cloud enumeration.
- On a foothold, load Base64-encoded PowerShell into memory with
IEXwhen direct download is blocked. A positive result is script execution without an AV/EDR alert. - Run
SharpHoundand inspectOutbound ACLsin BloodHound. A positive result is ACL edges such asGenericAllorAllExtendedRightsthat allow password changes or LAPS reads. - Dump
LSASSwith the Microsoft-signedprocdump.exewhere full privileges over a machine are held, then analyse the dump withMimikatz. A positive result is an NTLM hash or plain text password for a more privileged user. - Check whether privileged users have sessions on machines where a compromised user also has a session. A positive result is a path to a domain admin credential through a second LSASS dump.
What happened, in plain words
A security tester was hired by a large financial technology company (a "FinTech") to break into its systems on purpose, with permission. This kind of paid break-in is called a red team engagement. The company wanted to know what a real attacker could do, so the tester was allowed to act like one. The approach for the engagement was an Assume Breach Scenario.
The tester started with nothing but the company's public websites. Over the engagement he found weak database code, passwords stored in readable form, passwords left in code-sharing sites, and weak passwords on employee accounts. He used those to get into the company's Microsoft cloud accounts, then into ordinary office computers, then into more and more powerful accounts, and finally into the domain controller, the central server that controls every login in a Windows network. From there he copied the password fingerprints (called hashes) of tens of thousands of accounts.
This article walks through every step in the order it happened, explaining each idea from scratch. You only need to know how to use a browser and a computer to follow it.
The starting point: what the tester knew
The company had many domains on the internet. A domain is the part of a web address after the www, like example.com. Each domain can host several web applications: websites and web services that do something, rather than just showing a page. Some were for customers, some for employees.
Before touching anything internal, the tester gathered information that anyone on the internet could see. The report lists six things to do first:
- Subdomain Enumeration
- GitHub Dorking
- Shodan Dorking
- Google Dorking
- External Application Pentesting
- Familiarising with Enterprise Architecture
Here is what each one means:
- Subdomain enumeration: finding all the smaller names under a company's domain. If the company owns
example.com, it might also havemail.example.com,vpn.example.com,intranet.example.comand hundreds more. Each one is a possible way in. - Dorking: using a search engine's advanced search features to find things that were not meant to be public. "GitHub dorking" means searching the code-sharing site GitHub for accidentally published secrets. "Shodan dorking" means searching Shodan, a search engine for internet-connected devices and servers, rather than web pages. "Google dorking" is the same idea with Google.
- External application pentesting: testing the websites and services that are reachable from the open internet.
- Familiarising with enterprise architecture: learning how the company's systems fit together, so that later steps make sense.
Finding the company's web applications
To find subdomains, the tester ran a small script over a list of the company's domains:
cat targetDomains.txt | while read -r domain; do
( echo $domain | subfinder -silent >>subdomains.txt );
done
Line by line:
cat targetDomains.txtprints the contents of a file calledtargetDomains.txt, which holds one domain per line.catis a standard command that shows a file's contents.|is a pipe. It takes the output of the command on its left and feeds it as input to the command on its right, like a conveyor belt between two machines.while read -r domain; do ... doneis a loop. It reads the input one line at a time, putting each line into a variable calleddomain, and runs the commands betweendoanddoneonce per line.echo $domainprints the current domain.| subfinder -silentfeeds that domain into subfinder, a tool that looks up known subdomains for a domain.-silentmeans "only print the results, no extra chatter".>>subdomains.txtappends the result to a file calledsubdomains.txt. The double>>means "add to the end" rather than "overwrite".
So the whole script means: for every domain in the list, ask subfinder for its subdomains and add them all to one growing file. The report says subfinder is connected to many API keys. An API key is a password-like string that lets one program use another company's service; here they let subfinder query several subdomain databases at once.
Next, the tester checked which of those subdomains actually answer on the public internet:
cat subdomains.txt | httpx -silent -sc
cat subdomains.txtprints the list of subdomains.| httpx -silent -scsends each one to httpx, a tool that tries to connect to it over the web.-silentagain means quiet output, and-scmeans "show the status code".
A status code is the three-digit number a web server sends back. 200 means "here is the page", 404 means "not found", 403 means "forbidden", and so on. Seeing a status code tells you the server is alive and responding, which is the first sign that there is something to test.
This step found many subdomains whose names suggested internal applications, which were not reachable from the internet. But most were reachable. Those reachable ones became the targets.
Testing the websites
Most of the applications turned out to be static sites: pages that show the same content to everyone, used for marketing. The tester notes that the more dynamic a feature is, the more interesting it becomes. A dynamic feature is one that changes based on what you send it, for example a search box, a login form or a shopping cart. Dynamic features take input from the visitor, and input is where bugs live.
The team found many web application vulnerabilities across the scope. The tester's personal favourites for this kind of work are three:
- SQL Injection
- XML External Entity
- Open Redirection
Here is what each means, from zero:
- SQL stands for Structured Query Language. It is the language programs use to talk to a database, which is an organised store of data, like a very large, very strict spreadsheet. A website's login form, for example, asks the database "is there a user with this name and this password?". SQL injection happens when a website pastes what a visitor typed straight into a database question without cleaning it. If you type something clever instead of a normal name, you can change the question itself and make the database reveal data it should not.
- XML is a text format for structured data, using tags like
<name>value</name>. XML External Entity (XXE) is a bug where a program that reads XML is tricked into fetching a file or address that the attacker chooses, because XML has a feature for including other content by reference. - Open redirection is when a website takes a link parameter and sends the visitor to whatever address is in it, without checking. For example, a link on the company's own site that ends up sending you to an attacker's site.
The tester explains why he hunts these three specifically. SQL injection and XXE are injection attacks: they let an attacker pull sensitive, real-time information out of the server or its database, and that information can then help move deeper into the network in the next phase. Open redirection is often treated as an ordinary, low-value bug, and bug bounty platforms have normalised it, meaning they treat it as routine. But red teamers value it because it can be used to lure a victim: the redirect to the attacker's address starts from the company's own domain name, so the victim trusts it. Mostly non-technical employees fall for this.
While looking for these bugs, team members found many SQL injections across the scope. The tester collected the affected domains and manually poked at them to work out which database software each server was using. For reference he used PortSwigger's SQL Injection Cheat Sheet, a public list of payloads and techniques.
A pattern emerged: certain groups of sites shared the same technology stack. Front end means the part users see and interact with; back end means the database and logic behind it; the server is the machine (and software) in between that answers requests. These sites used .NET for the front end, IIS Server for hosting, and MSSQL for the back end. .NET is Microsoft's programming framework, IIS (Internet Information Services) is Microsoft's web server software, and MSSQL (Microsoft SQL Server) is Microsoft's database product. The report shows the arrangement like this:
# Typical Enterprise Web Application Stack
Front End (.NET) <---> Server (IIS) <---> Back End (MSSQL)
This is not a command to run; it is a diagram. The arrows show that the front end talks to the server, and the server talks to the database. Knowing this matters because each database product has its own quirks, and the tester needs to know which one he is attacking.
Separately, the company also used Wordpress applications (WordPress is a very common website-building product) and apps built on PHP + MySQL that behaved like WordPress but were not WordPress. PHP is a programming language often used for websites, and MySQL is a popular open-source database.
Step 1: Pulling data out of the databases
To exploit the SQL injections, the tester used sqlmap, a tool that automates finding and exploiting SQL injection. Rather than typing a URL each time, he saved a real request from his browser into a file called request.txt and pointed sqlmap at it. A saved request is useful because it contains everything the browser sent, including any login state, so sqlmap can replay it exactly.
The commands, in the order the report gives them:
#Fuzz for SQL Injection
sqlmap -r request.txt
#Specifying Database
sqlmap -r request.txt --dbms MySQL --level 3 --risk 3
#Fuzzing Vulnerable Param
sqlmap -r request.txt --dbms MySQL --level 3 --risk 3 -p <PARAM_NAME_VULNERABLE_TO_SQLi>
#Dump database names
sqlmap -r request.txt --dbms MySQL --level 3 --risk 3 --dbs
#Dump table names
sqlmap -r request.txt --dbms MySQL --level 3 --risk 3 --tables
#Dump all data from the given database & table
sqlmap -r request.txt --dbms MySQL --level 3 --risk 3 -D <DB_NAME> -T <TABLE_NAME> --dump
Line by line:
sqlmap -r request.txttells sqlmap to read the saved request from the file and test it for SQL injection. This is the first check: does this request have a hole?--dbms MySQLtells sqlmap which database product to assume, so it uses the right tricks.--level 3and--risk 3raise how many tests it tries and how aggressive they are. Higher numbers mean more thorough but slower and noisier testing.-p <PARAM_NAME_VULNERABLE_TO_SQLi>names the specific input field to attack. A parameter is one piece of data sent to a website, such as?id=5in a URL or a field in a form. The angle brackets are a placeholder: you replace them with the real name.--dbsasks the database to list its databases, which are like separate folders of data.--tableslists the tables inside a database. A table is one grid of data, for example a list of users.-D <DB_NAME> -T <TABLE_NAME> --dumppicks one database and one table and copies out all their rows.
With this, the tester dumped the entire database from the MySQL instance. The other sites, including the MSSQL ones where a common database was synced with many web applications, had Blind SQLi. Blind injection means the website does not show the database's answer directly, so the attacker has to ask yes/no questions and infer the data from how the site behaves. That takes much longer to brute force and dump. Even so, dumping just the database and table names gave a good picture of the company's internal domains and internal web applications, because the names themselves are revealing.
The SQL dumps were a gold mine: they contained many email addresses and their passwords, stored in plain text. Plain text means not scrambled or hashed in any way, so anyone who reads the database can read the passwords directly. The tester calls this a bad security practice.
Step 2: Searching Shodan and GitHub
Shodan dorking produced many exposed internal domains together with their IP addresses. An IP address is the numeric address of a machine on a network, like a postal address for computers. These leaked through the domains' SSL certificates. An SSL certificate is the digital document that proves a website is who it claims to be and enables the padlock in your browser; certificates often list the names they cover, and those names can be found by anyone searching certificate records. Shodan also revealed an open RDP port 3389 into the organisation. RDP (Remote Desktop Protocol) is the Windows feature that lets you control another computer's screen remotely; port 3389 is the network door it normally uses. An open RDP door on the internet is a direct way in.
GitHub dorking produced a pair of credentials. Credentials means a username and password (or similar) used to log in. Internal developers had written scripts to test some API functionality and left them in a git commit without removing them. An API (Application Programming Interface) is a way for one program to talk to another, like a service counter where programs place orders. A git commit is a saved snapshot in a version-control system, the tool developers use to track changes to code. The same search also turned up a bunch of internal email addresses for the company.
Step 3: Putting the credentials in one place
Using grep commands and bash automation, the tester wrote the credentials from the SQL injection dumps and from the dorking into a single file. grep is a command that searches text for lines matching a pattern, and bash is the standard command-line shell on Linux and macOS. The combined file held nearly 340 credentials. He treats that number as evidence that the company was not following good security compliance and mitigations. Mitigations are the defences put in place to reduce risk.
Step 4: The Exchange Server dead end
Before actually using the credentials, the tester kept exploring subdomains. He came across a MS Exchange Server for the domain, with an OWA Portal login page. Microsoft Exchange is Microsoft's email server product, and OWA (Outlook Web App) is the web page where employees read their email in a browser. Seeing that login page, he immediately thought of ProxyShell, a well-known set of bugs in Exchange that can be chained to take over the server. He had been reading posts from security researchers he follows on Twitter, and he cites a talk by Orange Tsai and his blog on ProxyLogon as references.
He fuzzed the OWA app with Burpsuite and found the Exchange Server version in a response header. Fuzzing means sending lots of slightly varied inputs to see how a system reacts. Burp Suite is a tool that sits between your browser and a website so you can inspect and change every request. A response header is the small block of information a server sends before the page itself, such as what software it runs and its version. Knowing the version tells you which known bugs apply.
He then ran publicly available exploits, specifically the horizon3ai ProxyShell exploit, and a friend who had reproduced the exploit helped with his perspective on attacking it. An exploit is code that takes advantage of a specific bug. The exploit got him a shell, meaning a command line on the remote machine, but he could not successfully run commands. He reproduced the exploit manually using Burp and his own Python scripts, and concluded that the email addresses in the Exchange Server were a rabbit hole: the FQDN and email addresses had been placed inside the server specifically to lure a red teamer. FQDN stands for Fully Qualified Domain Name, the complete name of a machine such as mail.example.com. He describes this as his first encounter with blue team tactics. Blue team means the defenders; red team means the attackers. He spent nearly four days on this exploit before his belief in it broke.
Step 5: Checking how the company logs in
Moving on to other subdomains, some sites redirected him to an SSO login page. SSO (Single Sign-On) means one login is shared across many services, so you sign in once and get into everything. He queried this address:
https://login.microsoftonline.com/getuserrealm.srf?json=1&login=[redacted]
This is a URL, not a command. It asks Microsoft's login service a question about a domain. The login=[redacted] part is a made-up email address at the company's domain; the service answers based on the domain part, not the person. The json=1 part asks for the answer in JSON, a simple text format for structured data. The answer confirmed that the domains run as a Federated Service for AD, meaning the company is connected to Microsoft Cloud (O365). AD stands for Active Directory, Microsoft's system for managing users, groups and computers on a network. "Federated" means the company's own login system trusts Microsoft's cloud to handle sign-ins, so the two work together.
Step 6: Trying the harvested credentials
He sprayed the prepared credentials with O365 Sprayer over the target domain. Password spraying is trying one or a few common passwords against many accounts, rather than many passwords against one account. It is designed to stay under the radar of account lockout rules, which lock an account after too many wrong guesses. O365 Sprayer is a tool built for doing this against Microsoft 365.
Only one credential worked. He calls this the turning point of the engagement. The password for the valid credential was a simple combination used by the domain, meaning it followed a predictable pattern.
Step 7: Connecting to the cloud
Using the valid credential, he logged in as that user in their domain via the Azure AD PowerShell module. Azure AD is Microsoft's cloud version of Active Directory, and PowerShell is Microsoft's command-line tool for automating tasks. A module is a bundle of extra commands you can load into PowerShell.
To connect to Azure Cloud, you need the Tenant ID of the domain. A tenant is the company's own separate space inside Microsoft's cloud, and the Tenant ID is its unique identifier. He got it from this address:
https://login.microsoftonline.com/<TARGET_DOMAIN>/v2.0/.well-known/openid-configuration
Again this is a URL. You replace <TARGET_DOMAIN> with the company's domain. This is a standard address that Microsoft publishes for every tenant, describing how to log in to it. The Tenant ID comes back in the response. He then connected:
Connect-AzureAD -TenantId <TENANT_ID>
Connect-AzureAD is the PowerShell command that opens a session to Azure AD, and -TenantId <TENANT_ID> tells it which company's cloud space to open. You replace the placeholder with the real ID. After this, his PowerShell session was logged in to the company's cloud directory.
Step 8: Listing everything in the cloud directory
With the connection established, enumeration via the Azure AD PowerShell module became much easier. Enumeration means listing things out, one by one. The commands he names are:
Get-AzureADUser -All $truelists all users.Get-AzureADGroup -All $truelists all groups. A group is a collection of accounts that share permissions, like a team roster.Get-AzureADDevice -All $truelists all registered devices, such as laptops and phones.Get-AzureADDomainchecks the authentication type for the domains connected to the tenant.
The -All $true part means "give me everything, not just the first page". From the enumerated users he could obtain all email addresses used in the domain.
Step 9: A second password spray
He performed a password spray with default combinations for the domain, taking the Account Lockout Policy and its cool down period into account. The lockout policy is the rule that says how many wrong guesses are allowed before an account is temporarily locked, and the cool down is how long the lock lasts. Respecting it means spacing out attempts so no account gets locked. Nearly 60 accounts were compromised by weak, predictable passwords.
Step 10: Getting onto a computer, and the defences in the way
Using these credentials he got into a machine with a default AD user privilege account. Privilege means what an account is allowed to do; a default user account is an ordinary employee account, not an administrator.
The machine ran several EDRs (not the top rated) and AV products, which he describes as a problem for a newbie red teamer. AV stands for antivirus, software that looks for known bad files. EDR stands for Endpoint Detection and Response, a more advanced tool that watches what programs do on a computer, not just what they look like. He listed the running processes and found the defending products on the machine. A process is a running program. When he tried to view some offensive PowerShell scripts in the browser, they were flagged as malicious sites.
He reasoned that dropping an executable on disk would be flagged, and that reproducing the same EDR setup locally to compile binaries would take too long. Compiling means turning source code into a runnable program. So PowerShell memory was the only option. Downloading the offensive PowerShell scripts directly from GitHub was flagged, but Base64 encoding them and loading them into PowerShell memory was not. Base64 is a way of writing any data using only letters, digits and a few symbols, so it looks like harmless gibberish to a scanner that is looking for known bad text.
# Store the Base64 encoded file
$file = <BASE64_ENCODED_CONTENT_FILE>
$data = Get-Content $file
[System.Text.Encoding]::ASCII.GetString([System.Convert]::FromBase64String($data)) | IEX
# Delete the Base64 encoded file
Line by line:
$file = <BASE64_ENCODED_CONTENT_FILE>puts the name of the file holding the encoded script into a variable called$file. A variable is a named box that holds a value. The angle brackets are a placeholder for the real file name.$data = Get-Content $filereads the file's contents into a variable called$data.[System.Convert]::FromBase64String($data)turns the Base64 text back into the original bytes.[System.Text.Encoding]::ASCII.GetString(...)turns those bytes into readable text. ASCII is a basic character encoding, a way of mapping numbers to letters.| IEXpipes the resulting text intoIEX, short for Invoke-Expression, which runs whatever text it is given as PowerShell code. This is the key trick: the script never exists as a file on disk, it is decoded and run straight from memory.- The final comment notes that the encoded file is then deleted.
The scripts loaded without being caught. He attempted local privilege escalation, meaning trying to go from an ordinary user to an administrator on the same machine, but found nothing to escalate.
Step 11: Mapping the network with BloodHound
He ran SharpHound and moved the collected data to his local machine for BloodHound. SharpHound is a collector that gathers information about an Active Directory network: who is in which group, who is logged in where, and what permissions exist. BloodHound is a program that draws that information as a graph, so you can see paths from one account to a more powerful one. Loading the data took time because of thousands of AD objects. An object here means any item in the directory, such as a user, a group or a computer.
He advises always looking for Outbound ACLs, because they are the hidden link between two AD objects. An ACL (Access Control List) is a list of who is allowed to do what to an object. An outbound ACL on an object says what that object is allowed to do to others, for example "this user may reset that account's password". These links are easy to miss but are often the path to more power.
Some compromised users had PS-Session over some machines. PS-Session is a PowerShell remote session, a way to run commands on another computer over the network. He used those accounts to gain the PS Session and started to enumerate the privileges.
Step 12: Stealing password material from memory
Some users had Full Privileges over their respective machines, meaning they could do anything on that computer. He used that to dump LSASS.exe with procdump.exe. LSASS is a core Windows process that handles logins, and it keeps password material in memory while users are logged in. Dumping it means making a copy of its memory contents to a file. procdump.exe is a legitimate Microsoft tool for capturing a program's memory, and the report notes this is stealthy because it is Microsoft-signed, so antivirus and EDR tools do not flag it.
He moved the .dmp file (the memory dump) to his local machine and ran Mimikatz against it. Mimikatz is a well-known tool that extracts passwords and password hashes from Windows memory dumps. He obtained the NTLM hash of a user who is a member of a privileged group. A hash is a one-way fingerprint of a password: you cannot read the password from it, but Windows can check a login against it. NTLM is the older Windows authentication protocol that uses these hashes.
He did not have Local Administrator Privilege over his controlled machine, so he could only perform pass-the-hash over the PS-Session. Pass-the-hash means using the hash itself to log in, without ever knowing the plain password, because the protocol accepts the hash as proof.
Step 13: A reverse shell, and a firewall in the way
A colleague wrote an undetectable reverse shell in Go. A reverse shell is a program that connects back from the victim machine to the attacker, giving the attacker a command line. Go is a programming language. They copied that binary to the remote computer with the PS-Session and tried PTH using Invoke-Mimikatz to run the reverse shell with PowerCat. PTH is pass-the-hash again; Invoke-Mimikatz is a PowerShell version of Mimikatz; PowerCat is a PowerShell tool for making network connections, often used to get a shell.
It ran and they got the privileged group user rights, but they stopped because of an issue: they were inside a firewall and could not query the DC directly for further movement. A firewall is a filter that blocks or allows network traffic between machines. The DC is the domain controller, the central server that answers login and directory questions for the whole Windows network. He also notes he did not realise at that point that he had a plain text password for the same user in the dump.
Step 14: Abusing permissions and reading LAPS
From the user through which he got initial access, he was able to change an account password with GenericAll ACL rights. GenericAll is a Windows permission meaning "full control" over an object, so it includes the right to reset that account's password. After using the password-changed account, he was able to view the LAPS password via AllExtendedRights over a machine. LAPS (Local Administrator Password Solution) is a Microsoft feature that gives every Windows machine its own random local administrator password and stores it in Active Directory, so administrators do not share one password everywhere. AllExtendedRights is a permission that includes reading that stored password. That machine turned out to be a waste of time to proceed with.
Step 15: Domain Admin and the domain controller
BloodHound showed that the compromised user from the LSASS dump had a session on a machine where one of the domain admins also had a session. A domain admin is the most powerful kind of account in a Windows network. Using the plain text password, he did lateral movement with PS-Session and dumped LSASS with procdump.exe again. Lateral movement means moving from one machine to another inside a network. This time he got the plain text password for a Domain Admin.
Logging into the DC, he dumped the NTDS.dit file and the Registry Hives. NTDS.dit is the database file where Active Directory stores all its accounts and password hashes. The registry is Windows' central settings store, and its hives are the files that hold it; they contain further password material. He added the accounts he required for persistence, meaning accounts that would let him get back in later, and dumped all hashes from the enterprise using secretsdump. Secretsdump is a tool that extracts hashes from these files.
The output on his machine was:
aidenpearce369@jackdaw:~/DC5-LSASSDump$ ls
RegHive allHashes.txt log.dmp ntds.dit
aidenpearce369@jackdaw:~/DC5-LSASSDump$ cat allHashes.txt | grep ':::' | grep -v "$:" | wc -l
43856
aidenpearce369@jackdaw:~/DC5-LSASSDump$ cat allHashes.txt | grep ':::' | grep "$:" | wc -l
48587
aidenpearce369@jackdaw:~/DC5-LSASSDump$
Line by line:
aidenpearce369@jackdaw:~/DC5-LSASSDump$is the prompt: it shows the user name, the machine name (jackdaw), the current folder (~/DC5-LSASSDump) and a$meaning "ready for a command".lslists the files in the current folder. The output showsRegHive(the registry hives),allHashes.txt(the extracted hashes),log.dmp(a memory dump) andntds.dit(the directory database).cat allHashes.txtprints the hash file.| grep ':::'keeps only lines containing three colons, which is the format secretsdump uses for account entries.| grep -v "$:"removes lines containing$:. In Windows, machine accounts end with a$, so this keeps only human user accounts.| wc -lcounts the lines.wcmeans word count, and-lmeans count lines. The result is43856user account hashes.- The second command is the same but without
-v, so it keeps only the lines with$:, the machine accounts. The result is48587machine account hashes.
So the two counts separate user account hashes from machine account hashes: 43856 user account hashes and 48587 machine account hashes.
Why it worked
The report does not point to one single coding mistake. The compromise came from a chain of weaknesses, each of which the report describes:
- SQL injection in multiple web applications, including blind injection in MSSQL-backed sites where a common database was synced across many applications. This exposed email addresses and passwords stored in plain text.
- Plain text password storage, which the author calls a bad security practice.
- Credentials committed to a git repository by internal developers testing API functionality, and not removed from the commit.
- SSL certificates on internal domains exposing those domains and their IP addresses to Shodan, plus an open RDP port on 3389.
- Weak, predictable passwords: one harvested credential worked against O365, and a second spray with default combinations for the domain compromised nearly 60 accounts while respecting the lockout policy.
- Excessive AD permissions: GenericAll on an account, AllExtendedRights over a machine, Full Privileges over machines, and PS-Session access for ordinary users.
- A domain admin session on a machine where a compromised user also had a session, which allowed the LSASS dump to yield the Domain Admin plain text password.
The EDR and antivirus products on the initial machine did not stop in-memory PowerShell execution or the Microsoft-signed procdump.exe, which is why the author describes those as the paths that worked. The report does not say which products were deployed.
What the attacker ended up with
Under the conditions described, the chain gave the team:
- Full database contents from MySQL-backed applications, and data from blind MSSQL injection, including email addresses and plain text passwords.
- Knowledge of internal domains and internal web applications from database and table names.
- Exposed internal domains with IP addresses and an open RDP port into the organisation.
- A working O365 credential, then Azure AD enumeration of users, groups, devices and domains.
- Nearly 60 compromised accounts from the second spray.
- A privileged group user's NTLM hash and plain text password, and later the Domain Admin plain text password.
- The
NTDS.ditfile and registry hives from the DC, with43856user account hashes and48587machine account hashes extracted, plus persistence accounts added.
The report does not quantify what data the client's business held or what the client's response was. The Exchange Server episode is explicitly described as a decoy that produced a shell but no working command execution.
What should be fixed
The report does not describe remediation performed by the client. The weaknesses it identifies point to the following, which are the author's observations rather than a stated fix list:
- Eliminate SQL injection in the web applications and stop storing passwords in plain text.
- Remove credentials from git history and stop committing test scripts with secrets.
- Reduce what SSL certificates and exposed services reveal, and close unnecessary RDP exposure.
- Enforce a strong password policy so that default combinations and simple domain-based combinations do not work, and so that spraying does not yield dozens of accounts.
- Review AD ACLs, in particular GenericAll, AllExtendedRights and Full Privileges grants, and limit PS-Session access.
- Limit where domain admin sessions are established, since a domain admin session on a shared machine was the step that yielded the Domain Admin password.
Things you could try yourself
These are the same checks, phrased as tests you could run on a system you are allowed to test:
- Run the same subdomain pipeline against another scope and probe with
httpx -silent -sc. A positive result is a set of live subdomains, especially ones named for internal applications that answer from the public internet. - Test dynamic parameters for SQL injection and identify the database product by manual fuzzing. A positive result is error or timing behaviour that differs by database product, which then justifies the sqlmap request-file workflow above.
- Query the federation endpoint for each in-scope domain. A positive result is a response showing the domain is federated, which makes O365 spraying relevant.
- Fetch the OpenID configuration for the tenant and use the returned Tenant ID with
Connect-AzureAD. A positive result is a successful connection that allowsGet-AzureADUser,Get-AzureADGroupandGet-AzureADDeviceenumeration. - Spray a small, lockout-aware set of default combinations. A positive result is any valid credential, which then feeds cloud enumeration.
- On a foothold, load Base64-encoded PowerShell into memory with
IEXwhen direct download is blocked. A positive result is script execution without an antivirus or EDR alert. - Run SharpHound and inspect Outbound ACLs in BloodHound. A positive result is ACL edges such as GenericAll or AllExtendedRights that allow password changes or LAPS reads.
- Dump LSASS with the Microsoft-signed procdump.exe where full privileges over a machine are held, then analyse the dump with Mimikatz. A positive result is an NTLM hash or plain text password for a more privileged user.
- Check whether privileged users have sessions on machines where a compromised user also has a session. A positive result is a path to a domain admin credential through a second LSASS dump.
Glossary
- Red team engagement: an authorised, simulated attack on an organisation, run to find weaknesses before real attackers do.
- Assume Breach Scenario: an exercise that starts from the assumption that an attacker is already inside, and tests how far they can go.
- Blue team: the defenders in a security exercise.
- Domain: the part of a web address after
www, such asexample.com. - Subdomain: a smaller name under a domain, such as
mail.example.com. - Subdomain enumeration: finding all subdomains belonging to a domain.
- Dorking: using advanced search features to find information that was not meant to be public.
- Shodan: a search engine for internet-connected devices and servers.
- API: a way for one program to talk to another.
- API key: a password-like string that lets a program use another company's service.
- Pipe (
|): a way to feed the output of one command into another. - Status code: the three-digit number a web server returns, such as 200 for success or 404 for not found.
- Static site: a website that shows the same content to everyone.
- Dynamic feature: a website feature that changes based on what the visitor sends, such as a search box or login form.
- SQL: Structured Query Language, the language used to talk to databases.
- Database: an organised store of data, like a very large, strict spreadsheet.
- SQL injection: a bug where a website pastes visitor input into a database question without cleaning it, letting the visitor change the question.
- XML: a text format for structured data using tags.
- XML External Entity (XXE): a bug where a program reading XML is tricked into fetching a file or address the attacker chooses.
- Open redirection: a bug where a website sends visitors to any address supplied in a link, without checking.
- Injection attack: an attack that inserts malicious input into a system so it is treated as instructions.
- Front end: the part of an application users see and interact with.
- Back end: the database and logic behind an application.
- Server: the machine and software that answers requests.
- .NET: Microsoft's programming framework.
- IIS: Internet Information Services, Microsoft's web server software.
- MSSQL: Microsoft SQL Server, Microsoft's database product.
- MySQL: a popular open-source database product.
- PHP: a programming language often used for websites.
- WordPress: a very common website-building product.
- sqlmap: a tool that automates finding and exploiting SQL injection.
- Parameter: one piece of data sent to a website, such as
?id=5in a URL or a form field. - Table: one grid of data inside a database, such as a list of users.
- Blind SQL injection: injection where the site does not show the database's answer, so data must be inferred from behaviour.
- Brute force: trying many possibilities until one works.
- Plain text: data stored without any scrambling or hashing, readable by anyone.
- IP address: the numeric address of a machine on a network.
- SSL certificate: the digital document that proves a website's identity and enables the padlock in the browser.
- RDP: Remote Desktop Protocol, the Windows feature for controlling another computer's screen remotely.
- Port: a numbered network door on a machine; RDP normally uses 3389.
- Credentials: a username and password, or similar, used to log in.
- Git commit: a saved snapshot in a version-control system used by developers.
- grep: a command that searches text for lines matching a pattern.
- bash: the standard command-line shell on Linux and macOS.
- Mitigation: a defence put in place to reduce risk.
- MS Exchange Server: Microsoft's email server product.
- OWA: Outlook Web App, the web page where employees read email in a browser.
- ProxyShell: a set of known Exchange bugs that can be chained to take over the server.
- Burp Suite: a tool that sits between your browser and a website so you can inspect and change requests.
- Fuzzing: sending many slightly varied inputs to see how a system reacts.
- Response header: the small block of information a server sends before the page itself.
- Exploit: code that takes advantage of a specific bug.
- Shell: a command line on a machine.
- Rabbit hole: a promising lead that turns out to be a dead end.
- FQDN: Fully Qualified Domain Name, the complete name of a machine such as
mail.example.com. - SSO: Single Sign-On, one login shared across many services.
- JSON: a simple text format for structured data.
- Federated Service: a login setup where one organisation's system trusts another's to handle sign-ins.
- AD (Active Directory): Microsoft's system for managing users, groups and computers on a network.
- Password spraying: trying one or a few common passwords against many accounts.
- Account lockout: a rule that locks an account after too many wrong password guesses.
- O365 Sprayer: a tool for password spraying against Microsoft 365.
- Azure AD: Microsoft's cloud version of Active Directory.
- PowerShell: Microsoft's command-line tool for automating tasks.
- Module: a bundle of extra commands loaded into PowerShell.
- Tenant: a company's own separate space inside Microsoft's cloud.
- Tenant ID: the unique identifier of a tenant.
- Enumeration: listing things out one by one.
- Group: a collection of accounts that share permissions.
- Account Lockout Policy: the rule defining how many wrong guesses are allowed and how long a lock lasts.
- Privilege: what an account is allowed to do.
- AV (antivirus): software that looks for known bad files.
- EDR: Endpoint Detection and Response, a tool that watches what programs do on a computer.
- Process: a running program.
- Compiling: turning source code into a runnable program.
- Base64 encoding: writing any data using only letters, digits and a few symbols, so it looks like harmless gibberish.
- Variable: a named box that holds a value.
- ASCII: a basic character encoding that maps numbers to letters.
- IEX: Invoke-Expression, a PowerShell command that runs whatever text it is given.
- Local privilege escalation: going from an ordinary user to an administrator on the same machine.
- SharpHound: a collector that gathers information about an Active Directory network.
- BloodHound: a program that draws Active Directory data as a graph to show paths to more powerful accounts.
- Object: any item in a directory, such as a user, group or computer.
- ACL: Access Control List, a list of who is allowed to do what to an object.
- Outbound ACL: a permission saying what an object is allowed to do to others.
- PS-Session: a PowerShell remote session for running commands on another computer.
- Full Privileges: complete control over a machine.
- LSASS: a core Windows process that handles logins and keeps password material in memory.
- procdump.exe: a legitimate Microsoft tool for capturing a program's memory.
- Mimikatz: a tool that extracts passwords and hashes from Windows memory dumps.
- NTLM hash: a one-way fingerprint of a password used by the older Windows authentication protocol.
- Local Administrator Privilege: administrator rights on a specific machine.
- Pass-the-hash (PTH): logging in using a password hash instead of the plain password.
- Reverse shell: a program that connects back from the victim machine to the attacker, giving a command line.
- Go: a programming language.
- Invoke-Mimikatz: a PowerShell version of Mimikatz.
- PowerCat: a PowerShell tool for making network connections, often used to get a shell.
- Firewall: a filter that blocks or allows network traffic between machines.
- DC (domain controller): the central server that answers login and directory questions for a Windows network.
- GenericAll: a Windows permission meaning full control over an object.
- LAPS: Local Administrator Password Solution, a Microsoft feature giving each machine its own random local administrator password stored in Active Directory.
- AllExtendedRights: a permission that includes reading the LAPS password.
- Domain admin: the most powerful kind of account in a Windows network.
- Lateral movement: moving from one machine to another inside a network.
- NTDS.dit: the database file where Active Directory stores all accounts and password hashes.
- Registry hives: the files that hold Windows' central settings store.
- Persistence: accounts or methods that let an attacker get back in later.
- secretsdump: a tool that extracts hashes from directory and registry files.
- Prompt: the text showing the user, machine and folder, ready for a command.
- wc: a command that counts words, lines or characters in text.