# gdetect library & client
A Python client and a library for GLIMPS Gmalware detect.
GLIMPS Gmalware detect 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 detection 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_by_uuid(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": null,
"name": "gdetect",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "python, glimps, detection, gmalware, malware, gdetect",
"author": null,
"author_email": "GLIMPS dev core team <contact@glimps.re>",
"download_url": "https://files.pythonhosted.org/packages/54/0d/0b1158458e95522b3e9a87907bdb1dcf94f02b40f282eb63141a2d0eaf59/gdetect-0.8.0.tar.gz",
"platform": null,
"description": "# gdetect library & client\n\nA Python client and a library for GLIMPS Gmalware detect.\n\nGLIMPS Gmalware detect 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\n`gdetect` library aims to simplify use of *GLIMPS Detect*, a malware detection 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_by_uuid(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": null,
"summary": "Library and CLI for GLIMPS Detect API",
"version": "0.8.0",
"project_urls": null,
"split_keywords": [
"python",
" glimps",
" detection",
" gmalware",
" malware",
" gdetect"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "931cf6321a91c73e3bdcbddb0b2c55654897b2274759b0dcb82689cbd09d74cc",
"md5": "bd41d95206b41f965f31b4e94a7a1de2",
"sha256": "dd7c60901b11bf594b4073071fa099f53382625949d399d138609fab339ce97b"
},
"downloads": -1,
"filename": "gdetect-0.8.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "bd41d95206b41f965f31b4e94a7a1de2",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 13676,
"upload_time": "2024-11-18T14:42:47",
"upload_time_iso_8601": "2024-11-18T14:42:47.847185Z",
"url": "https://files.pythonhosted.org/packages/93/1c/f6321a91c73e3bdcbddb0b2c55654897b2274759b0dcb82689cbd09d74cc/gdetect-0.8.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "540d0b1158458e95522b3e9a87907bdb1dcf94f02b40f282eb63141a2d0eaf59",
"md5": "137bda2abd2919b3cb9f74223fc3763c",
"sha256": "0de2497b4b3d494caa030dc81a28010211f430bd1604494a0972cbb52013f931"
},
"downloads": -1,
"filename": "gdetect-0.8.0.tar.gz",
"has_sig": false,
"md5_digest": "137bda2abd2919b3cb9f74223fc3763c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 17324,
"upload_time": "2024-11-18T14:42:49",
"upload_time_iso_8601": "2024-11-18T14:42:49.116032Z",
"url": "https://files.pythonhosted.org/packages/54/0d/0b1158458e95522b3e9a87907bdb1dcf94f02b40f282eb63141a2d0eaf59/gdetect-0.8.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-18 14:42:49",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "gdetect"
}