{"id":18374718,"url":"https://github.com/jupiterone/nslookup-shodan","last_synced_at":"2025-04-06T20:30:41.605Z","repository":{"id":41976883,"uuid":"302967177","full_name":"JupiterOne/nslookup-shodan","owner":"JupiterOne","description":null,"archived":false,"fork":false,"pushed_at":"2023-12-05T17:50:10.000Z","size":482,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-22T06:25:10.370Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JupiterOne.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null}},"created_at":"2020-10-10T18:37:46.000Z","updated_at":"2022-06-25T18:47:26.000Z","dependencies_parsed_at":"2023-12-05T18:46:32.982Z","dependency_job_id":"2f9944bf-e914-4baf-9d49-0220d95208c2","html_url":"https://github.com/JupiterOne/nslookup-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/JupiterOne%2Fnslookup-shodan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JupiterOne%2Fnslookup-shodan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JupiterOne%2Fnslookup-shodan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JupiterOne%2Fnslookup-shodan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JupiterOne","download_url":"https://codeload.github.com/JupiterOne/nslookup-shodan/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247547026,"owners_count":20956475,"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":[],"created_at":"2024-11-06T00:15:45.570Z","updated_at":"2025-04-06T20:30:41.314Z","avatar_url":"https://github.com/JupiterOne.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nslookup-shodan\n\nThis repo contains an automation script to enrich the domain records mapping in a JupiterOne account.\nThe script performs the following actions:\n\n- Run a J1QL query to retrieve a list of `DomainRecord` entities that do not already connect with an\n  existing target entity in the graph.\n\n- For each \"orphaned record\":\n  \n  - Perform `nslookup` to get the target IP address.\n\n  - Use the IP address to perform a **Shodan** query to retrieve some host details, without performing \n    an active scan of the host.\n\n  - If the host has port 443 open, connect via HTTPS to retrieve certificate information.\n\n  - Create the `discovered_host` entity and connect the `DomainRecord` entity to it in the JupiterOne\n    graph.\n\n## How to use it\n\nInstall `node.js` and `yarn` locally.\n\nCreate a `.env` file locally in the project root directory, with your JupiterOne account ID, API key, \nand Shodan API key. The file should look like this:\n\n```text\nJ1_ACCOUNT_ID=abc\nJ1_API_TOKEN=........\nSHODAN_TOKEN=........\n```\n\nNext, run the script:\n\n```bash\nyarn \u0026\u0026 yarn start\n```\n\nThe script uses JupiterOne Bulk Upload / Synchronization API, which completes the update to graph\nasynchronously in the background. It typically takes less than a few minutes to complete after the\nupload.\n\nYou can run the following J1QL query to see the graph:\n\n```j1ql\nFIND DomainRecord THAT CONNECTS discovered_host RETURN TREE\n```\n\nHere's an example screenshot:\n\n![graph](graph.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjupiterone%2Fnslookup-shodan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjupiterone%2Fnslookup-shodan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjupiterone%2Fnslookup-shodan/lists"}