Class: Mihari::Analyzers::HTTPHash

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

Instance Attribute Summary collapse

Attributes inherited from Base

#ignore_old_artifacts, #ignore_threshold

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_values, #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.



10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/mihari/analyzers/http_hash.rb', line 10

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.



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

def description
  @description
end

#htmlObject (readonly)

Returns the value of attribute html.



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

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.



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

def mmh3
  @mmh3
end

#sha256Object (readonly)

Returns the value of attribute sha256.



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

def sha256
  @sha256
end

#tagsObject (readonly)

Returns the value of attribute tags.



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

def tags
  @tags
end

#titleObject (readonly)

Returns the value of attribute title.



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

def title
  @title
end

Instance Method Details

#artifactsObject



25
26
27
28
29
# File 'lib/mihari/analyzers/http_hash.rb', line 25

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