Class: Mihari::Analyzers::HTTPHash

Inherits:
Base
  • Object
show all
Defined in:
lib/mihari/analyzers/http_hash.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

inherited, #run, #run_emitter, #source

Methods included from Retriable

#retry_on_error

Methods included from Configurable

#config_keys, #configuration_status, #configured?

Constructor Details

#initialize(_query, md5: nil, sha256: nil, mmh3: nil, html: nil, title: nil, description: nil, tags: []) ⇒ HTTPHash

Returns a new instance of HTTPHash.



18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/mihari/analyzers/http_hash.rb', line 18

def initialize(_query, md5: nil, sha256: nil, mmh3: nil, html: nil, title: nil, description: nil, tags: [])
  super()

  @md5 = md5
  @sha256 = sha256
  @mmh3 = mmh3

  @html = html
  load_from_html

  @title = title || "HTTP hash cross search"
  @description = description || "query = #{query}"
  @tags = tags
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



15
16
17
# File 'lib/mihari/analyzers/http_hash.rb', line 15

def description
  @description
end

#htmlObject (readonly)

Returns the value of attribute html.



12
13
14
# File 'lib/mihari/analyzers/http_hash.rb', line 12

def html
  @html
end

#md5Object (readonly)

Returns the value of attribute md5.



8
9
10
# File 'lib/mihari/analyzers/http_hash.rb', line 8

def md5
  @md5
end

#mmh3Object (readonly)

Returns the value of attribute mmh3.



10
11
12
# File 'lib/mihari/analyzers/http_hash.rb', line 10

def mmh3
  @mmh3
end

#sha256Object (readonly)

Returns the value of attribute sha256.



9
10
11
# File 'lib/mihari/analyzers/http_hash.rb', line 9

def sha256
  @sha256
end

#tagsObject (readonly)

Returns the value of attribute tags.



16
17
18
# File 'lib/mihari/analyzers/http_hash.rb', line 16

def tags
  @tags
end

#titleObject (readonly)

Returns the value of attribute title.



14
15
16
# File 'lib/mihari/analyzers/http_hash.rb', line 14

def title
  @title
end

Instance Method Details

#artifactsObject



33
34
35
36
37
# File 'lib/mihari/analyzers/http_hash.rb', line 33

def artifacts
  Parallel.map(analyzers) do |analyzer|
    run_analyzer analyzer
  end.flatten
end