mihari 5.1.0 → 5.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/.gitmodules +0 -3
  3. data/.rubocop.yml +6 -0
  4. data/README.md +0 -1
  5. data/lib/mihari/analyzers/base.rb +32 -27
  6. data/lib/mihari/analyzers/binaryedge.rb +17 -9
  7. data/lib/mihari/analyzers/censys.rb +10 -54
  8. data/lib/mihari/analyzers/circl.rb +7 -6
  9. data/lib/mihari/analyzers/crtsh.rb +12 -7
  10. data/lib/mihari/analyzers/dnstwister.rb +7 -7
  11. data/lib/mihari/analyzers/feed.rb +33 -10
  12. data/lib/mihari/analyzers/greynoise.rb +8 -33
  13. data/lib/mihari/analyzers/onyphe.rb +10 -36
  14. data/lib/mihari/analyzers/otx.rb +4 -3
  15. data/lib/mihari/analyzers/passivetotal.rb +8 -7
  16. data/lib/mihari/analyzers/pulsedive.rb +8 -7
  17. data/lib/mihari/analyzers/rule.rb +0 -1
  18. data/lib/mihari/analyzers/securitytrails.rb +8 -10
  19. data/lib/mihari/analyzers/shodan.rb +16 -90
  20. data/lib/mihari/analyzers/urlscan.rb +16 -6
  21. data/lib/mihari/analyzers/virustotal.rb +8 -6
  22. data/lib/mihari/analyzers/virustotal_intelligence.rb +12 -7
  23. data/lib/mihari/analyzers/zoomeye.rb +13 -10
  24. data/lib/mihari/clients/base.rb +53 -0
  25. data/lib/mihari/clients/binaryedge.rb +38 -0
  26. data/lib/mihari/clients/censys.rb +42 -0
  27. data/lib/mihari/clients/circl.rb +59 -0
  28. data/lib/mihari/clients/crtsh.rb +31 -0
  29. data/lib/mihari/clients/dnstwister.rb +40 -0
  30. data/lib/mihari/clients/greynoise.rb +34 -0
  31. data/lib/mihari/clients/misp.rb +29 -0
  32. data/lib/mihari/clients/onyphe.rb +35 -0
  33. data/lib/mihari/clients/otx.rb +49 -0
  34. data/lib/mihari/clients/passivetotal.rb +69 -0
  35. data/lib/mihari/clients/publsedive.rb +56 -0
  36. data/lib/mihari/clients/securitytrails.rb +94 -0
  37. data/lib/mihari/clients/shodan.rb +41 -0
  38. data/lib/mihari/clients/the_hive.rb +33 -0
  39. data/lib/mihari/clients/urlscan.rb +33 -0
  40. data/lib/mihari/clients/virustotal.rb +62 -0
  41. data/lib/mihari/clients/zoomeye.rb +74 -0
  42. data/lib/mihari/commands/database.rb +1 -6
  43. data/lib/mihari/commands/searcher.rb +1 -2
  44. data/lib/mihari/database.rb +9 -0
  45. data/lib/mihari/emitters/misp.rb +13 -20
  46. data/lib/mihari/emitters/the_hive.rb +3 -5
  47. data/lib/mihari/emitters/webhook.rb +2 -2
  48. data/lib/mihari/feed/reader.rb +14 -11
  49. data/lib/mihari/http.rb +29 -21
  50. data/lib/mihari/mixins/retriable.rb +3 -1
  51. data/lib/mihari/schemas/analyzer.rb +5 -4
  52. data/lib/mihari/structs/censys.rb +62 -0
  53. data/lib/mihari/structs/greynoise.rb +43 -0
  54. data/lib/mihari/structs/onyphe.rb +45 -0
  55. data/lib/mihari/structs/shodan.rb +83 -0
  56. data/lib/mihari/version.rb +1 -1
  57. data/lib/mihari/web/middleware/connection_adapter.rb +1 -3
  58. data/lib/mihari/web/public/assets/{index-63900d73.js → index-7d0fb8c4.js} +2 -2
  59. data/lib/mihari/web/public/index.html +1 -1
  60. data/lib/mihari/web/public/redoc-static.html +2 -2
  61. data/lib/mihari.rb +21 -2
  62. data/mihari.gemspec +15 -23
  63. metadata +55 -264
  64. data/lib/mihari/analyzers/clients/otx.rb +0 -36
  65. data/lib/mihari/analyzers/dnpedia.rb +0 -37
  66. data/lib/mihari/mixins/database.rb +0 -16
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mihari
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.0
4
+ version: 5.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manabu Niseki
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-02-25 00:00:00.000000000 Z
11
+ date: 2023-03-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -80,20 +80,6 @@ dependencies:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0.5'
83
- - !ruby/object:Gem::Dependency
84
- name: overcommit
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - "~>"
88
- - !ruby/object:Gem::Version
89
- version: '0.60'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - "~>"
95
- - !ruby/object:Gem::Version
96
- version: '0.60'
97
83
  - !ruby/object:Gem::Dependency
