{ "info": { "author": "art@censys.io", "author_email": "support@censys.io", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "# Censys BigQuery Command Line Tool\n\nThis script allows users to query the data in Censys Data BigQuery Project from the command line. The results from the query can be exported as JSON, CSV, or viewed from the terminal screen.\n\nNote: the Censys Data BigQuery Project is available to enterprise customers and approved academic researchers. For more information on product tiers, contact sales@censys.io.\n\n##### Setting Up a Service Account in BigQuery:\n\nPrior to using the BiqQuery Command Line Tool, you'll need to set up a service account that is associated with your Google Cloud Platform.\n\nGoogle provides documentation on how to create a service account, either via the GCP Console or the Command Line. Visit https://cloud.google.com/docs/authentication/getting-started for full documentation.\n\nBe sure to set the GOOGLE_APPLICATION_CREDENTIALS environmental variable.\n```$ export GOOGLE_APPLICATION_CREDENTIALS=\"[PATH]\"```\n\n\n##### Installation:\n```\npip install censys_bigquery_cli\n```\nOr\n```\npip install git+https://github.com/censys/bigquery-cli\n```\n\n\n##### Usage:\nThe script allows you to input SQL queries as arguments in the script, returning the results as screen output (default), JSON, or CSV.\n\nHere are some example queries:\n```\n$ censys_bq 'SELECT ip, ports, protocols, tags FROM `censys-io.ipv4_public.current` WHERE location.city = \"Ann Arbor\" and REGEXP_CONTAINS(TO_JSON_STRING(tags), r\"rsa-export\") LIMIT 25'\n```\n```\n$ censys_bq 'with user_ports as ( \nSELECT [443, 3306, 6379] as selected_ports\n)\n\nSELECT DISTINCT ip, TO_JSON_STRING(user_ports.selected_ports)\n FROM `censys-io.ipv4_banners_public.current`, user_ports, UNNEST(services) as s\n WHERE (SELECT LOGICAL_AND(a_i IN (SELECT port_number FROM UNNEST(services))) FROM UNNEST(user_ports.selected_ports) a_i) LIMIT 15' --output csv\n```\n\n```\n$ censys_bq 'SELECT COUNT(ip), p80.http.get.body_sha256\nFROM `censys-io.ipv4_public.current`\nWHERE REGEXP_CONTAINS(p80.http.get.body, r\"(?i)coinhive.min.js>\")\nGROUP BY p80.http.get.body_sha256\nORDER BY 1 DESC' --output json\n```\n\n```\n$ censys_bq 'with Data as (SELECT\n distinct fingerprint_sha256\nFROM\n `censys-io.certificates_public.certificates`, UNNEST(parsed.subject.organization) as po, UNNEST(parsed.names) as parsed_names\nWHERE\n REGEXP_CONTAINS(TO_JSON_STRING(parsed.names), r\"[.]example[.]\")\n)\n\nSELECT\n distinct ip\nFROM\n `censys-io.ipv4_banners_public.current` as c, UNNEST(services)\n JOIN Data as d on d.fingerprint_sha256 = certificate.fingerprints.sha256\nLIMIT 20' --output json\n```\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "censys threat hunting osint ports scan", "license": "", "maintainer": "", "maintainer_email": "", "name": "censys-bigquery-cli", "package_url": "https://pypi.org/project/censys-bigquery-cli/", "platform": "", "project_url": "https://pypi.org/project/censys-bigquery-cli/", "project_urls": null, "release_url": "https://pypi.org/project/censys-bigquery-cli/1.0.0/", "requires_dist": [ "censys", "google-cloud-bigquery", "google-cloud-core" ], "requires_python": ">=3", "summary": "A Command line tool for Censys Enterprise Customers that allows BQ access via the command line.", "version": "1.0.0" }, "last_serial": 5849934, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "b4bd228490c4e25c6fc0289be30387ac", "sha256": "192e64ed2603b4273b5c99c1cb5c90b994f6d544943a17315e801448f21022ae" }, "downloads": -1, "filename": "censys_bigquery_cli-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "b4bd228490c4e25c6fc0289be30387ac", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 9244, "upload_time": "2019-09-18T12:49:47", "url": "https://files.pythonhosted.org/packages/2f/db/d01d78d929f5013a8a079dd34c6e2bfcd93a1b1a33b2d94c087f0e8eac5e/censys_bigquery_cli-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "60ef1d33cdf016c066fc82172b2bae6c", "sha256": "f659d6ae868f0aef107f9a2c26fad0bb480162737e37fa0912924f8bded63226" }, "downloads": -1, "filename": "censys_bigquery_cli-1.0.0.tar.gz", "has_sig": false, "md5_digest": "60ef1d33cdf016c066fc82172b2bae6c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 4017, "upload_time": "2019-09-18T12:49:49", "url": "https://files.pythonhosted.org/packages/9b/2f/dc2abbd25ba2d431a041422e9c34b1924aa072d7000b42776570eee3fa16/censys_bigquery_cli-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b4bd228490c4e25c6fc0289be30387ac", "sha256": "192e64ed2603b4273b5c99c1cb5c90b994f6d544943a17315e801448f21022ae" }, "downloads": -1, "filename": "censys_bigquery_cli-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "b4bd228490c4e25c6fc0289be30387ac", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 9244, "upload_time": "2019-09-18T12:49:47", "url": "https://files.pythonhosted.org/packages/2f/db/d01d78d929f5013a8a079dd34c6e2bfcd93a1b1a33b2d94c087f0e8eac5e/censys_bigquery_cli-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "60ef1d33cdf016c066fc82172b2bae6c", "sha256": "f659d6ae868f0aef107f9a2c26fad0bb480162737e37fa0912924f8bded63226" }, "downloads": -1, "filename": "censys_bigquery_cli-1.0.0.tar.gz", "has_sig": false, "md5_digest": "60ef1d33cdf016c066fc82172b2bae6c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 4017, "upload_time": "2019-09-18T12:49:49", "url": "https://files.pythonhosted.org/packages/9b/2f/dc2abbd25ba2d431a041422e9c34b1924aa072d7000b42776570eee3fa16/censys_bigquery_cli-1.0.0.tar.gz" } ] }