{"id":13582273,"url":"https://github.com/shadowscatcher/shodan","last_synced_at":"2025-04-06T14:30:42.071Z","repository":{"id":37864656,"uuid":"190069426","full_name":"shadowscatcher/shodan","owner":"shadowscatcher","description":"yet another Shodan.io client","archived":false,"fork":false,"pushed_at":"2023-09-08T07:33:44.000Z","size":73,"stargazers_count":92,"open_issues_count":0,"forks_count":9,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-08-02T15:48:22.258Z","etag":null,"topics":["golang","intelligence-gathering","osint","reconnaissance","security-development","shodan"],"latest_commit_sha":null,"homepage":null,"language":"Go","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/shadowscatcher.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":"2019-06-03T19:31:56.000Z","updated_at":"2024-07-31T15:04:26.000Z","dependencies_parsed_at":"2024-06-18T18:37:48.829Z","dependency_job_id":null,"html_url":"https://github.com/shadowscatcher/shodan","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shadowscatcher%2Fshodan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shadowscatcher%2Fshodan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shadowscatcher%2Fshodan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shadowscatcher%2Fshodan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shadowscatcher","download_url":"https://codeload.github.com/shadowscatcher/shodan/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223253812,"owners_count":17114262,"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":["golang","intelligence-gathering","osint","reconnaissance","security-development","shodan"],"created_at":"2024-08-01T15:02:33.590Z","updated_at":"2024-11-05T22:30:47.426Z","avatar_url":"https://github.com/shadowscatcher.png","language":"Go","readme":"# Shodan API for Golang\n\n[![GoDoc](https://img.shields.io/badge/docs-pkg.go.dev-informational?logo=go\u0026style=flat-square)](https://pkg.go.dev/github.com/shadowscatcher/shodan?tab=doc)\n![Build](https://img.shields.io/github/actions/workflow/status/shadowscatcher/shodan/go.yml?branch=master)\n[![Go Report Card](https://goreportcard.com/badge/github.com/shadowscatcher/shodan?style=flat-square)](https://goreportcard.com/report/github.com/shadowscatcher/shodan)\n[![MIT License](https://img.shields.io/badge/license-MIT-informational.svg?style=flat-square)](LICENSE)\n\nYet another one Golang implementation of Shodan REST API client. \nThis library is inspired by amazing [Nikita Safonov](https://github.com/ns3777k/)'s [go-shodan library](https://github.com/ns3777k/go-shodan), but has different data models and query syntax.\n\n## Features\n\n- Library intended to be the most comprehensive and documented out there, letting you learn about all the API methods, search filters and gathered data types using method/model comments in this repo\n- Search syntax allows you to change query without string formatting:\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"github.com/shadowscatcher/shodan\"\n\t\"github.com/shadowscatcher/shodan/search\"\n\t\"github.com/shadowscatcher/shodan/search/ssl_versions\"\n\t\"log\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tnginxSearch := search.Params{\n\t\tPage:1,\n\t\tQuery: search.Query{\n\t\t\tProduct: \"nginx\",\n\t\t\tASN:  \"AS14618\",\n\t\t\tSSLOpts: search.SSLOpts{\n\t\t\t\tCert: search.CertOptions{\n\t\t\t\t\tExpired: true,\n\t\t\t\t},\n\t\t\t\tVersion: ssl_versions.TLSv1_2,\n\t\t\t},\n\t\t},\n\t}\n\n\tclient, _ := shodan.GetClient(os.Getenv(\"SHODAN_API_KEY\"), http.DefaultClient, true)\n\tctx := context.Background()\n\tresult, err := client.Search(ctx, nginxSearch)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tfor _, match := range result.Matches {\n\t\t// a lot of returned data can be used in another searches\n\t\t// it's easy because you will get response with almost all possible fields, just don't forget to check them\n\t\tif match.HTTP != nil \u0026\u0026 match.HTTP.Favicon != nil {\n\t\t\t//newQuery := search.Query{HTTP: search.HTTP{Favicon: search.Favicon{Hash: match.HTTP.Favicon.Hash}}}\n\t\t}\n\t}\n\t\n\t// later on you can change every part of search query or parameters:\n\tnginxSearch.Page++  // for example, increase page\n\tnginxSearch.Query.Port = 443 // or add new search term\n\tresult, err = client.Search(ctx, nginxSearch)  // and reuse modified parameters object\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n```\n\n- Search results contain a lot of types that are ignored by most of the existing libraries, documented where possible:\n\n```go\nfor _, match := range result.Matches {\n\tif match.MongoDB != nil \u0026\u0026 !match.MongoDB.Authentication {\n\t\tfmt.Println(\"exposed mongodb:\", match.IpAndPort())\n\t\tdatabases := match.MongoDB.ListDatabases.Databases\n\n\t\tfmt.Println(\"databases:\", len(databases), \"size:\", match.MongoDB.ListDatabases.TotalSize)\n\t\tfor _, db := range databases {\n\t\t\tfor _, collectionName := range db.Collections {\n\t\t\t\tfmt.Println(collectionName)\n\t\t\t}\n\t\t}\n\t}\n\t\t\n\tif match.SSL != nil \u0026\u0026 match.SSL.Cert.Expired {\n\t\tfmt.Println(\"expired certificate:\", match.IpAndPort())\n\t}\n\t\t\n\tif match.Elastic != nil {\n\t\tfmt.Println(\"exposed elastic:\", match.IpAndPort())\n\t\tfor indexName, index := range match.Elastic.Indices {\n\t\t\tfmt.Println(indexName, index.UUID)\n\t\t}\n\t}\n}\n```\n\n - The client can be configured to automatically make one second pause between requests (this interval required by Shodan's API terms of service).\n","funding_links":[],"categories":["Go","Go Search Automation Tools"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshadowscatcher%2Fshodan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshadowscatcher%2Fshodan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshadowscatcher%2Fshodan/lists"}