# Gdetect library & client
a Python client and a library for GLIMPS Gmalware detect.
Gdetect is a solution from GLIMPS *Inc.* for a better detection of malware. Contact us at <contact@glimps.re> for more information !
## Description
Gdetect library aims to simplify use of *Glimps Detect*, a malware detectio solution from GLIMPS *Inc.*.
This tool can be used by two ways:
* As *shell* CLI: `python3 -m gdetect /path/to/my/binary`
* As python library (see below).
## Installation
### From PyPI
```bash
python3 -m pip install gdetect
```
## Usage
### As shell *CLI* tool
Before launch the tool, you can set the path to your GDetect URL and your authentication token into environment variables with:
`export API_URL=https://my.gdetect.service.tld` for the URL;
`export API_TOKEN=abcdef01-23456789-abcdef01-23456789-abcdef01` for the token.
You can use *gdetect* in your shell like this:
* `python3 -m gdetect /path/to/my/binary` to send your binary to API. This command return an UUID to you (*send* is the default command, so you don't need to specify this).
* `python3 -m gdetect get my_returned_uuid` to get your result.
* To have some help: `python3 -m gdetect --help`:
```bash
Usage: python -m gdetect [OPTIONS] COMMAND [ARGS]...
Options:
--url TEXT url to GLIMPS Detect API
--token TEXT authentication token
--password TEXT password used to extract archive
--insecure disable HTTPS check
--no-cache submit file even if a result already exists
--help Show this message and exit.
Commands:
send* send file to API.
get get result for given uuid.
waitfor send a file and wait for the result.
search get result for given sha256.
```
* `python3 -m gdetect waitfor /path/to/my/binary` allows you to send your binary and wait for a result (*blocking mode*). You can pass a `--timeout X` option with an integer to stop after X minutes.
### As a Python library
All stuff are done with a `Client` object from `gdetect.api`:
```python
from gdetect import Client # direct object import set in __init__ file
client=Client(url='https://path/to/my/gdetect/service', token='qwerty012345678')
uuid=client.push('my_bad_binary.exe')
# wait some minutes to get a result
result=client.get(uuid)
print(result)
```
Look at documentation for details about available methods, exceptions and more. To build internal documentation, uses `tox` tool inside your local clone of this repository (need extra packages: `pip install -r requirements-dev.txt`):
```bash
tox -e docs
```
All documentations are now inside `docs/_build/html` directory.
## Support
If you have any questions, open an *issue* on Github.
## Contributing
If you want to contribute, just follow the [Github PR flow](https://docs.github.com/en/get-started/quickstart/github-flow#create-a-pull-request).
Install all needed library from `requirements-dev.txt` ; update it if needed.
Coverage your code with test (please use `pytest` for that).
Before submit your *pull request*, please use `black` as formatter, `pylint` (`tox -e pylint`) and `flake8` (`tox -e flake8`) as linter and test your code throught many versions. To do that, you can use `tox` (look at `tox.ini` for options). Just launch `tox` to do that.
## Authors
***GLIMPS dev core team***
## License
This project is under **MIT License**.
## Project status
This project is in *Beta* development status. Feel free to participate !
Raw data
{
"_id": null,
"home_page": "",
"name": "gdetect",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "python,glimps,detection,gmalware,malware,gdetect",
"author": "GLIMPS dev core team",
"author_email": "contact@glimps.re",
"download_url": "https://files.pythonhosted.org/packages/79/a4/8b38ab41efdb25e7d3ca59640fb3a010e988f48179891c6125ae53aa367c/gdetect-0.5.1.tar.gz",
"platform": null,
"description": "# Gdetect library & client\n\na Python client and a library for GLIMPS Gmalware detect.\n\nGdetect is a solution from GLIMPS *Inc.* for a better detection of malware. Contact us at <contact@glimps.re> for more information ! \n\n## Description\n\nGdetect library aims to simplify use of *Glimps Detect*, a malware detectio solution from GLIMPS *Inc.*.\nThis tool can be used by two ways:\n\n* As *shell* CLI: `python3 -m gdetect /path/to/my/binary`\n* As python library (see below).\n\n## Installation\n\n### From PyPI\n\n```bash\npython3 -m pip install gdetect\n```\n\n## Usage\n\n### As shell *CLI* tool\n\nBefore launch the tool, you can set the path to your GDetect URL and your authentication token into environment variables with:\n\n`export API_URL=https://my.gdetect.service.tld` for the URL; \n`export API_TOKEN=abcdef01-23456789-abcdef01-23456789-abcdef01` for the token.\n\nYou can use *gdetect* in your shell like this:\n\n* `python3 -m gdetect /path/to/my/binary` to send your binary to API. This command return an UUID to you (*send* is the default command, so you don't need to specify this).\n* `python3 -m gdetect get my_returned_uuid` to get your result.\n* To have some help: `python3 -m gdetect --help`:\n\n```bash\nUsage: python -m gdetect [OPTIONS] COMMAND [ARGS]...\n\nOptions:\n --url TEXT url to GLIMPS Detect API\n --token TEXT authentication token\n --password TEXT password used to extract archive\n --insecure disable HTTPS check\n --no-cache submit file even if a result already exists\n --help Show this message and exit.\n\nCommands:\n send* send file to API.\n get get result for given uuid.\n waitfor send a file and wait for the result.\n search get result for given sha256.\n```\n\n* `python3 -m gdetect waitfor /path/to/my/binary` allows you to send your binary and wait for a result (*blocking mode*). You can pass a `--timeout X` option with an integer to stop after X minutes.\n\n### As a Python library\n\nAll stuff are done with a `Client` object from `gdetect.api`:\n\n```python\nfrom gdetect import Client # direct object import set in __init__ file\n\nclient=Client(url='https://path/to/my/gdetect/service', token='qwerty012345678')\nuuid=client.push('my_bad_binary.exe')\n# wait some minutes to get a result\nresult=client.get(uuid)\nprint(result)\n```\n\nLook at documentation for details about available methods, exceptions and more. To build internal documentation, uses `tox` tool inside your local clone of this repository (need extra packages: `pip install -r requirements-dev.txt`):\n\n```bash\ntox -e docs\n```\n\nAll documentations are now inside `docs/_build/html` directory.\n\n## Support\n\nIf you have any questions, open an *issue* on Github.\n\n## Contributing\n\nIf you want to contribute, just follow the [Github PR flow](https://docs.github.com/en/get-started/quickstart/github-flow#create-a-pull-request).\n\nInstall all needed library from `requirements-dev.txt` ; update it if needed.\n\nCoverage your code with test (please use `pytest` for that).\n\nBefore submit your *pull request*, please use `black` as formatter, `pylint` (`tox -e pylint`) and `flake8` (`tox -e flake8`) as linter and test your code throught many versions. To do that, you can use `tox` (look at `tox.ini` for options). Just launch `tox` to do that.\n\n## Authors\n\n***GLIMPS dev core team***\n\n## License\n\nThis project is under **MIT License**.\n\n## Project status\n\nThis project is in *Beta* development status. Feel free to participate !\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Library and CLI for GLIMPS Detect API",
"version": "0.5.1",
"project_urls": null,
"split_keywords": [
"python",
"glimps",
"detection",
"gmalware",
"malware",
"gdetect"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f88672934779df7c1b649184ca3c1c6bba49cdc80fa9dc23088f2f49ad96d222",
"md5": "f5ecb76f22800e512987236f793345d8",
"sha256": "19e04f320b06085ab1cd0f2b676cf17e6932d34c42bfce67c175ee45ce45ed1a"
},
"downloads": -1,
"filename": "gdetect-0.5.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f5ecb76f22800e512987236f793345d8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 12742,
"upload_time": "2024-03-01T13:12:27",
"upload_time_iso_8601": "2024-03-01T13:12:27.551943Z",
"url": "https://files.pythonhosted.org/packages/f8/86/72934779df7c1b649184ca3c1c6bba49cdc80fa9dc23088f2f49ad96d222/gdetect-0.5.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "79a48b38ab41efdb25e7d3ca59640fb3a010e988f48179891c6125ae53aa367c",
"md5": "366b51828a95c8286ef04370c504d10b",
"sha256": "cb589e1094e9806ccd6fb84b27c96e5dd94589c350c7004b209b213965179c33"
},
"downloads": -1,
"filename": "gdetect-0.5.1.tar.gz",
"has_sig": false,
"md5_digest": "366b51828a95c8286ef04370c504d10b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 15786,
"upload_time": "2024-03-01T13:12:33",
"upload_time_iso_8601": "2024-03-01T13:12:33.756009Z",
"url": "https://files.pythonhosted.org/packages/79/a4/8b38ab41efdb25e7d3ca59640fb3a010e988f48179891c6125ae53aa367c/gdetect-0.5.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-01 13:12:33",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "gdetect"
}