98
84
  name: pg
99
85
  requirement: !ruby/object:Gem::Requirement
@@ -198,28 +184,14 @@ dependencies:
198
184
  requirements:
199
185
  - - "~>"
200
186
  - !ruby/object:Gem::Version
201
- version: '1.24'
187
+ version: '1.25'
202
188
  type: :development
203
189
  prerelease: false
204
190
  version_requirements: !ruby/object:Gem::Requirement
205
191
  requirements:
206
192
  - - "~>"
207
193
  - !ruby/object:Gem::Version
208
- version: '1.24'
209
- - !ruby/object:Gem::Dependency
210
- name: steep
211
- requirement: !ruby/object:Gem::Requirement
212
- requirements:
213
- - - "~>"
214
- - !ruby/object:Gem::Version
215
- version: '1.3'
216
- type: :development
217
- prerelease: false
218
- version_requirements: !ruby/object:Gem::Requirement
219
- requirements:
220
- - - "~>"
221
- - !ruby/object:Gem::Version
222
- version: '1.3'
194
+ version: '1.25'
223
195
  - !ruby/object:Gem::Dependency
224
196
  name: timecop
225
197
  requirement: !ruby/object:Gem::Requirement
@@ -263,117 +235,89 @@ dependencies:
263
235
  - !ruby/object:Gem::Version
264
236
  version: '3.18'
265
237
  - !ruby/object:Gem::Dependency
266
- name: activerecord
267
- requirement: !ruby/object:Gem::Requirement
268
- requirements:
269
- - - '='
270
- - !ruby/object:Gem::Version
271
- version: 7.0.4.2
272
- type: :runtime
273
- prerelease: false
274
- version_requirements: !ruby/object:Gem::Requirement
275
- requirements:
276
- - - '='
277
- - !ruby/object:Gem::Version
278
- version: 7.0.4.2
279
- - !ruby/object:Gem::Dependency
280
- name: addressable
281
- requirement: !ruby/object:Gem::Requirement
282
- requirements:
283
- - - '='
284
- - !ruby/object:Gem::Version
285
- version: 2.8.1
286
- type: :runtime
287
- prerelease: false
288
- version_requirements: !ruby/object:Gem::Requirement
289
- requirements:
290
- - - '='
291
- - !ruby/object:Gem::Version
292
- version: 2.8.1
293
- - !ruby/object:Gem::Dependency
294
- name: awrence
238
+ name: overcommit
295
239
  requirement: !ruby/object:Gem::Requirement
296
240
  requirements:
297
- - - '='
241
+ - - "~>"
298
242
  - !ruby/object:Gem::Version
299
- version: 2.0.1
300
- type: :runtime
243
+ version: '0.60'
244
+ type: :development
301
245
  prerelease: false
302
246
  version_requirements: !ruby/object:Gem::Requirement
303
247
  requirements:
304
- - - '='
248
+ - - "~>"
305
249
  - !ruby/object:Gem::Version
306
- version: 2.0.1
250
+ version: '0.60'
307
251
  - !ruby/object:Gem::Dependency
308
- name: binaryedge
252
+ name: ruby-lsp
309
253
  requirement: !ruby/object:Gem::Requirement
310
254
  requirements:
311
- - - '='
255
+ - - "~>"
312
256
  - !ruby/object:Gem::Version
313
- version: 0.1.0
314
- type: :runtime
257
+ version: '0.4'
258
+ type: :development
315
259
  prerelease: false
316
260
  version_requirements: !ruby/object:Gem::Requirement
317
261
  requirements:
318
- - - '='
262
+ - - "~>"
319
263
  - !ruby/object:Gem::Version
320
- version: 0.1.0
264
+ version: '0.4'
321
265
  - !ruby/object:Gem::Dependency
322
- name: censysx
266
+ name: steep
323
267
  requirement: !ruby/object:Gem::Requirement
324
268
  requirements:
325
- - - '='
269
+ - - "~>"
326
270
  - !ruby/object:Gem::Version
