{"id":20706840,"url":"https://github.com/PercussiveElbow/Shodan","last_synced_at":"2025-05-10T20:31:03.223Z","repository":{"id":83724420,"uuid":"160990914","full_name":"PercussiveElbow/Shodan","owner":"PercussiveElbow","description":"Crystal library for the Shodan API.","archived":false,"fork":false,"pushed_at":"2021-12-20T11:56:32.000Z","size":742,"stargazers_count":9,"open_issues_count":3,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-17T01:29:01.664Z","etag":null,"topics":["api","crystal","crystal-lang","shodan"],"latest_commit_sha":null,"homepage":"","language":"Crystal","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PercussiveElbow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-09T00:30:29.000Z","updated_at":"2024-08-20T20:32:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"c1e6b3bb-7553-40b6-9521-f3c9e518a50c","html_url":"https://github.com/PercussiveElbow/Shodan","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PercussiveElbow%2FShodan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PercussiveElbow%2FShodan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PercussiveElbow%2FShodan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PercussiveElbow%2FShodan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PercussiveElbow","download_url":"https://codeload.github.com/PercussiveElbow/Shodan/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253480372,"owners_count":21915245,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","crystal","crystal-lang","shodan"],"created_at":"2024-11-17T01:23:56.578Z","updated_at":"2025-05-10T20:31:03.202Z","avatar_url":"https://github.com/PercussiveElbow.png","language":"Crystal","funding_links":[],"categories":["Crystal Search Automation Tools"],"sub_categories":[],"readme":"# Shodan Crystal\n\n![Main](https://github.com/PercussiveElbow/ShodanCrystalAPI/workflows/Main/badge.svg?branch=master)\n\nCrystal library for the Shodan [REST API](https://developer.shodan.io/api).\n\nBig thanks to https://github.com/shadowscatcher/shodan for existing - made figuring out JSON structures much easier.:+1:\n\n# Installation\nAdd the library as a dependency within your _shards.yml_\n```\ndependencies:\n  shodan:\n      github: percussiveelbow/shodan\n```\n\n\n# Usage\n## Setup\n```\n# Create client object\nclient = Shodan::Client.new(\"api_key_here\")\n```\n\n## Search methods\n```\n# Lookup data of host\nhost_data = client.host(\"1.2.3.4\")\n\n# Search hosts\nsearch_result = client.host_search(\"Minecraft Server\", port: \"25565\", facets: { country: 1})\n\n# Get count of search\nhost_count = client.host_count(\"Minecraft Server\", port: \"25565\")\n\n# Get valid search filters\nfilters = client.filters()\n\n# Get valid search facets\nfacets = client.facets()\n\n# Get ports Shodan crawlers are looking for\nports = client.ports()\n```\n\n## Scan methods\n```\n# To scan hosts\nscan = client.scan([\"1.2.3.4\",\"5.6.7.8\"])\n\n# To retrieve the result of a scan\nscan_result = client.scan(\"scan_id_here\")\n\n# Get valid protocols that can be used to scan\nprotocols = client.protocols()\n```\n\n## Directory methods\n```\n# To obtain list of search queries users have saved\ndirectory_query_result = client.directory_query()\n\n# Get a list of popular tags for the saved search queries\ndirectory_query__tags_result = client.directory_query_tags()\n\n# To search saved search queries\ndirectory_query_search_results = client.directory_query_search(\"compromised\")\n```\n\n## DNS methods\n```\n# To get DNS data for a domain\ndomain_result = client.domain(\"google.com\")\n\n# To resolve a domain\nresolve_result = client.dns_resolve([\"google.com\"])\n\n# To reverse search IPs\nreverse_result = client.dns_reverse([\"1.2.3.4\"])\n```\n\n## Utility methods\n```\n# To get your IP\nip = client.my_ip()\n\n# To get your HTTP headers\nhttp_headers = client.http_headers()\n```\n\n## Account method\n```\n# To get account data linked to the API key\naccount_data = client.account()\n```\n\n## API Status\n```\n# To obtain info about the current API plan\napi_info = client.api_status()\n```\n\n## Experimental\n```\n# Get honeyscore result for an IP \nhoneyscore_result = client.honeyscore(\"1.2.3.4\")\n```\n\nFurther details about object models are available in `/docs`\n\n\n\n# Current Shodan API support:\n\n- [X] Shodan Search Methods\n- [X] Shodan On-Demand Scanning\n- [X] Shodan Directory Methods\n- [X] Account Methods\n- [X] DNS Methods\n- [X] Utility Methods\n- [X] API Status Methods\n- [X] Experimental\n- [ ] Shodan Network Alerts\n- [ ] Notifiers\n\n\n###  Enterprise endpoints (Not implemented)\n- [ ] Shodan Bulk Data (Enterprise)\n- [ ] Manage Organisation (Enterprise)\n- [ ] Internet Scanning (Enterprise/Research)\n\n# License\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPercussiveElbow%2FShodan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FPercussiveElbow%2FShodan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPercussiveElbow%2FShodan/lists"}