❌

Normal view

There are new articles available, click to refresh the page.
Before yesterdayHacking and InfoSec

Open Source Intelligence (OSINT): Finding Leaked Secrets with TruffleHog

10 September 2026 at 09:36

Welcome back, cyberwarriors!Β 

You’ve probably seen people committing their env files to GitHub without noticing it. When you’re looking for a job as a coder, that mistake alone is significant enough to get you rejected if it happens during the technical portion. And if it ever happened to you, it’s happened to plenty of others too.

Today we’ll look at TruffleHog. It’s a tool that scans Git repositories and their full history for secrets that got committed by accident. It uses high entropy checks with custom regular expressions to catch strings that look like API keys, tokens, passwords and other sensitive data. You can point it at one repository or use a GitHub or GitLab API to hit a lot of projects in one go.

A developer can delete a key from the latest commit, but it will still live in Git’s past. With those credentials, you access services without making much noise.

Installation

First install git-dumper and TruffleHog. The Python package and the GitHub release are not the same, so pay attention to which one you’re on.

kali > pip3 install git-dumper  
kali > pip3 install trufflehog

We’ll use git-dumper when we find an exposed .git directory and then run TruffleHog against that dump. Leaked .git folders are still common.

Dump a Repository

Some servers leave the entire .git directory open. Below you can see a website where it was fully accessible.

viewing exposed git directory

Dump it by giving git-dumper the URL and a local folder for the files.

kali > git-dumper http://example.com/.git dump
dumping exposed git directory with git-dumper

Other websites block the directory listing but still serve some of the files.

Git-dumper can pull every object, commit and reference it can reach.

kali > git-dumper http://example.com/.git/  dump

Everything will be stored in the dump folder.

Analyzing the Repositories

Once the dump is on disk, run TruffleHog against it. By default it runs entropy-based matching. That can help, but it shouldn’t be the only mode you know. In our case, regex with entropy off gave us more results.Β 

kali > trufflehog --regex --entropy NO dump
experimenting with tufflehog flags

discovered credentials with trufflehog

In one of the files we found database credentials.

You can also install TruffleHog from the GitHub release and scan the filesystem directly:

kali > curl -sSfL https://raw.githubusercontent.com/trufflesecurity/trufflehog/main/scripts/install.sh | sh -s -- -b /usr/local/bin 

kali > trufflehog filesystem /home/kali/Documents/dump  
trufflehog filesystem mode

This build is fine for tuning your scans, but it often makes more noise and false positives, so just be aware of it.

Other Ways to Analyze Repositories

Depending on which build you’re using, try these flags to change what you get in the output.

Scan a repo for verified secrets:

kali > trufflehog git https://github.com/trufflesecurity/test_keys --results=verified,unknown
scanning for verified secrets with trufflehog

Verified means TruffleHog checked these finding live against the service API (AWS, GitHub and so on). Unknown is both high entropy and regex hits that it couldn’t confirm.

Same scan with JSON output:

kali > trufflehog git https://github.com/trufflesecurity/test_keys --results=verified,unknown --json
scanning all repos of an organization with trufflehog

Scan a GitHub repo including issues and pull requests:

kali > trufflehog github --repo=https://github.com/trufflesecurity/test_keys --issue-comments --pr-comments  
scanning issues comments and pull requests with trufflehog

finding gems with trufflehog

That digs into issues, comments, PR bodies and comments. You can find leaks in discussions too.

Scan a local Git repo:

kali > trufflehog git file://test_keys --results=verified,unknown  

Useful when you’ve compromised a dev Linux machine with multiple projects on it. There’s a better chance of finding something locally than pushed to GitHub, although both can happen, as you now know.

Summary

We had an external pentest where several services were accessible but no credentials could be found. Surprisingly, some developers had kept projects they were doing for the company publicly accessible on GitHub. Eventually we found a working pair and got into a database.

TruffleHog can be really helpful here. Sensitive files sometimes get exposed without the publisher even knowing it. We’re humans and we make mistakes. Offensive or defensive, the point is the same.

The post Open Source Intelligence (OSINT): Finding Leaked Secrets with TruffleHog first appeared on Hackers Arise.

Pentesting: Stealing Credentials with LOLCreds and CredsHound

14 August 2026 at 08:39

Welcome back, cyberwarriors!

When you just land on a new machine, you often have to sit down and go through every running service just to figure out what’s actually installed and which of those apps might be worth a closer look for credentials in a config somewhere. You can’t skip this part, as it usually gives you something you’ll need later in the engagement, but it eats time. A lot of it.

There are older tools that try to do something similar, but the two we’re covering today are more current. LOLCreds and CredsHound come from the same developer and they cover a huge amount of software.

So let’s see how they work.

LOLCreds

LOLCreds is a website that has 678 different credentials. Some software generates a password when you install it or prompts you to enter it. There are also static credentials that are baked into the product. The D-Link backdoor credentials are a good example of the second kind.Β 

LOLCreds also tracks AI API keys and shows you exactly where to find them on a system. Here’s what it has on Cursor.

MySQL is a more basic example. Its password is often hidden in a config file or sitting as a variable in the env file.

CredsHound

All of that is great when you already know what software you’re hunting through and you’re picking it one at a time. But machines might have dozens of applications running. Software can be removed, but configs stay and password reuse is common. You can use CredsHound for this hunt.Β 

CredsHound is a scanner written in Go. Under the hood it pulls templates from LOLCreds so it can run product aware checks. It has been fully optimized for modern environments, so it will scan everything from DBeaver encrypted databases to OpenCode, GitHub Copilot CLI, Hugging Face, OpenAI and more.Β 

Setting Up

Before you start using the scanner, you need to have Go installed.

bash$ > sudo apt install golang
bash$ > go install github.com/haxxm0nkey/credshound/cmd/credshound@latest

Once that finishes, you may run into a common issue where the Go binaries aren’t included in your system path yet. Add them yourself:

bash$ > sudo echo β€œexport PATH:$PATH:/home/user/go/bin” >> /etc/profile
bash$ > source /etc/profile

Now we’re ready.

How to Use

There are different ways you can run it, but you always start with updating the template library. The scanner can be used with different privileges, but we’ll use root.Β 

# Update templates 
bash# > credshound -ut

# Scan /etc 
bash# > credshound -t /root/.cache/credshound/templates /etc

Our system is fresh, so there’s not much on it yet. A box that’s been sitting in prod for a while will have more interesting results, like the one below.

CredsHound can also work with BloodHound to show you the relationships between credentials as a graph. Here’s how to set it up:

ubuntu$ > credshound -t ~/lolcreds-templates -bloodhound -o credshound-bloodhound.json .

Then you import the JSON file into BloodHound and see what comes up.

When you’ve collected many of these JSON files from different machines, you’ll start seeing the architecture of what you’re testing.

A few more commands you’ll find useful:

# Scan the current directory
bash$ > credshound .

# Scan multiple roots
bash$ > credshound ~/project /etc

# Scan only env variables
bash$ > credshound -sources env

# Scan current and process environment variables on Linux
bash$ > credshound -sources env,proc

Summary

Credential hunting is a tedious thing when you do it manually, but you can’t really skip this part. It’s essential to move further. The tools covered can make the whole process easier and the output rich. LOLCreds has a reference library for different products and CredsHound can scan your hosts for secrets with results that you may import into BloodHound.

If you like red teaming, we have our Red Team Operator training, where we cover more tools and techniques to help you emulate real APT work, so you can give a company a realistic stress test and help make it secure.

The post Pentesting: Stealing Credentials with LOLCreds and CredsHound first appeared on Hackers Arise.

❌
❌