327
- version: 0.1.1
328
- type: :runtime
271
+ version: '1.3'
272
+ type: :development
329
273
  prerelease: false
330
274
  version_requirements: !ruby/object:Gem::Requirement
331
275
  requirements:
332
- - - '='
276
+ - - "~>"
333
277
  - !ruby/object:Gem::Version
334
- version: 0.1.1
278
+ version: '1.3'
335
279
  - !ruby/object:Gem::Dependency
336
- name: crtsh-rb
280
+ name: activerecord
337
281
  requirement: !ruby/object:Gem::Requirement
338
282
  requirements:
339
283
  - - '='
340
284
  - !ruby/object:Gem::Version
341
- version: 0.3.1
285
+ version: 7.0.4.3
342
286
  type: :runtime
343
287
  prerelease: false
344
288
  version_requirements: !ruby/object:Gem::Requirement
345
289
  requirements:
346
290
  - - '='
347
291
  - !ruby/object:Gem::Version
348
- version: 0.3.1
292
+ version: 7.0.4.3
349
293
  - !ruby/object:Gem::Dependency
350
- name: dnpedia
294
+ name: addressable
351
295
  requirement: !ruby/object:Gem::Requirement
352
296
  requirements:
353
297
  - - '='
354
298
  - !ruby/object:Gem::Version
355
- version: 0.1.0
299
+ version: 2.8.1
356
300
  type: :runtime
357
301
  prerelease: false
358
302
  version_requirements: !ruby/object:Gem::Requirement
359
303
  requirements:
360
304
  - - '='
361
305
  - !ruby/object:Gem::Version
362
- version: 0.1.0
306
+ version: 2.8.1
363
307
  - !ruby/object:Gem::Dependency
364
- name: dnstwister
308
+ name: awrence
365
309
  requirement: !ruby/object:Gem::Requirement
366
310
  requirements:
367
311
  - - '='
368
312
  - !ruby/object:Gem::Version
369
- version: 0.1.0
313
+ version: 2.0.1
370
314
  type: :runtime
371
315
  prerelease: false
372
316
  version_requirements: !ruby/object:Gem::Requirement
373
317
  requirements:
374
318
  - - '='
375
319
  - !ruby/object:Gem::Version
376
- version: 0.1.0
320
+ version: 2.0.1
377
321
  - !ruby/object:Gem::Dependency
378
322
  name: dotenv
379
323
  requirement: !ruby/object:Gem::Requirement
@@ -556,34 +500,6 @@ dependencies:
556
500
  - - '='
557
501
  - !ruby/object:Gem::Version
558
502
  version: 0.5.1
559
- - !ruby/object:Gem::Dependency
560
- name: greynoise
561
- requirement: !ruby/object:Gem::Requirement
562
- requirements:
563
- - - '='
564
- - !ruby/object:Gem::Version
565
- version: 0.1.1
566
- type: :runtime
567
- prerelease: false
568
- version_requirements: !ruby/object:Gem::Requirement
569
- requirements:
570
- - - '='
571
- - !ruby/object:Gem::Version
572
- version: 0.1.1
573
- - !ruby/object:Gem::Dependency
574
- name: hachi
575
- requirement: !ruby/object:Gem::Requirement
576
- requirements:
577
- - - '='
578
- - !ruby/object:Gem::Version
579
- version: 2.0.0
580
- type: :runtime
581
- prerelease: false
582
- version_requirements: !ruby/object:Gem::Requirement
583
- requirements:
584
- - - '='
585
- - !ruby/object:Gem::Version
586
- version: 2.0.0
587
503
  - !ruby/object:Gem::Dependency
588
504
  name: insensitive_hash
589
505
  requirement: !ruby/object:Gem::Requirement
@@ -640,20 +556,6 @@ dependencies:
640
556
  - - '='
641
557
  - !ruby/object:Gem::Version
642
558
  version: 2.0.2
643
- - !ruby/object:Gem::Dependency
644
- name: misp
645
- requirement: !ruby/object:Gem::Requirement
646
- requirements:
647
- - - '='
648
- - !ruby/object:Gem::Version
649
- version: 0.1.4
650
- type: :runtime
651
- prerelease: false
652
- version_requirements: !ruby/object:Gem::Requirement
653
- requirements:
654
- - - '='
655
- - !ruby/object:Gem::Version
656
- version: 0.1.4
657
559
  - !ruby/object:Gem::Dependency
658
560
  name: net-ping
659
561
  requirement: !ruby/object:Gem::Requirement
