ronin-app 0.1.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (163) hide show
  1. checksums.yaml +7 -0
  2. data/.dockerignore +3 -0
  3. data/.document +6 -0
  4. data/.env.dev +1 -0
  5. data/.github/workflows/ruby.yml +44 -0
  6. data/.gitignore +16 -0
  7. data/.rspec +1 -0
  8. data/.rubocop.yml +26 -0
  9. data/.ruby-version +1 -0
  10. data/.yardopts +1 -0
  11. data/CONTRIBUTING.md +34 -0
  12. data/COPYING.txt +661 -0
  13. data/ChangeLog.md +38 -0
  14. data/Dockerfile +27 -0
  15. data/Gemfile +61 -0
  16. data/Procfile +2 -0
  17. data/Procfile.dev +2 -0
  18. data/README.md +215 -0
  19. data/Rakefile +44 -0
  20. data/app/db.rb +680 -0
  21. data/app/scanning.rb +173 -0
  22. data/app.rb +372 -0
  23. data/bin/ronin-app +34 -0
  24. data/config/database.rb +17 -0
  25. data/config/puma.rb +24 -0
  26. data/config/redis.rb +4 -0
  27. data/config/sidekiq.rb +23 -0
  28. data/config/sidekiq.yml +12 -0
  29. data/config.ru +33 -0
  30. data/docker-compose.yml +45 -0
  31. data/etc/systemd/user/ronin-app-sidekiq.1.service +17 -0
  32. data/etc/systemd/user/ronin-app-web.1.service +18 -0
  33. data/etc/systemd/user/ronin-app.target +5 -0
  34. data/gemspec.yml +55 -0
  35. data/lib/middleware/sidekiq/active_record_connection_pool.rb +47 -0
  36. data/lib/ronin/app/cli.rb +197 -0
  37. data/lib/ronin/app/helpers/html.rb +71 -0
  38. data/lib/ronin/app/root.rb +28 -0
  39. data/lib/ronin/app/schemas/params_schema.rb +66 -0
  40. data/lib/ronin/app/schemas/payloads/build_schema.rb +56 -0
  41. data/lib/ronin/app/schemas/payloads/encoders/encode_schema.rb +60 -0
  42. data/lib/ronin/app/types/import.rb +35 -0
  43. data/lib/ronin/app/types/nmap.rb +81 -0
  44. data/lib/ronin/app/types/spider.rb +49 -0
  45. data/lib/ronin/app/types/vulns.rb +69 -0
  46. data/lib/ronin/app/types.rb +66 -0
  47. data/lib/ronin/app/validations/import_params.rb +71 -0
  48. data/lib/ronin/app/validations/install_repo_params.rb +78 -0
  49. data/lib/ronin/app/validations/masscan_params.rb +122 -0
  50. data/lib/ronin/app/validations/nmap_params.rb +183 -0
  51. data/lib/ronin/app/validations/recon_params.rb +86 -0
  52. data/lib/ronin/app/validations/spider_params.rb +103 -0
  53. data/lib/ronin/app/validations/vulns_params.rb +83 -0
  54. data/lib/ronin/app/version.rb +26 -0
  55. data/log/.gitkeep +0 -0
  56. data/man/ronin-app.1 +63 -0
  57. data/man/ronin-app.1.md +61 -0
  58. data/public/images/favicon.png +0 -0
  59. data/public/images/favicon.svg +78 -0
  60. data/public/images/logo.svg +78 -0
  61. data/public/images/sidekiq.svg +24 -0
  62. data/public/javascript/app.js +60 -0
  63. data/public/javascript/notes.js +28 -0
  64. data/public/javascript/tabs.js +40 -0
  65. data/public/stylesheets/app.css +216 -0
  66. data/public/stylesheets/bulma.min.css +1 -0
  67. data/ronin-app.gemspec +63 -0
  68. data/scripts/console +7 -0
  69. data/scripts/server +134 -0
  70. data/scripts/setup +447 -0
  71. data/scripts/update +55 -0
  72. data/tmp/.gitkeep +0 -0
  73. data/views/_authors.erb +62 -0
  74. data/views/_delete.erb +4 -0
  75. data/views/_delete_all.erb +4 -0
  76. data/views/_encoding_tabs.erb +25 -0
  77. data/views/_notes.erb +33 -0
  78. data/views/_pagination.erb +1 -0
  79. data/views/_param_fields.erb +66 -0
  80. data/views/_params.erb +35 -0
  81. data/views/about.erb +30 -0
  82. data/views/db/advisories/index.erb +30 -0
  83. data/views/db/advisories/show.erb +105 -0
  84. data/views/db/asns/index.erb +19 -0
  85. data/views/db/asns/show.erb +61 -0
  86. data/views/db/credentials/index.erb +30 -0
  87. data/views/db/credentials/show.erb +51 -0
  88. data/views/db/email_addresses/index.erb +30 -0
  89. data/views/db/email_addresses/show.erb +44 -0
  90. data/views/db/host_names/index.erb +30 -0
  91. data/views/db/host_names/show.erb +52 -0
  92. data/views/db/ip_addresses/index.erb +19 -0
  93. data/views/db/ip_addresses/show.erb +98 -0
  94. data/views/db/mac_addresses/index.erb +19 -0
  95. data/views/db/mac_addresses/show.erb +62 -0
  96. data/views/db/open_ports/index.erb +19 -0
  97. data/views/db/open_ports/show.erb +87 -0
  98. data/views/db/organizations/departments/show.erb +82 -0
  99. data/views/db/organizations/index.erb +28 -0
  100. data/views/db/organizations/members/show.erb +87 -0
  101. data/views/db/organizations/show.erb +111 -0
  102. data/views/db/oses/index.erb +19 -0
  103. data/views/db/oses/show.erb +46 -0
  104. data/views/db/passwords/index.erb +30 -0
  105. data/views/db/passwords/show.erb +52 -0
  106. data/views/db/people/index.erb +31 -0
  107. data/views/db/people/show.erb +120 -0
  108. data/views/db/phone_numbers/index.erb +30 -0
  109. data/views/db/phone_numbers/show.erb +63 -0
  110. data/views/db/ports/index.erb +30 -0
  111. data/views/db/ports/show.erb +70 -0
  112. data/views/db/services/index.erb +30 -0
  113. data/views/db/services/show.erb +65 -0
  114. data/views/db/software/index.erb +19 -0
  115. data/views/db/software/show.erb +52 -0
  116. data/views/db/software_vendors/index.erb +19 -0
  117. data/views/db/software_vendors/show.erb +36 -0
  118. data/views/db/street_addresses/index.erb +19 -0
  119. data/views/db/street_addresses/show.erb +63 -0
  120. data/views/db/url_query_param_names/index.erb +19 -0
  121. data/views/db/url_query_param_names/show.erb +50 -0
  122. data/views/db/url_schemes/index.erb +19 -0
  123. data/views/db/url_schemes/show.erb +36 -0
  124. data/views/db/urls/index.erb +30 -0
  125. data/views/db/urls/show.erb +103 -0
  126. data/views/db/user_names/index.erb +30 -0
  127. data/views/db/user_names/show.erb +48 -0
  128. data/views/db/vulns/index.erb +19 -0
  129. data/views/db/vulns/show.erb +104 -0
  130. data/views/db.erb +152 -0
  131. data/views/exploits/index.erb +9 -0
  132. data/views/exploits/show.erb +100 -0
  133. data/views/import.erb +30 -0
  134. data/views/index.erb +7 -0
  135. data/views/layout.erb +98 -0
  136. data/views/masscan.erb +459 -0
  137. data/views/nmap.erb +1009 -0
  138. data/views/payloads/build.erb +19 -0
  139. data/views/payloads/encoders/encode.erb +35 -0
  140. data/views/payloads/encoders/index.erb +9 -0
  141. data/views/payloads/encoders/show.erb +47 -0
  142. data/views/payloads/index.erb +9 -0
  143. data/views/payloads/show.erb +47 -0
  144. data/views/queue.erb +28 -0
  145. data/views/recon.erb +55 -0
  146. data/views/repos/index.erb +30 -0
  147. data/views/repos/install.erb +45 -0
  148. data/views/repos/show.erb +39 -0
  149. data/views/spider.erb +372 -0
  150. data/views/vulns.erb +214 -0
  151. data/workers/import.rb +96 -0
  152. data/workers/install_repo.rb +40 -0
  153. data/workers/masscan.rb +135 -0
  154. data/workers/nmap.rb +216 -0
  155. data/workers/purge_repos.rb +40 -0
  156. data/workers/recon.rb +95 -0
  157. data/workers/remove_repo.rb +40 -0
  158. data/workers/spider.rb +148 -0
  159. data/workers/update_repo.rb +42 -0
  160. data/workers/update_repos.rb +40 -0
  161. data/workers/vulns.rb +111 -0
  162. data/workers.rb +37 -0
  163. metadata +538 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: e807463567097ddf828ab12bc5c0d75fc1ea05d7c7c755d67e6550d6cd368776
