Skip to main content

File Intel | Node.js SDK

The File Intel service enables you to submit a file's hash and get the file's attributes back - giving you insight into the disposition of the file.

File Intel

constructor(token: PangeaToken, config: PangeaConfig): FileIntelService

Creates a new FileIntelService with the given Pangea API token and configuration.

PangeaToken

Pangea API token.

Configuration.

FileIntelService
const config = new PangeaConfig({ domain: "pangea_domain" });
const fileIntel = new FileIntelService("pangea_token", config);

Reputation, from file path

filepathReputation(filepath: string, options: ReputationOptions): Promise<PangeaResponse<ReputationResult>>

Retrieve file reputation from a provider, using the file's hash.

string

Path to the file to be looked up

An object of optional parameters. Parameters supported:

  • provider {String} - Use reputation data from this provider: "reversinglabs". Default provider defined by the configuration.
  • verbose {Boolean} - Echo the API parameters in the response. Default: verbose=false.
  • raw {Boolean} - Include raw data from this provider. Default: raw=false.

Promise<PangeaResponse<ReputationResult>>
const response = await fileIntel.filepathReputation(
  "./myfile.exe",
  { provider: "reversinglabs" }
);

Reputation, from file paths

filepathReputationBulk(filepaths: string[], options: ReputationOptions): Promise<PangeaResponse<ReputationBulkResult>>

Retrieve file reputations from a provider, using the files' hashes.

Array<string>

Paths to the files to be looked up

An object of optional parameters. Parameters supported:

  • provider {String} - Use reputation data from this provider: "reversinglabs". Default provider defined by the configuration.
  • verbose {Boolean} - Echo the API parameters in the response. Default: verbose=false.
  • raw {Boolean} - Include raw data from this provider. Default: raw=false.

Promise<PangeaResponse<ReputationBulkResult>>
const response = await fileIntel.filepathReputationBulk(
  ["./myfile1.exe", "./myfile2.exe"],
  { provider: "reversinglabs" }
);

Reputation, from file hash

hashReputation(fileHash: string, hashType: string, options: ReputationOptions): Promise<PangeaResponse<ReputationResult>>

Retrieve hash-based file reputation from a provider, including an optional detailed report.

string

Hash of the file to be looked up

string

Type of hash, can be "sha256", "sha" or "md5"

An object of optional parameters

Promise<PangeaResponse<ReputationResult>>
const response = await fileIntel.hashReputation(
  "142b638c6a60b60c7f9928da4fb85a5a8e1422a9ffdc9ee49e17e56ccca9cf6e",
  "sha256",
  { provider: "reversinglabs" }
);

Reputation V2

hashReputationBulk(hashes: string[], hashType: string, options: ReputationOptions): Promise<PangeaResponse<ReputationBulkResult>>

Retrieve reputations for a list of file hashes, from a provider, including an optional detailed report.

Array<string>

Hashes of each file to be looked up

string

Type of hash, can be "sha256", "sha" or "md5"

An object of optional parameters

  • provider - Provider of the reputation information. ("reversinglabs"). Default provider defined by the configuration.
  • verbose - Echo back the parameters of the API in the response. Default: verbose=false.
  • raw - Return additional details from the provider. Default: raw=false.

Promise<PangeaResponse<ReputationBulkResult>>
const hashes = [
  "142b638c6a60b60c7f9928da4fb85a5a8e1422a9ffdc9ee49e17e56ccca9cf6e",
];

const response = await fileIntel.hashReputationBulk(
  hashes,
  "sha256",
  { provider: "reversinglabs" }
);