@@ -682,20 +584,6 @@ dependencies:
682
584
  - - '='
683
585
  - !ruby/object:Gem::Version
684
586
  version: 0.3.2
685
- - !ruby/object:Gem::Dependency
686
- name: onyphe
687
- requirement: !ruby/object:Gem::Requirement
688
- requirements:
689
- - - '='
690
- - !ruby/object:Gem::Version
691
- version: 2.0.0
692
- type: :runtime
693
- prerelease: false
694
- version_requirements: !ruby/object:Gem::Requirement
695
- requirements:
696
- - - '='
697
- - !ruby/object:Gem::Version
698
- version: 2.0.0
699
587
  - !ruby/object:Gem::Dependency
700
588
  name: parallel
701
589
  requirement: !ruby/object:Gem::Requirement
@@ -710,34 +598,6 @@ dependencies:
710
598
  - - '='
711
599
  - !ruby/object:Gem::Version
712
600
  version: 1.22.1
713
- - !ruby/object:Gem::Dependency
714
- name: passive_circl
715
- requirement: !ruby/object:Gem::Requirement
716
- requirements:
717
- - - '='
718
- - !ruby/object:Gem::Version
719
- version: 0.1.0
720
- type: :runtime
721
- prerelease: false
722
- version_requirements: !ruby/object:Gem::Requirement
723
- requirements:
724
- - - '='
725
- - !ruby/object:Gem::Version
726
- version: 0.1.0
727
- - !ruby/object:Gem::Dependency
728
- name: passivetotalx
729
- requirement: !ruby/object:Gem::Requirement
730
- requirements:
731
- - - '='
732
- - !ruby/object:Gem::Version
733
- version: 0.1.1
734
- type: :runtime
735
- prerelease: false
736
- version_requirements: !ruby/object:Gem::Requirement
737
- requirements:
738
- - - '='
739
- - !ruby/object:Gem::Version
740
- version: 0.1.1
741
601
  - !ruby/object:Gem::Dependency
742
602
  name: plissken
743
603
  requirement: !ruby/object:Gem::Requirement
@@ -766,20 +626,6 @@ dependencies:
766
626
  - - '='
767
627
  - !ruby/object:Gem::Version
768
628
  version: 5.0.1
769
- - !ruby/object:Gem::Dependency
770
- name: pulsedive
771
- requirement: !ruby/object:Gem::Requirement
772
- requirements:
773
- - - '='
774
- - !ruby/object:Gem::Version
775
- version: 0.1.5
776
- type: :runtime
777
- prerelease: false
778
- version_requirements: !ruby/object:Gem::Requirement
779
- requirements:
780
- - - '='
781
- - !ruby/object:Gem::Version
782
- version: 0.1.5
783
629
  - !ruby/object:Gem::Dependency
784
630
  name: puma
785
631
  requirement: !ruby/object:Gem::Requirement
@@ -836,20 +682,6 @@ dependencies:
836
682
  - - '='
837
683
  - !ruby/object:Gem::Version
838
684
  version: 1.1.1
839
- - !ruby/object:Gem::Dependency
840
- name: securitytrails
841
- requirement: !ruby/object:Gem::Requirement
842
- requirements:
843
- - - '='
844
- - !ruby/object:Gem::Version
845
- version: 1.0.0
846
- type: :runtime
847
- prerelease: false
848
- version_requirements: !ruby/object:Gem::Requirement
849
- requirements:
850
- - - '='
851
- - !ruby/object:Gem::Version
852
- version: 1.0.0
853
685
  - !ruby/object:Gem::Dependency
854
686
  name: semantic_logger
855
687
  requirement: !ruby/object:Gem::Requirement
@@ -870,28 +702,14 @@ dependencies:
870
702
  requirements:
871
703
  - - '='
872
704
  - !ruby/object:Gem::Version
873
- version: 5.7.0
705
+ version: 5.8.0
874
706
  type: :runtime
875
707
  prerelease: false
876
708
  version_requirements: !ruby/object:Gem::Requirement
877
709
  requirements:
878
710
  - - '='
879
711
  - !ruby/object:Gem::Version
880
- version: 5.7.0
881
- - !ruby/object:Gem::Dependency
882
- name: shodanx
883
- requirement: !ruby/object:Gem::Requirement
884
- requirements:
885
- - - '='
886
- - !ruby/object:Gem::Version
887
- version: 0.2.1
888
- type: :runtime
889
- prerelease: false
890
- version_requirements: !ruby/object:Gem::Requirement
891
- requirements:
892
- - - '='
893
- - !ruby/object:Gem::Version
894
- version: 0.2.1
712
+ version: 5.8.0
895
713
  - !ruby/object:Gem::Dependency
