Class: HybridAnalysis::Clients::Report

Inherits:
Client
  • Object
show all
Defined in:
lib/hybridanalysis/clients/report.rb

Constant Summary

Constants inherited from Client

Client::BASE_URL, Client::DEFAULT_UA, Client::HOST, Client::VERSION

Instance Attribute Summary

Attributes inherited from Client

#key

Instance Method Summary collapse

Methods inherited from Client

#initialize

Constructor Details

This class inherits a constructor from HybridAnalysis::Clients::Client

Instance Method Details

#certificate(id) ⇒ Hash

downloading certificate file from report (is available)

Parameters:

  • id (String)

    Id in one of format: ‘jobId’ or ‘sha256:environmentId’

Returns:

  • (Hash)


13
14
15
# File 'lib/hybridanalysis/clients/report.rb', line 13

def certificate(id)
  _get("/report/#{id}/certificate") { |json| json }
end

#dropped_file_raw(id:, hash:) ⇒ Hash

retrieve single extracted/dropped binaries files for a report

Parameters:

  • id (String)

    Id in one of format: ‘jobId’ or ‘sha256:environmentId’

  • hash (String)

    SHA256 of dropped file

Returns:

  • (Hash)


115
116
117
# File 'lib/hybridanalysis/clients/report.rb', line 115

def dropped_file_raw(id:, hash: )
  _get("/report/#{id}/dropped-file-raw/#{hash}") { |json| json }
end

#dropped_files(id) ⇒ Hash

retrieve all extracted/dropped binaries files for a report, as zip

Parameters:

  • id (String)

    Id in one of format: ‘jobId’ or ‘sha256:environmentId’

Returns:

  • (Hash)


126
127
128
# File 'lib/hybridanalysis/clients/report.rb', line 126

def dropped_files(id)
  _get("/report/#{id}/dropped-files") { |json| json }
end

#get(id:, type:) ⇒ Hash

downloading report data (e.g. JSON, XML, PCAP)

Parameters:

  • id (String)

    Id in one of format: ‘jobId’ or ‘sha256:environmentId’

  • type (String)

    Type of requested report,

Returns:

  • (Hash)


92
93
94
# File 'lib/hybridanalysis/clients/report.rb', line 92

def get(id:, type: )
  _get("/report/#{id}/report/#{type}") { |json| json }
end

#memory_dumps(id) ⇒ Hash

downloading process memory dump files as zip file (is available)

Parameters:

  • id (String)

    Id in one of format: ‘jobId’ or ‘sha256:environmentId’

Returns:

  • (Hash)


24
25
26
# File 'lib/hybridanalysis/clients/report.rb', line 24

def memory_dumps(id)
  _get("/report/#{id}/memory-dumps") { |json| json }
end

#pcap(id) ⇒ Hash

downloading network PCAP file from report (is available)

Parameters:

  • id (String)

    Id in one of format: ‘jobId’ or ‘sha256:environmentId’

Returns:

  • (Hash)


35
36
37
# File 'lib/hybridanalysis/clients/report.rb', line 35

def pcap(id)
  _get("/report/#{id}/pcap") { |json| json }
end

#sample(id) ⇒ Hash

downloading sample file

Parameters:

  • id (String)

    Id in one of format: ‘jobId’ or ‘sha256:environmentId’

Returns:

  • (Hash)


46
47
48
# File 'lib/hybridanalysis/clients/report.rb', line 46

def sample(id)
  _get("/report/#{id}/sample") { |json| json }
end

#screenshots(id) ⇒ Hash

retrieve an array of screenshots from a report in the Base64 format

Parameters:

  • id (String)

    Id in one of format: ‘jobId’ or ‘sha256:environmentId’

Returns:

  • (Hash)


103
104
105
# File 'lib/hybridanalysis/clients/report.rb', line 103

def screenshots(id)
  _get("/report/#{id}/screenshots") { |json| json }
end

#state(id) ⇒ Hash

return state of a submission

Parameters:

  • id (String)

    Id in one of format: ‘jobId’ or ‘sha256:environmentId’

Returns:

  • (Hash)


57
58
59
# File 'lib/hybridanalysis/clients/report.rb', line 57

def state(id)
  _get("/report/#{id}/state") { |json| json }
end

#summaries(*hashes) ⇒ Array

return summary of multiple submissions (bulk query)

Parameters:

  • hashes[] (Array<String>)

    List of ids. Allowed format: jobId, md5:environmentId, sha1:environmentId or sha256:environmentId

Returns:

  • (Array)


79
80
81
82
# File 'lib/hybridanalysis/clients/report.rb', line 79

def summaries(*hashes)
  params = { "hashes[]": hashes }.compact
  _post("/report/summary", params) { |json| json }
end

#summary(id) ⇒ Hash

return summary of a submission

Parameters:

  • id (String)

    Id in one of format: ‘jobId’ or ‘sha256:environmentId’

Returns:

  • (Hash)


68
69
70
# File 'lib/hybridanalysis/clients/report.rb', line 68

def summary(id)
  _get("/report/#{id}/summary") { |json| json }
end