# Pinkerton | An JavaScript File Crawler And Secret Finder Developed In Python

**URL:** <https://onehack.st/t/pinkerton-an-javascript-file-crawler-and-secret-finder-developed-in-python/257632>\
**Category:** Tools & Scripts\
**Tags:** hacking\
**Created:** [October 5, 2023, 9:40pm UTC](https://onehack.st/t/pinkerton-an-javascript-file-crawler-and-secret-finder-developed-in-python/257632 "2023-10-05T21:40:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![PlayBoy83](https://onehack.st/user_avatar/onehack.st/playboy83/32/164314_2.png) [@PlayBoy83](https://onehack.st/u/PlayBoy83)\
**Post date:** [October 5, 2023, 9:40pm UTC](https://onehack.st/t/pinkerton-an-javascript-file-crawler-and-secret-finder-developed-in-python/257632/1 "2023-10-05T21:40:35Z")

</div>

![image](https://onehack.st/uploads/default/original/3X/1/6/16c61b65b066b27f52f1eb78cc1560ed5f847048.png)

# [🕵 Pinkerton](https://github.com/oppsec/Pinkerton#%EF%B8%8F-pinkerton)

> Investigating JavaScripts files since 1850

[![](https://camo.githubusercontent.com/f7d7b0c498770a92a0ba811c7d338447a041a5603215f720ecc2b1d03daf109f/68747470733a2f2f692e696d6775722e636f6d2f477650737045612e706e67)](https://camo.githubusercontent.com/f7d7b0c498770a92a0ba811c7d338447a041a5603215f720ecc2b1d03daf109f/68747470733a2f2f692e696d6775722e636f6d2f477650737045612e706e67)

[![](https://camo.githubusercontent.com/03a3d0e7d2c0814a23935dec11c9a563d7562a040ee7fed17df8998897814b9b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6f70707365632f50696e6b6572746f6e3f636f6c6f723d79656c6c6f77266c6f676f3d676974687562267374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/03a3d0e7d2c0814a23935dec11c9a563d7562a040ee7fed17df8998897814b9b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6f70707365632f50696e6b6572746f6e3f636f6c6f723d79656c6c6f77266c6f676f3d676974687562267374796c653d666f722d7468652d6261646765) [![](https://camo.githubusercontent.com/abc141b84735bc091aec5a8a58966402fcb3f5c5673cab928b844c723fec3446/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f6f70707365632f50696e6b6572746f6e3f636f6c6f723d79656c6c6f77266c6f676f3d676974687562267374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/abc141b84735bc091aec5a8a58966402fcb3f5c5673cab928b844c723fec3446/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f6f70707365632f50696e6b6572746f6e3f636f6c6f723d79656c6c6f77266c6f676f3d676974687562267374796c653d666f722d7468652d6261646765) [![](https://camo.githubusercontent.com/ed87d851b7b5b4262244597372fe0bfc3857a4cc70edbfb9d07fe1d3f0719e7d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6f70707365632f70696e6b6572746f6e3f636f6c6f723d79656c6c6f77266c6f676f3d676974687562267374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/ed87d851b7b5b4262244597372fe0bfc3857a4cc70edbfb9d07fe1d3f0719e7d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6f70707365632f70696e6b6572746f6e3f636f6c6f723d79656c6c6f77266c6f676f3d676974687562267374796c653d666f722d7468652d6261646765) [![](https://camo.githubusercontent.com/e291c917453b35d5d6807dc48ebe3860d476a60b2bfc346bfa248533d6994537/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f6f70707365632f50696e6b6572746f6e3f636f6c6f723d79656c6c6f77266c6f676f3d676974687562267374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/e291c917453b35d5d6807dc48ebe3860d476a60b2bfc346bfa248533d6994537/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f6f70707365632f50696e6b6572746f6e3f636f6c6f723d79656c6c6f77266c6f676f3d676974687562267374796c653d666f722d7468652d6261646765) [![](https://camo.githubusercontent.com/03b536a7c4009d67384c1476166a59e35b118bc6a3362acd7a416a8c959fb301/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f6f70707365632f70696e6b6572746f6e3f636f6c6f723d79656c6c6f77266c6f676f3d676974687562267374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/03b536a7c4009d67384c1476166a59e35b118bc6a3362acd7a416a8c959fb301/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f6f70707365632f70696e6b6572746f6e3f636f6c6f723d79656c6c6f77266c6f676f3d676974687562267374796c653d666f722d7468652d6261646765) [![](https://camo.githubusercontent.com/b508806766299cf0bb30dc3e70b0c2cda39f20bd500171d269386d983787dc69/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f636f64652d73697a652f6f70707365632f50696e6b6572746f6e3f636f6c6f723d79656c6c6f77266c6f676f3d676974687562267374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/b508806766299cf0bb30dc3e70b0c2cda39f20bd500171d269386d983787dc69/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f636f64652d73697a652f6f70707365632f50696e6b6572746f6e3f636f6c6f723d79656c6c6f77266c6f676f3d676974687562267374796c653d666f722d7468652d6261646765) [![](https://camo.githubusercontent.com/0fbd5fc1311daeeb22284a99885803a22f9ccc0fce0726e3424dce0878a8a895/68747470733a2f2f696d672e736869656c64732e696f2f6c6962726172696573696f2f6769746875622f6f70707365632f70696e6b6572746f6e3f636f6c6f723d79656c6c6f77266c6f676f3d676974687562267374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/0fbd5fc1311daeeb22284a99885803a22f9ccc0fce0726e3424dce0878a8a895/68747470733a2f2f696d672e736869656c64732e696f2f6c6962726172696573696f2f6769746875622f6f70707365632f70696e6b6572746f6e3f636f6c6f723d79656c6c6f77266c6f676f3d676974687562267374796c653d666f722d7468652d6261646765)

* * *

🕵 **Pinkerton** is an JavaScript file crawler and secret finder tool developed in Python

## [⚡ Installing / Getting started](https://github.com/oppsec/Pinkerton#-installing--getting-started)

A quick guide of how to install and use Pinkerton.

```auto
1. Clone the repository with: git clone https://github.com/oppsec/pinkerton.git
2. Install the libraries with: pip3 install -r requirements.txt
3. Run Pinkerton with: python3 main.py -u https://example.com

```

### [🐳 Docker](https://github.com/oppsec/Pinkerton#-docker)

If you want to use pinkerton in a Docker container, follow this commands:

```auto
1. Clone the repository - git clone https://github.com/oppsec/pinkerton.git
2. Build the image - sudo docker build -t pinkerton:latest .
3. Run container - sudo docker run pinkerton:latest

```

### [⚙ Pre-requisites](https://github.com/oppsec/Pinkerton#%EF%B8%8F-pre-requisites)

- [Python 3](https://www.python.org/downloads/) installed on your machine.
- Install the libraries with `pip3 install -r requirements.txt`

### [🎥 Demo](https://github.com/oppsec/Pinkerton#-demo)

[![asciicast](https://camo.githubusercontent.com/c421b070ddaa95748cda5b8d7528d843bceabc7a14033afa53140243809820c9/68747470733a2f2f61736369696e656d612e6f72672f612f534444744c4652506361754759315a3557464c6373633064492e737667)](https://asciinema.org/a/SDDtLFRPcauGY1Z5WFLcsc0dI)

### [✨ Features](https://github.com/oppsec/Pinkerton#-features)

- Works with ProxyChains
- Fast scan
- Low RAM and CPU usage
- Open-Source
- Python ❤

### [📚 To-Do](https://github.com/oppsec/Pinkerton#-to-do)

- Add more secrets regex pattern
- Improve JavaScript file extract function
- Improve pattern match system
- Add pass list file method

### [🔨 Contributing](https://github.com/oppsec/Pinkerton#-contributing)

A quick guide of how to contribute with the project.

```auto
1. Create a fork from Pinkerton repository
2. Clone the repository with git clone https://github.com/your/pinkerton.git
3. Type cd pinkerton/
4. Create a branch and make your changes
5. Commit and make a git push
6. Open a pull request

```

### [🙏 Credits](https://github.com/oppsec/Pinkerton#-credits)

- [m4ll0k (SecretFinder creator)](https://github.com/m4ll0k) for the regex patterns
- [h33lit (Jubaer Alnazi)](https://github.com/h33tlit) for the regex patterns
- [zricethezav (GitLeaks creator)](https://github.com/zricethezav/gitleaks) for the regex patterns

### [⚠ Warning](https://github.com/oppsec/Pinkerton#%EF%B8%8F-warning)

- The developer is not responsible for any malicious use of this tool.

## GitHub:

> **[GitHub - 0xdsm/Pinkerton: 🕵️ Python project to crawl for JavaScript files...](https://github.com/0xdsm/Pinkerton)**
>
> 🕵️ Python project to crawl for JavaScript files and search for secrets like API keys, authorization tokens, hardcoded credentials, etc.
