Name | certleak JSON |
Version |
0.1.0
JSON |
| download |
home_page | None |
Summary | Python tool to monitor and analyze TLS certificates as they are issued via certstream. |
upload_time | 2024-12-20 00:24:08 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.9 |
license | MIT License Copyright (c) 2023 d-Rickyy-b Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
python
certificate
tls
osint
framework
|
VCS |
|
bugtrack_url |
|
requirements |
certstream
dnstwist
requests
tldextract
|
Travis-CI |
No Travis.
|
coveralls test coverage |
|
[![certleak logo created by https://t.me/AboutTheDot](https://raw.githubusercontent.com/d-Rickyy-b/certleak/master/docs/certleak_logo.png)](https://github.com/d-Rickyy-b/certleak)
# certleak - Cert-Monitoring Python Framework
[![Run tests and lint](https://github.com/d-Rickyy-b/certleak/workflows/Run%20tests%20and%20lint/badge.svg)](https://github.com/d-Rickyy-b/certleak/actions?query=workflow%3A%22Run+tests+and+lint%22)
[![PyPI version](https://badge.fury.io/py/certleak.svg)](https://pypi.org/project/certleak/)
[![Coverage Status](https://coveralls.io/repos/github/d-Rickyy-b/certleak/badge.svg?branch=master)](https://coveralls.io/github/d-Rickyy-b/certleak?branch=master)
Certleak is a tool to monitor and analyze TLS certificates as they are issued.
It is heavily inspired by [Phishing Catcher](https://github.com/x0rz/phishing_catcher) by [x0rz](https://twitter.com/x0rz).
It utilizes the [Certificate Transparency Network](https://www.certificate-transparency.org/what-is-ct), which is an ecosystem for publicly monitoring issuance of TLS certificates.
A regular use case of this tool is to find phishing domains before they are actively used in the wild.
Instead of querying the single transparency log servers individually, certleak uses [certstream](https://certstream.calidog.io/) for analyzing certificates in real time.
To do that, it uses about 2600-3000 kbit/s of bandwidth.
Since certleak uses certstream, it only enables you to analyze live data.
There is no way to use this tool to analyze certificates that have been issued in the past or while being offline.
## Extensibility
Creating new analyzers or actions is as easy as creating a new python file.
Certleak is built with extensibility in mind.
Check the [analyzer docs](https://github.com/d-Rickyy-b/certleak/tree/master/certleak/analyzers/README.md) as well as the [actions docs](https://github.com/d-Rickyy-b/certleak/tree/master/certleak/actions/README.md).
## Installation
Simply use pip to install this tool.
```bash
pip install certleak
```
## Usage
After downloading and installing the package, you only need to create a small python script in which you import certleak and set up the analyzers and the belonging actions.
Below you'll find an example configuration. Keep in mind that it's fully up to you what analyzers you want to add and which actions you want to be executed.
In general the workflow is as follows: `New Certificate -> Analyzer matches -> Actions are executed`
```python
import logging
from pathlib import Path
from certleak import CertLeak
from certleak.actions import LogAction, DatabaseAction
from certleak.analyzers import (FullDomainAnalyzer, TLDAnalyzer, WildcardCertAnalyzer, X509Analyzer, LetsEncryptAnalyzer,
RegexDomainAnalyzer, DNStwistAnalyzer)
from certleak.database import SQLiteDB
certleak = CertLeak()
# Set up database
path = Path.cwd().absolute() / "phish.db"
db = SQLiteDB(str(path))
# Set up actions
db_action = DatabaseAction(db)
logaction = LogAction(level=logging.INFO, template="${analyzer_name} found: ${leaf_cert.subject.CN} () - ${leaf_cert.all_domains}")
# Set up analyzers
xyz_tld_analyzer = TLDAnalyzer(logaction, ["xyz"], blacklist="acmetestbykeychestdotnet") & X509Analyzer()
phishing_analyzer = FullDomainAnalyzer([db_action, logaction], ["paypal", "amazon"])
regex_analyzer = RegexDomainAnalyzer([db_action, logaction], r"([^.]*-)?pay[-_]?pa[l1i][-.].*")
wildcard_analyzer = WildcardCertAnalyzer([db_action, logaction]) & X509Analyzer()
letsencrypt_analyzer = LetsEncryptAnalyzer(db_action) & X509Analyzer()
# Set up DNStwist Analyzer - generates a list of potential phishing domains at start. Based on the DNStwist module.
dns = DNStwistAnalyzer(logaction, "paypal.com") & X509Analyzer()
certleak.add_analyzer(dns)
certleak.add_analyzer(xyz_tld_analyzer)
certleak.add_analyzer(phishing_analyzer)
certleak.add_analyzer(regex_analyzer)
certleak.add_analyzer(wildcard_analyzer)
certleak.add_analyzer(letsencrypt_analyzer)
certleak.start()
```
You can find [full example files](https://github.com/d-Rickyy-b/certleak/tree/master/certleak/examples) in this repo as well.
### License
This tool is released under the MIT license.
If you found this tool helpful and want to support me, drop me a coffee at the link below.
[![Buy me a coffee](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://buymeacoffee.com/0rickyy0)
Raw data
{
"_id": null,
"home_page": null,
"name": "certleak",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "python, certificate, tls, osint, framework",
"author": null,
"author_email": "d-Rickyy-b <certleak@rico-j.de>",
"download_url": "https://files.pythonhosted.org/packages/27/00/10e6a318315ea876c690c784d82508321813d5fea292a71d114f78abf3ba/certleak-0.1.0.tar.gz",
"platform": null,
"description": "[![certleak logo created by https://t.me/AboutTheDot](https://raw.githubusercontent.com/d-Rickyy-b/certleak/master/docs/certleak_logo.png)](https://github.com/d-Rickyy-b/certleak)\n\n# certleak - Cert-Monitoring Python Framework\n\n[![Run tests and lint](https://github.com/d-Rickyy-b/certleak/workflows/Run%20tests%20and%20lint/badge.svg)](https://github.com/d-Rickyy-b/certleak/actions?query=workflow%3A%22Run+tests+and+lint%22)\n[![PyPI version](https://badge.fury.io/py/certleak.svg)](https://pypi.org/project/certleak/)\n[![Coverage Status](https://coveralls.io/repos/github/d-Rickyy-b/certleak/badge.svg?branch=master)](https://coveralls.io/github/d-Rickyy-b/certleak?branch=master)\n\nCertleak is a tool to monitor and analyze TLS certificates as they are issued.\nIt is heavily inspired by [Phishing Catcher](https://github.com/x0rz/phishing_catcher) by [x0rz](https://twitter.com/x0rz).\n\nIt utilizes the [Certificate Transparency Network](https://www.certificate-transparency.org/what-is-ct), which is an ecosystem for publicly monitoring issuance of TLS certificates.\n\nA regular use case of this tool is to find phishing domains before they are actively used in the wild.\n\nInstead of querying the single transparency log servers individually, certleak uses [certstream](https://certstream.calidog.io/) for analyzing certificates in real time.\nTo do that, it uses about 2600-3000 kbit/s of bandwidth.\nSince certleak uses certstream, it only enables you to analyze live data.\nThere is no way to use this tool to analyze certificates that have been issued in the past or while being offline.\n\n## Extensibility\n\nCreating new analyzers or actions is as easy as creating a new python file.\nCertleak is built with extensibility in mind.\nCheck the [analyzer docs](https://github.com/d-Rickyy-b/certleak/tree/master/certleak/analyzers/README.md) as well as the [actions docs](https://github.com/d-Rickyy-b/certleak/tree/master/certleak/actions/README.md). \n\n## Installation\n\nSimply use pip to install this tool.\n\n```bash\npip install certleak\n```\n\n## Usage\n\nAfter downloading and installing the package, you only need to create a small python script in which you import certleak and set up the analyzers and the belonging actions.\nBelow you'll find an example configuration. Keep in mind that it's fully up to you what analyzers you want to add and which actions you want to be executed.\n\nIn general the workflow is as follows: `New Certificate -> Analyzer matches -> Actions are executed`\n\n```python\nimport logging\nfrom pathlib import Path\n\nfrom certleak import CertLeak\nfrom certleak.actions import LogAction, DatabaseAction\nfrom certleak.analyzers import (FullDomainAnalyzer, TLDAnalyzer, WildcardCertAnalyzer, X509Analyzer, LetsEncryptAnalyzer,\n RegexDomainAnalyzer, DNStwistAnalyzer)\nfrom certleak.database import SQLiteDB\n\ncertleak = CertLeak()\n\n# Set up database\npath = Path.cwd().absolute() / \"phish.db\"\ndb = SQLiteDB(str(path))\n\n# Set up actions\ndb_action = DatabaseAction(db)\nlogaction = LogAction(level=logging.INFO, template=\"${analyzer_name} found: ${leaf_cert.subject.CN} () - ${leaf_cert.all_domains}\")\n\n# Set up analyzers\nxyz_tld_analyzer = TLDAnalyzer(logaction, [\"xyz\"], blacklist=\"acmetestbykeychestdotnet\") & X509Analyzer()\nphishing_analyzer = FullDomainAnalyzer([db_action, logaction], [\"paypal\", \"amazon\"])\nregex_analyzer = RegexDomainAnalyzer([db_action, logaction], r\"([^.]*-)?pay[-_]?pa[l1i][-.].*\")\n\nwildcard_analyzer = WildcardCertAnalyzer([db_action, logaction]) & X509Analyzer()\nletsencrypt_analyzer = LetsEncryptAnalyzer(db_action) & X509Analyzer()\n\n# Set up DNStwist Analyzer - generates a list of potential phishing domains at start. Based on the DNStwist module.\ndns = DNStwistAnalyzer(logaction, \"paypal.com\") & X509Analyzer()\n\ncertleak.add_analyzer(dns)\ncertleak.add_analyzer(xyz_tld_analyzer)\ncertleak.add_analyzer(phishing_analyzer)\ncertleak.add_analyzer(regex_analyzer)\ncertleak.add_analyzer(wildcard_analyzer)\ncertleak.add_analyzer(letsencrypt_analyzer)\n\ncertleak.start()\n```\n\nYou can find [full example files](https://github.com/d-Rickyy-b/certleak/tree/master/certleak/examples) in this repo as well.\n\n### License\n\nThis tool is released under the MIT license.\n\nIf you found this tool helpful and want to support me, drop me a coffee at the link below.\n\n[![Buy me a coffee](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://buymeacoffee.com/0rickyy0)\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2023 d-Rickyy-b Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
"summary": "Python tool to monitor and analyze TLS certificates as they are issued via certstream.",
"version": "0.1.0",
"project_urls": {
"Homepage": "https://github.com/d-Rickyy-b/certleak",
"Issues": "https://github.com/d-Rickyy-b/certleak/issues"
},
"split_keywords": [
"python",
" certificate",
" tls",
" osint",
" framework"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2f7c8a2196e5241d509970e85299426f7e4060ab2d2e3416ca4e1f2d3d712f8f",
"md5": "10de1975dbbdc5f1be4809f07d1d2dd1",
"sha256": "af653560d6151cc6bf2949a80d5ba6575237aaf97ddd5df7656da3971b5779cb"
},
"downloads": -1,
"filename": "certleak-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "10de1975dbbdc5f1be4809f07d1d2dd1",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 56812,
"upload_time": "2024-12-20T00:24:06",
"upload_time_iso_8601": "2024-12-20T00:24:06.566572Z",
"url": "https://files.pythonhosted.org/packages/2f/7c/8a2196e5241d509970e85299426f7e4060ab2d2e3416ca4e1f2d3d712f8f/certleak-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "270010e6a318315ea876c690c784d82508321813d5fea292a71d114f78abf3ba",
"md5": "1fd2caebf954942601af924e6c9e975e",
"sha256": "27de6be36d9c0c5769bdaaff79a91266c403abdb145d5a5682320617c28b509f"
},
"downloads": -1,
"filename": "certleak-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "1fd2caebf954942601af924e6c9e975e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 79091,
"upload_time": "2024-12-20T00:24:08",
"upload_time_iso_8601": "2024-12-20T00:24:08.148013Z",
"url": "https://files.pythonhosted.org/packages/27/00/10e6a318315ea876c690c784d82508321813d5fea292a71d114f78abf3ba/certleak-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-20 00:24:08",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "d-Rickyy-b",
"github_project": "certleak",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"requirements": [
{
"name": "certstream",
"specs": [
[
"<",
"2"
],
[
">=",
"1.12"
]
]
},
{
"name": "dnstwist",
"specs": [
[
">=",
"20240812"
]
]
},
{
"name": "requests",
"specs": [
[
">=",
"2.32"
]
]
},
{
"name": "tldextract",
"specs": [
[
">=",
"5.0"
]
]
}
],
"lcname": "certleak"
}