{"id":23647642,"url":"https://github.com/ronin-rb/ronin-db","last_synced_at":"2025-04-14T13:34:21.832Z","repository":{"id":19570801,"uuid":"22820165","full_name":"ronin-rb/ronin-db","owner":"ronin-rb","description":"A common database library for managing and querying security data","archived":false,"fork":false,"pushed_at":"2025-02-17T21:30:47.000Z","size":1962,"stargazers_count":16,"open_issues_count":2,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-13T12:25:59.003Z","etag":null,"topics":["cli","database","database-management","infosec","ruby"],"latest_commit_sha":null,"homepage":"https://ronin-rb.dev","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ronin-rb.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","contributing":null,"funding":null,"license":"COPYING.txt","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},"funding":{"open_collective":"ronin-rb","patreon":"roninrb"}},"created_at":"2014-08-10T22:28:40.000Z","updated_at":"2025-04-09T10:09:54.000Z","dependencies_parsed_at":"2024-01-25T20:08:50.363Z","dependency_job_id":"af753146-ea9b-4158-b67f-6db37ad35ebf","html_url":"https://github.com/ronin-rb/ronin-db","commit_stats":{"total_commits":1271,"total_committers":1,"mean_commits":1271.0,"dds":0.0,"last_synced_commit":"bd3e0fdb2b2795db7521b5fc94a096ae9b450db8"},"previous_names":[],"tags_count":51,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ronin-rb%2Fronin-db","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ronin-rb%2Fronin-db/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ronin-rb%2Fronin-db/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ronin-rb%2Fronin-db/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ronin-rb","download_url":"https://codeload.github.com/ronin-rb/ronin-db/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248713271,"owners_count":21149659,"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":["cli","database","database-management","infosec","ruby"],"created_at":"2024-12-28T14:28:58.251Z","updated_at":"2025-04-14T13:34:21.793Z","avatar_url":"https://github.com/ronin-rb.png","language":"Ruby","readme":"# ronin-db\n\n[![CI](https://github.com/ronin-rb/ronin-db/actions/workflows/ruby.yml/badge.svg)](https://github.com/ronin-rb/ronin-db/actions/workflows/ruby.yml)\n[![Code Climate](https://codeclimate.com/github/ronin-rb/ronin-db.svg)](https://codeclimate.com/github/ronin-rb/ronin-db)\n[![Gem Version](https://badge.fury.io/rb/ronin-db.svg)](https://badge.fury.io/rb/ronin-db)\n\n* [Website](https://ronin-rb.dev)\n* [Source](https://github.com/ronin-rb/ronin-db)\n* [Issues](https://github.com/ronin-rb/ronin-db/issues)\n* [Documentation](https://ronin-rb.dev/docs/ronin-db/frames)\n* [Discord](https://discord.gg/6WAb3PsVX9) |\n  [Mastodon](https://infosec.exchange/@ronin_rb)\n\n## Description\n\nronin-db is a common database library for managing and querying security data.\nronin-db provides common ORM models for interacting with the database's SQL\ntables and inserting/querying security data, such as URLs, email addresses,\nhost names, IPs, ports, etc. ronin-db also provides CLI commands for managing\nthe database(s).\n\nronin-db is part of the [ronin-rb] project, a [Ruby] toolkit for security\nresearch and development.\n\n## Features\n\n* Uses a [sqlite] database by default.\n* Provides common [ActiveRecord models][ronin-db-activerecord] for interacting\n  with the database tables.\n* Provides a `ronin-db` command for easy management of the database(s).\n* Provides additional commands for querying, inserting, deleting entries from\n  various database tables.\n\n## Synopsis\n\n```\nUsage: ronin-db [options] [COMMAND [ARGS...]]\n\nOptions:\n    -h, --help                       Print help information\n\nArguments:\n    [COMMAND]                        The command name to run\n    [ARGS ...]                       Additional arguments for the command\n\nCommands:\n    add\n    asn\n    certs\n    completion\n    creds\n    edit\n    emails\n    help\n    hosts\n    ips\n    irb, console\n    list\n    migrate\n    open-ports\n    oses\n    passwords\n    people\n    phone-numbers\n    ports\n    remove\n    services\n    software\n    street-addresses\n    urls\n    web-vulns\n```\n\nList available Databases:\n\n```shell\n$ ronin-db list\n```\n\nAdd a new Database:\n\n```shell\n$ ronin-db add team-db --uri postgres://user:pass@vpn.example.com/db\n```\n\nRemove a Database:\n\n```shell\n$ ronin-db remove team-db\n```\n\nAdd a host name to the database:\n\n```shell\n$ ronin-db hosts --add example.com\n$ ronin-db hosts --add www.example.com\n```\n\nList host names in the database:\n\n```shell\n$ ronin-db hosts\nexample.com\nwww.example.com\n...\n```\n\nQueries only certain host names:\n\n```shell\n$ ronin-db hosts --domain example.com\nexample.com\nwww.example.com\n...\n```\n\nImports a file of host names:\n\n```shell\n$ ronin-db hosts --import targets.txt\n```\n\n## Examples\n\nManually creating the database:\n\n```ruby\nrequire 'ronin/db'\n\nRonin::DB.connect(migrate: true)\n```\n\nConnecting to the default database:\n\n```ruby\nrequire 'ronin/db'\n\nRonin::DB.connect\n```\n\nCreating a custom database:\n\n```ruby\nrequire 'ronin/db'\n\nRonin::DB.connect('sqlite3:path/to/db.sqlite3', migrate: true)\n```\n\nConnecting to a custom database:\n\n```ruby\nrequire 'ronin/db'\n\nRonin::DB.connect('sqlite3:path/to/db.sqlite3')\n```\n\nInteracting with the [Ronin::DB][ronin-db-activerecord] models:\n\n```ruby\nrequire 'ronin/db'\n\nRonin::DB.connect\n\nRonin::DB::HostName.create(name: 'www.example.com')\n# =\u003e\n# #\u003cRonin::DB::HostName:0x00007f3275cc93f0\n#  id: 1,\n#  name: \"www.example.com\",\n#  last_scanned_at: nil,\n#  created_at: 2022-09-30 05:06:25.633087551 UTC\u003e\nRonin::DB::HostName.create(name: 'www.example.org')\n# =\u003e\n# #\u003cRonin::DB::HostName:0x00007f32768b60a0\n#  id: 2,\n#  name: \"www.example.org\",\n#  last_scanned_at: nil,\n#  created_at: 2022-09-30 05:07:00.996736126 UTC\u003e\n\nhost_name = Ronin::DB::HostName.find(2)\n# =\u003e\n# #\u003cRonin::DB::HostName:0x00007f32758072e0\n#  id: 2,\n#  name: \"www.example.org\",\n#  last_scanned_at: nil,\n#  created_at: 2000-01-01 05:07:00.996736 UTC\u003e\n\nhost_name = Ronin::DB::HostName.first\n# =\u003e\n# #\u003cRonin::DB::HostName:0x00007f3275cc93f0\n#  id: 1,\n#  name: \"www.example.com\",\n#  last_scanned_at: nil,\n#  created_at: 2022-09-30 05:06:25.633087551 UTC\u003e\n\nhost_names = Ronin::DB::HostName.where(name: 'www.example.com')\n# =\u003e\n# [#\u003cRonin::DB::HostName:0x00007f327597b4c8\n#   id: 1,\n#   name: \"www.example.com\",\n#   last_scanned_at: nil,\n#   created_at: 2000-01-01 05:06:25.633087 UTC\u003e]\n\nhost_names = Ronin::DB::HostName.where(name: 'www.example.com')\n# =\u003e\n# [#\u003cRonin::DB::HostName:0x00007f327597b4c8\n#   id: 1,\n#   name: \"www.example.com\",\n#   last_scanned_at: nil,\n#   created_at: 2000-01-01 05:06:25.633087 UTC\u003e]\n```\n\nFor more information on how to query the database models, see [Active Record\nQuery Interface](https://guides.rubyonrails.org/active_record_querying.html)\nand [ronin-db-activerecord].\n\n## Requirements\n\n* [Ruby] \u003e= 3.0.0\n* [libsqlite3][sqlite]\n* [sqlite3][sqlite3]\n  (or [activerecord-jdbcsqlite3-adapter] ~\u003e 70.0 on JRuby)\n* [ronin-db-activerecord] ~\u003e 0.2\n* [ronin-support] ~\u003e 1.0\n* [ronin-core] ~\u003e 0.2\n\n## Install\n\n```shell\n$ gem install ronin-db\n```\n\n### Gemfile\n\n```ruby\ngem 'ronin-db', '~\u003e 0.1'\n```\n\n### gemspec\n\n```ruby\ngem.add_dependency 'ronin-db', '~\u003e 0.1'\n```\n\n## Development\n\n1. [Fork It!](https://github.com/ronin-rb/ronin-db/fork)\n2. Clone It!\n3. `cd ronin-db`\n4. `./scripts/setup`\n5. `git checkout -b my_feature`\n6. Code It!\n7. `bundle exec rake spec`\n8. `git push origin my_feature`\n\nIf you want to test your changes locally, run `rake db:console` to start a\nlocal database console.\n\n## License\n\nCopyright (c) 2006-2025 Hal Brodigan (postmodern.mod3 at gmail.com)\n\nronin-db is free software: you can redistribute it and/or modify\nit under the terms of the GNU Lesser General Public License as published\nby the Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nronin-db is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU Lesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public License\nalong with ronin-db.  If not, see \u003chttps://www.gnu.org/licenses/\u003e.\n\n[ronin-rb]: https://ronin-rb.dev/\n[Ruby]: https://www.ruby-lang.org\n\n[sqlite]: https://sqlite.org/\n[uri-query_params]: https://github.com/postmodern/uri-query_params#readme\n[sqlite3]: https://github.com/sparklemotion/sqlite3-ruby#readme\n[activerecord-jdbcsqlite3-adapter]: https://github.com/jruby/activerecord-jdbc-adapter#readme\n[activerecord]: https://github.com/rails/rails/tree/main/activerecord#readme\n[ronin-db-activerecord]: https://github.com/ronin-rb/ronin-db-activerecord#readme\n[ronin-support]: https://github.com/ronin-rb/ronin-support#readme\n[ronin-core]: https://github.com/ronin-rb/ronin-core#readme\n","funding_links":["https://opencollective.com/ronin-rb","https://patreon.com/roninrb"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fronin-rb%2Fronin-db","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fronin-rb%2Fronin-db","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fronin-rb%2Fronin-db/lists"}