896
714
  name: slack-notifier
897
715
  requirement: !ruby/object:Gem::Requirement
@@ -912,14 +730,14 @@ dependencies:
912
730
  requirements:
913
731
  - - '='
914
732
  - !ruby/object:Gem::Version
915
- version: 1.6.0
733
+ version: 1.6.1
916
734
  type: :runtime
917
735
  prerelease: false
918
736
  version_requirements: !ruby/object:Gem::Requirement
919
737
  requirements:
920
738
  - - '='
921
739
  - !ruby/object:Gem::Version
922
- version: 1.6.0
740
+ version: 1.6.1
923
741
  - !ruby/object:Gem::Dependency
924
742
  name: thor
925
743
  requirement: !ruby/object:Gem::Requirement
@@ -934,20 +752,6 @@ dependencies:
934
752
  - - '='
935
753
  - !ruby/object:Gem::Version
936
754
  version: 1.2.1
937
- - !ruby/object:Gem::Dependency
938
- name: urlscan
939
- requirement: !ruby/object:Gem::Requirement
940
- requirements:
941
- - - '='
942
- - !ruby/object:Gem::Version
943
- version: 0.8.0
944
- type: :runtime
945
- prerelease: false
946
- version_requirements: !ruby/object:Gem::Requirement
947
- requirements:
948
- - - '='
949
- - !ruby/object:Gem::Version
950
- version: 0.8.0
951
755
  - !ruby/object:Gem::Dependency
952
756
  name: uuidtools
953
757
  requirement: !ruby/object:Gem::Requirement
@@ -962,20 +766,6 @@ dependencies:
962
766
  - - '='
963
767
  - !ruby/object:Gem::Version
964
768
  version: 2.2.0
965
- - !ruby/object:Gem::Dependency
966
- name: virustotalx
967
- requirement: !ruby/object:Gem::Requirement
968
- requirements:
969
- - - '='
970
- - !ruby/object:Gem::Version
971
- version: 1.2.0
972
- type: :runtime
973
- prerelease: false
974
- version_requirements: !ruby/object:Gem::Requirement
975
- requirements:
976
- - - '='
977
- - !ruby/object:Gem::Version
978
- version: 1.2.0
979
769
  - !ruby/object:Gem::Dependency
980
770
  name: whois
981
771
  requirement: !ruby/object:Gem::Requirement
@@ -1004,20 +794,6 @@ dependencies:
1004
794
  - - '='
1005
795
  - !ruby/object:Gem::Version
1006
796
  version: 2.0.0
1007
- - !ruby/object:Gem::Dependency
1008
- name: zoomeye-rb
1009
- requirement: !ruby/object:Gem::Requirement
1010
- requirements:
1011
- - - '='
1012
- - !ruby/object:Gem::Version
1013
- version: 0.2.0
1014
- type: :runtime
1015
- prerelease: false
1016
- version_requirements: !ruby/object:Gem::Requirement
1017
- requirements:
1018
- - - '='
1019
- - !ruby/object:Gem::Version
1020
- version: 0.2.0
1021
797
  description:
1022
798
  email:
1023
799
  - manabu.niseki@gmail.com
@@ -1062,9 +838,7 @@ files:
1062
838
  - lib/mihari/analyzers/binaryedge.rb
1063
839
  - lib/mihari/analyzers/censys.rb
1064
840
  - lib/mihari/analyzers/circl.rb
1065
- - lib/mihari/analyzers/clients/otx.rb
1066
841
  - lib/mihari/analyzers/crtsh.rb
1067
- - lib/mihari/analyzers/dnpedia.rb
1068
842
  - lib/mihari/analyzers/dnstwister.rb
1069
843
  - lib/mihari/analyzers/feed.rb
1070
844
  - lib/mihari/analyzers/greynoise.rb
@@ -1083,6 +857,24 @@ files:
1083
857
  - lib/mihari/cli/database.rb
1084
858
  - lib/mihari/cli/main.rb
1085
859
  - lib/mihari/cli/rule.rb