4
+ data.tar.gz: 54f0e5ae8cbb25d1749e6896060d1345ffdc3086085ea7317d4f7fe8e56543a1
5
+ SHA512:
6
+ metadata.gz: 3e7ec51601d1f88f7993157c6b9c0bf315e8cfda3b6daf8eb43da9239f4e0177fb94ce156601de05c41d2a4595a48697dc4aec96de9647dc804dd068e8e559f7
7
+ data.tar.gz: 6efcab13cc6137d69581a0cc4f8e9b79eb97082e5add7b1f8f68a7861646daee311ad1d3246d1478e2d683a864554167dd76f73db4a8a9ee16e91d25a4be1f9f
data/.dockerignore ADDED
@@ -0,0 +1,3 @@
1
+ .bundle/config
2
+ Gemfile.lock
3
+ vendor/bundle
data/.document ADDED
@@ -0,0 +1,6 @@
1
+ app.rb
2
+ lib/**/*.rb
3
+ workers/**/*.rb
4
+ -
5
+ ChangeLog.md
6
+ COPYING.txt
data/.env.dev ADDED
@@ -0,0 +1 @@
1
+ DATABASE_URL=sqlite3:db/dev.sqlite3
@@ -0,0 +1,44 @@
1
+ name: CI
2
+
3
+ on: [ push, pull_request ]
4
+
5
+ jobs:
6
+ tests:
7
+ runs-on: ubuntu-latest
8
+ strategy:
9
+ fail-fast: false
10
+ matrix:
11
+ ruby:
12
+ - '3.1'
13
+ - '3.2'
14
+ - '3.3'
15
+ name: Ruby ${{ matrix.ruby }}
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+ - name: Set up Ruby
19
+ uses: ruby/setup-ruby@v1
20
+ with:
21
+ ruby-version: ${{ matrix.ruby }}
22
+ bundler-cache: true
23
+ - name: Install dependencies
24
+ run: |
25
+ sudo apt update -y && \
26
+ sudo apt install -y --no-install-recommends --no-install-suggests libsqlite3-dev
27
+ - name: Install dependencies
28
+ run: bundle install --jobs 4 --retry 3
29
+ - name: Run tests
30
+ run: bundle exec rake test
31
+
32
+ # rubocop linting
33
+ rubocop:
34
+ runs-on: ubuntu-latest
35
+ steps:
36
+ - uses: actions/checkout@v4
37
+ - name: Set up Ruby
38
+ uses: ruby/setup-ruby@v1
39
+ with:
40
+ ruby-version: 3.0
41
+ - name: Install dependencies
42
+ run: bundle install --jobs 4 --retry 3
43
+ - name: Run rubocop
44
+ run: bundle exec rubocop --parallel
data/.gitignore ADDED
@@ -0,0 +1,16 @@
1
+ /Gemfile.lock
2
+ /coverage
3
+ /doc
4
+ /log
5
+ /man/*.1
6
+ /tmp
7
+ /vendor/bundle
8
+ /.bundle
9
+ /.yardoc
10
+ .DS_Store
11
+ *.db
12
+ *.log
13
+ *.swp
14
+ *~
15
+ dump.rdb
16
+ /db
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --colour --format documentation
data/.rubocop.yml ADDED
@@ -0,0 +1,26 @@
1
+ AllCops:
2
+ NewCops: enable
3
+ SuggestExtensions: false
4
+ TargetRubyVersion: 3.1
5
+
6
+ inherit_gem:
7
+ rubocop-ronin: rubocop.yml
8
+
9
+ #
10
+ # ronin-app specific exceptions
11
+ #
12
+
13
+ # dry-types constructor requires an explicit block with one block argument
14
+ Style/SymbolProc:
15
+ Exclude:
16
+ - 'lib/ronin/app/types.rb'
17
+
18
+ # $redis global variable is fine.
19
+ Style/GlobalVars:
20
+ Exclude:
21
+ - 'config/redis.rb'
22
+
23
+ # in lib/schema we use Dry::Schema::Params() style class-methods
24
+ Naming/MethodName:
25
+ Exclude:
26
+ - 'lib/ronin/app/schemas/**/*'
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ ruby-3.1
data/.yardopts ADDED
@@ -0,0 +1 @@
1
+ --markup markdown --title 'Ronin::App Documentation' --protected
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,34 @@
1
+ # Contributing
2
+
3
+ * Typo, spelling mistake, and CSS fixes are welcomed and appreciated.
4
+ * Please develop against [Ruby] 3.1.x.
5
+ * Please make sure new code passes `bundle exec rubocop` style checking.
6
+ * Please write tests for all new code and make sure they pass.
7
+
8
+ ## What is NOT allowed
9
+
10
+ * HAML, Slim, and other HTML templating engines are NOT allowed.
11
+ Please use regular [ERB] that renders [HTML5].
12
+ * SASS/SCSS are NOT allowed. Only use vanilla [CSS4].
13
+ * JavaScript frameworks are NOT allowed. This means NO React, Angular, Svelte,
14
+ etc. Only use [vanilla ES6 JavaScript][vanilla.js].
15
+ * JavaScript packers/compilers are NOT allowed. This means no Babel or Webpack.
16
+ All JavaScript must be loaded directly or via [import maps].
17
+ * No external assets. All images, CSS, and JavaScript must be vendored in
18
+ `public/stylesheets/` or `public/javascript/` so that the app can be used
19
+ offline.
20
+ * No Rails dependencies. While we do use [ActiveRecord] for [ronin-db],
21
+ I prefer to avoid using [activesupport] or any other Rails dependencies to
22
+ keep the codebase as lightweight and simple as possible. Instead look for
23
+ [dry-rb] or [sinatra-] alternatives.
24
+
25
+ [Ruby]: https://www.ruby-lang.org/
26
+ [ERB]: https://docs.ruby-lang.org/en/3.1/ERB.html
27
+ [HTML5]: https://dev.w3.org/html5/spec-LC/
28
+ [CSS4]: https://developer.mozilla.org/en-US/docs/Web/CSS
29
+ [vanilla.js]: http://vanilla-js.com/
30
+ [import maps]: https://github.com/WICG/import-maps#readme
31
+ [ActiveRecord]: https://guides.rubyonrails.org/active_record_basics.html
32
+ [activesupport]: https://www.rubydoc.info/gems/activesupport
33
+ [dry-rb]: https://www.dry-rb.org/
34
+ [sinatra-]: https://rubygems.org/search?query=sinatra-