README
InQuest platform v3 Python client with CLI interface.
Install with pip
pip install iqcli
Install with pipenv
This client includes a CLI interface. To set it up with pipenv:
- Create a virtual environment and install
pipenv:
python3 -m venv venv
. venv/bin/activate
pip install -U pip pipenv
- Install dependencies with
pipenv:
pipenv install
Follow the remaining steps only for CLI setup.
- Create a configuration file from the default template:
cp config.yml.dist config.yml
- Edit
config.ymland set up server details.
InQuest Command Line Driver
Usage:
./iq-cli.py [options] session export <id>
./iq-cli.py [options] file search [--limit=<limit>] [--eventid=<eventid>] [--signature-name=<signature-name>] [--signature-category=<signature-category>]
./iq-cli.py [options] file download id <id> [--output=<output>] [--dfi-output=<dfi-output>]
./iq-cli.py [options] file download hash <(md5|sha1|sha256|sha512)> [--output=<output>] [--dfi-output=<dfi-output>]
./iq-cli.py [options] file scan <input>
./iq-cli.py [options] saved-search <id> [--limit=<limit>]
Options:
--api=<apikey> Specify an API key.
--host=<hostname> API server hostname.
--secure=<true|false> Use HTTPS if true, HTTP if false [default: true].
--verify-tls=<true|false> Verify validity of TLS certificate when using HTTPS [default: true].
--limit Maximum number of entries [default: 25].
--eventid Event ID of the Signature hit.
--signature-name Name of the Signature hit.
--signature-category Category of the Signature hit.
--output=<output> Target file. If not set, the file will be streamed to stdout.
--dfi-output=<dfi-output> Target location for DFI content. If not set, DFI content will not be downloaded.
CLI examples
pipenv
./iq-cli.py --api APIKEY --host SERVER --secure true --verify-tls true session export ID
./iq-cli.py --api APIKEY --host SERVER --secure true --verify-tls true file search --limit LIMIT --eventid EVENTID --signature-name SIGNATURE_NAME --signature-category SIGNATURE_CATEGORY
./iq-cli.py --api APIKEY --host SERVER --secure true --verify-tls true file download id ID --output /path/to/target/file --dfi-output /path/to/target/folder
./iq-cli.py --api APIKEY --host SERVER --secure true --verify-tls true file download hash HASH --output /path/to/target/file --dfi-output /path/to/target/folder
./iq-cli.py --api APIKEY --host SERVER --secure true --verify-tls true file scan /path/to/target/file
./iq-cli.py --api APIKEY --host SERVER --secure true --verify-tls true saved-search ID --limit LIMIT
pip
iqcli --api APIKEY --host SERVER --secure true --verify-tls true session export ID
iqcli --api APIKEY --host SERVER --secure true --verify-tls true file search --limit LIMIT --eventid EVENTID --signature-name SIGNATURE_NAME --signature-category SIGNATURE_CATEGORY
iqcli --api APIKEY --host SERVER --secure true --verify-tls true file download id ID --output /path/to/target/file --dfi-output /path/to/target/folder
iqcli --api APIKEY --host SERVER --secure true --verify-tls true file download hash HASH --output /path/to/target/file --dfi-output /path/to/target/folder
iqcli --api APIKEY --host SERVER --secure true --verify-tls true file scan /path/to/target/file
iqcli --api APIKEY --host SERVER --secure true --verify-tls true saved-search ID --limit LIMIT
API Interface
Configuration and examples:
#!/usr/bin/env python
import simplejson as json
# pipenv
import api
from lib import client
# pip
import iqcli.api
from iqcli.lib import client
client.config = {
'apikey': '0000000000000000000000000000000000000000',
'server': {
'host': 'xxxxxx',
'secure': True,
'verify': False,
}
}
# Get full session info by ID
entity = api.session.export(session_id=1)
# Search by Signature Category:
result = api.search.files(
limit=2,
signature_category='FileID',
)
# Search by Signature Name
result = api.search.files(
limit=2,
signature_name='Adobe PDF',
)
# Search by Signature EventID
result = api.search.files(
limit=2,
eventid=1000000,
)
# Iterate over search results
for file in result:
print(json.dumps(file, indent=4))
# Download File by ID
api.file.download_by_id(1, output='/tmp/file.out', dfi_output='/tmp/dfi')
# Download File by Hash
api.file.download_by_hash('00000000000000000000000000000000', output='/tmp/file.out', dfi_output='/tmp/dfi')
# Scan File
api.file.scan('/tmp/file.in')
# Run a saved search
api.search.saved(1, limit=2)
Metadata
Release files for iqcli 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| iqcli-1.0.0.tar.gz | 17.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| iqcli-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 36.4 kB
Release files / iqcli-1.0.0.tar.gz
| Download URL | iqcli-1.0.0.tar.gz |
|---|---|
| Size | 17.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7f1cdeaafa27e729b507127712a68dd42c0403dcc8c05f94a2f9c5c8741990d4
|
|
BLAKE2b-256 checksum How to use checksums |
62e5f89e95a6ee73caed570d39ced30c14c410e32d92b14209f4a94202e60f97
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.9.6 readme-renderer/37.3 requests/2.28.0 requests-toolbelt/0.10.1 urllib3/1.26.12 tqdm/4.65.0 importlib-metadata/6.0.0 keyring/23.13.1 rfc3986/1.5.0 colorama/0.4.6 CPython/3.11.3
|
Release files / iqcli-1.0.0-py3-none-any.whl
| Download URL | iqcli-1.0.0-py3-none-any.whl |
|---|---|
| Size | 19.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7776424adea552aeeec43685f6d3ee89b7ee4c181171d5d49f6e6554bf110325
|
|
BLAKE2b-256 checksum How to use checksums |
98462aa8ab5e46d835beaa20173c51c854a0ef6950da878ccbb506ade61d86ba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.9.6 readme-renderer/37.3 requests/2.28.0 requests-toolbelt/0.10.1 urllib3/1.26.12 tqdm/4.65.0 importlib-metadata/6.0.0 keyring/23.13.1 rfc3986/1.5.0 colorama/0.4.6 CPython/3.11.3
|
Security for iqcli 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.