860
+ - lib/mihari/clients/base.rb
861
+ - lib/mihari/clients/binaryedge.rb
862
+ - lib/mihari/clients/censys.rb
863
+ - lib/mihari/clients/circl.rb
864
+ - lib/mihari/clients/crtsh.rb
865
+ - lib/mihari/clients/dnstwister.rb
866
+ - lib/mihari/clients/greynoise.rb
867
+ - lib/mihari/clients/misp.rb
868
+ - lib/mihari/clients/onyphe.rb
869
+ - lib/mihari/clients/otx.rb
870
+ - lib/mihari/clients/passivetotal.rb
871
+ - lib/mihari/clients/publsedive.rb
872
+ - lib/mihari/clients/securitytrails.rb
873
+ - lib/mihari/clients/shodan.rb
874
+ - lib/mihari/clients/the_hive.rb
875
+ - lib/mihari/clients/urlscan.rb
876
+ - lib/mihari/clients/virustotal.rb
877
+ - lib/mihari/clients/zoomeye.rb
1086
878
  - lib/mihari/commands/database.rb
1087
879
  - lib/mihari/commands/rule.rb
1088
880
  - lib/mihari/commands/searcher.rb
@@ -1121,7 +913,6 @@ files:
1121
913
  - lib/mihari/http.rb
1122
914
  - lib/mihari/mixins/autonomous_system.rb
1123
915
  - lib/mihari/mixins/configurable.rb
1124
- - lib/mihari/mixins/database.rb
1125
916
  - lib/mihari/mixins/error_notification.rb
1126
917
  - lib/mihari/mixins/falsepositive.rb
1127
918
  - lib/mihari/mixins/refang.rb
@@ -1177,7 +968,7 @@ files:
1177
968
  - lib/mihari/web/public/assets/fa-v4compatibility-7c377405.woff2
1178
969
  - lib/mihari/web/public/assets/fa-v4compatibility-8d9500e8.ttf
1179
970
  - lib/mihari/web/public/assets/index-625e95fe.css
1180
- - lib/mihari/web/public/assets/index-63900d73.js
971
+ - lib/mihari/web/public/assets/index-7d0fb8c4.js
1181
972
  - lib/mihari/web/public/favicon.ico
1182
973
  - lib/mihari/web/public/index.html
1183
974
  - lib/mihari/web/public/redoc-static.html
@@ -1203,7 +994,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1203
994
  - !ruby/object:Gem::Version
1204
995
  version: '0'
1205
996
  requirements: []
1206
- rubygems_version: 3.4.1
997
+ rubygems_version: 3.3.26
1207
998
  signing_key:
1208
999
  specification_version: 4
1209
1000
  summary: A framework for continuous OSINT based threat hunting
@@ -1,36 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Mihari
4
- module Analyzers
5
- module Clients
6
- class OTX
7
- attr_reader :api_key
8
-
9
- def initialize(api_key)
10
- @api_key = api_key
11
- end
12
-
13
- def query_by_ip(ip)
14
- get "https://otx.alienvault.com/api/v1/indicators/IPv4/#{ip}/passive_dns"
15
- end
16
-
17
- def query_by_domain(domain)
18
- get "https://otx.alienvault.com/api/v1/indicators/domain/#{domain}/passive_dns"
19
- end
20
-
21
- private
22
-
23
- def headers
24
- { "x-otx-api-key": api_key }
25
- end
26
-
27
- def get(url)
28
- res = HTTP.get(url, headers: headers)
29
- JSON.parse(res.body.to_s)
30
- rescue HTTPError
31
- nil
32
- end
33
- end
34
- end
35
- end
36
- end
@@ -1,37 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "dnpedia"
4
-
5
- module Mihari
6
- module Analyzers
7
- class DNPedia < Base
8
- param :query
9
-
10
- option :tags, default: proc { [] }
11
-
12
- def artifacts
13
- search || []
14
- end
15
-
16
- private
17
-
18
- def api
19
- @api ||= ::DNPedia::API.new
20
- end
21
-
22
- #
23
- # Search
24
- #
25
- # @return [Array<Mihari::Artifact>]
26
- #
27
- def search
28
- res = api.search(query)
29
- rows = res["rows"] || []
30
- rows.map do |row|
31
- data = [row["name"], row["zoneid"]].join(".")
32
- Artifact.new(data: data, source: source, metadata: row)
33
- end
34
- end
35
- end
36
- end
37
- end
@@ -1,16 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Mihari
4
- module Mixins
5
- module Database
6
- def with_db_connection
7
- Mihari::Database.connect
8
- yield
9
- rescue ActiveRecord::StatementInvalid
10
- Mihari.logger.error("You haven't finished the DB migration! Please run 'mihari db migrate'.")
11
- ensure
12
- Mihari::Database.close
13
- end
14
- end
15
- end
16
- end