Skip to main content

Used to get API data from Infocyte Cloud Instances into the pandas DataFrame

Project description

Infocyte API Query

made-with-python PyPI version PyPI pyversions PyPI license Maintenance Python package pytest Python package pytest on Windows CodeQL

Description:

Python module | Used to get API data from Infocyte Cloud Instances into the pandas DataFrame | Defaults to 90 days

Required Modules (Installed as prerequisite)

  • requests (Addition)
  • pandas (Addition)
  • paginateit (Addition)
  • tqdm (Addition)
  • json
  • subprocess
  • re

Installation

pip install --upgrade infocyteapiquery

How to use API Query?

Takes 3 arguments:

  • cname --> Cloud Instance Name <cname.infocyte.com>

  • apikey --> APIKEY or the API Token

  • apiquery --> API GET Method

     >>> from infocyteapiquery import infocyteapiquery as ic
     >>> cname = "m...n"
     >>> apikey = "J8ARPa3iQR6...8HGUkElBBXra4mdEq"
     >>> apiquery = "ModuleDetails"
     >>>
     >>> icdata = ic.query(cname, apikey, apiquery)
     Loading ModuleDetails:  100%|█████████████████████████████████████████████████████████████ | 9/9 Loop(s)
     >>>
     >>> icdata.shape
     (9183, 37)
     >>>
     >>> icdata.columns
     Index(['size', 'signatureType', 'serialNumber', 'subjectName', 'issuerName', 'timestampIssuer', 'timestampSubject', 'id', 'fileRepId', 'staticAnalysis', 'dynamicAnalysis', 'localBlacklist', 'localWhitelist', 'blacklist', 'whitelist',
    'malicious', 'notMalicious', 'suspicious', 'unknown', 'threatScore', 'threatName', 'threatWeight', 'compromised', 'failed', 'hasAvScan', 'avPositives', 'avTotal', 'synapse', 'flagId', 'flagName', 'flagColor', 'flagWeight',
    'name', 'path', 'managed', 'signed', 'md5', 'sha1', 'sha256', 'ssdeep'],
     (dtype='object')
    

How to use PowerShell Query?

Takes 3 arguments:

  • cname --> Cloud Instance Name <cname.infocyte.com>

  • apikey --> APIKEY or the API Token

  • pscmd --> PowerShell Script Commands

     >>> from infocyteapiquery import infocyteapiquery as ic
     >>> cname = "m...n"
     >>> apikey = "J8ARPa3iQR6...8HGUkElBBXra4mdEq"
     >>> 
     >>>pscmd = '''
     ... $psvariable = Get-ICAlert
     ... ($psvariable).name
     ... '''
     >>> psdata = ic.ps(cname, apikey, pscmd)
     Loading : 100%|███████████████████████████████████████████████████████████████████████ | 1/1 Line(s)
     >>>
     >>> print(psdata)
     rdpwrap.dll
     calculator.exe
     rundll32.exe
     ...
     ...
     cmd.exe
     python.exe
     cmd.exe
    

How to use Encoded PowerShell Query?

Takes 3 arguments:

  • cname --> Cloud Instance Name <cname.infocyte.com>

  • apikey --> APIKEY or the API Token

  • psecmd --> PowerShell Script Commands Support Pipe and Complex filters

     >>> from infocyteapiquery import infocyteapiquery as ic
     >>> cname = "m...n"
     >>> apikey = "J8ARPa3iQR6...8HGUkElBBXra4mdEq"
     >>> 
     >>>psecmd = '$man = Get-ICAlert;($man).name|Sort-Object|Get-Unique'
     >>> psedata = ic.pse(cname, apikey, psecmd)
     Loading : 100%|███████████████████████████████████████████████████████████████████████ | 1/1 Line(s)
     >>>
     >>> print(psedata)
     BitComet_1.74_setup.exe
     bitcomet_setup_EBTmD-1.exe
     calc.exe
     Calculator.exe
     calculator.exe
     Calculator.exe
     ...
     ...
     cmd.exe
     python.exe
    

Note: PowerShell output is extracted in string format (Refer PowerShell "ConvertTo" feature for more details)

Query and PowerShell Tips & Tricks

Please refer Wiki Section of Github for details. Wiki here

License

© 2021 Manjesh N

This repository is licensed under the Apache 2.0 license. See LICENSE for more details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

infocyteapiquery-1.1.16.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

infocyteapiquery-1.1.16-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file infocyteapiquery-1.1.16.tar.gz.

File metadata

  • Download URL: infocyteapiquery-1.1.16.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for infocyteapiquery-1.1.16.tar.gz
Algorithm Hash digest
SHA256 a39e1d8072ac8b62ef02713ee8bc1207a859741e23d263857d2c1b1c1fa30140
MD5 7ac88030953350ee50418a0e7533fa8f
BLAKE2b-256 4d4d4f9b3d44c9320d91746ee6278a76241623b3fe98ad9f7cee48be08e53817

See more details on using hashes here.

File details

Details for the file infocyteapiquery-1.1.16-py3-none-any.whl.

File metadata

  • Download URL: infocyteapiquery-1.1.16-py3-none-any.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for infocyteapiquery-1.1.16-py3-none-any.whl
Algorithm Hash digest
SHA256 264a04a0bda2dc12f577681e63297cdd212aea62a96a7762c0d342b286b3f071
MD5 5bf41c4466011d08ddd4d0c15ae5e6e9
BLAKE2b-256 edd2dbe1878ebdda56915ad048d0ce2e9e4ce554556adc664d788993a6ab471f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page