{"id":37110317,"url":"https://github.com/jojonas/db_nmap","last_synced_at":"2026-01-14T13:06:02.573Z","repository":{"id":47441390,"uuid":"415713251","full_name":"jojonas/db_nmap","owner":"jojonas","description":"Standalone Go implementation of Metasploit's \"db_nmap\" and \"db_import\" commands.","archived":false,"fork":false,"pushed_at":"2024-11-06T11:53:21.000Z","size":76,"stargazers_count":16,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-06T12:40:50.538Z","etag":null,"topics":["metasploit","metasploit-framework","networks","nmap","security"],"latest_commit_sha":null,"homepage":"","language":"Go","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/jojonas.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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-10T22:20:15.000Z","updated_at":"2024-11-06T11:53:26.000Z","dependencies_parsed_at":"2024-11-06T12:34:00.668Z","dependency_job_id":"7657e9a5-98b2-4ed5-a650-3e7ba14d3dbe","html_url":"https://github.com/jojonas/db_nmap","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jojonas/db_nmap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jojonas%2Fdb_nmap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jojonas%2Fdb_nmap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jojonas%2Fdb_nmap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jojonas%2Fdb_nmap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jojonas","download_url":"https://codeload.github.com/jojonas/db_nmap/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jojonas%2Fdb_nmap/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28420817,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["metasploit","metasploit-framework","networks","nmap","security"],"created_at":"2026-01-14T13:06:01.981Z","updated_at":"2026-01-14T13:06:02.569Z","avatar_url":"https://github.com/jojonas.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# db_nmap\n\n`db_nmap` and `db_import` are glue commands between [Nmap](https://nmap.org/) and [Metasploit](https://www.metasploit.com/):\n\n- `db_nmap` is a wrapper around Nmap that inserts Nmap's results into the Metasploit PostgreSQL database, right after they are finished scanning.\n- `db_import` is a standalone program that takes an Nmap result XML document and inserts the results into the Metasploit PostgreSQL daabase.\n\nAfter importing the results, they can be inspected with the Metasploit console commands `services` and `hosts`.\n\nBoth commands are actually standalone implementations of the corresponding commands in Metasploit, which are documented [here (`db_nmap`)](https://www.offensive-security.com/metasploit-unleashed/port-scanning/) and [here (`db_import`)](https://www.offensive-security.com/metasploit-unleashed/using-databases/).\n\n## Example\n\nOn my local system, I am currently only running a PostgreSQL database (for Metasploit). I can scan `localhost` with the following command:\n\n    $ db_nmap -sV 127.0.0.1\n    INFO[2021-10-19 18:47:52] Connected to Metasploit PostgreSQL database \"msf\" at 127.0.0.1:5432 as user \"jonas\"\n    DEBU[2021-10-19 18:47:52] ID of Metasploit workspace \"default\": 1\n    DEBU[2021-10-19 18:47:52] Running \"/usr/bin/nmap -sV 127.0.0.1 -oX /dev/fd/3\" ...\n    Starting Nmap 7.92 ( https://nmap.org ) at 2021-10-19 18:47 CEST\n    Nmap scan report for localhost (127.0.0.1)\n    Host is up (0.0000040s latency).\n    Not shown: 999 closed tcp ports (reset)\n    PORT STATE SERVICE VERSION\n    5432/tcp open postgresql PostgreSQL DB 9.6.0 or later\n    1 service unrecognized despite returning data. [...]\n\n    Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .\n    Nmap done: 1 IP address (1 host up) scanned in 6.48 seconds\n    DEBU[2021-10-19 18:47:59] Inserted/updated host 127.0.0.1 (localhost).\n    DEBU[2021-10-19 18:47:59] Inserted/updated service tcp:5432 (PostgreSQL DB).\n    DEBU[2021-10-19 18:47:59] XML document complete.\n    INFO[2021-10-19 18:47:59] Wrapper stats: registered 1 hosts with 1 services.\n\nNote that `db_nmap` used the `nmap` command found in my `PATH`.\nAfter scanning, the results can be retrieved from the Metasploit database:\n\n    $ msfconsole\n    [...]\n\n    msf6 \u003e hosts -c address,name\n\n    Hosts\n    =====\n\n    address    name\n    -------    ----\n    127.0.0.1  localhost\n\n    msf6 \u003e services\n    Services\n    ========\n\n    host       port  proto  name        state  info\n    ----       ----  -----  ----        -----  ----\n    127.0.0.1  5432  tcp    postgresql  open   PostgreSQL DB\n\n## Passing options\n\nOptions, such as the database host, port, user and password can be passed through PostgreSQL's default environment variables documented [here](https://www.postgresql.org/docs/current/libpq-envars.html), e.g.:\n\n    $ PGUSER=metasploit PGPASSWORD=secret db_nmap -sV 127.0.0.1\n\nIn addition, the Metasploit workspace name can be set with the environment variable `MSF_WORKSPACE` (default: `default`):\n\n    $ MSF_WORKSPACE=project2 db_nmap -sV 127.0.0.1\n\n## Building\n\nThe project is implemented in Go and can be built as follows:\n\n    go build ./cmd/db_nmap\n    go build ./cmd/db_import\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjojonas%2Fdb_nmap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjojonas%2Fdb_nmap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjojonas%2Fdb_nmap/lists"}