-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #387 from ninoseki/add-intezer
feat: add Intezer lookup
- Loading branch information
Showing
4 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { buildURL } from "../url_builder"; | ||
import { Searcher, SearchableType } from "../types"; | ||
|
||
export class Intezer implements Searcher { | ||
public baseURL: string; | ||
public name: string; | ||
public supportedTypes: SearchableType[] = ["hash"]; | ||
|
||
public constructor() { | ||
this.baseURL = "https://analyze.intezer.com"; | ||
this.name = "Intezer"; | ||
} | ||
|
||
public searchByHash(query: string): string { | ||
return buildURL(this.baseURL, `/#/files/${query}`); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { expect } from "chai"; | ||
import "mocha"; | ||
import { Intezer } from "../../src/lib/searcher"; | ||
|
||
describe("Intezer", function() { | ||
const subject = new Intezer(); | ||
|
||
it("should support Hash type IOC", function() { | ||
expect(subject.supportedTypes).to.deep.equal(["hash"]); | ||
}); | ||
|
||
describe("#searchByHash", function() { | ||
it("should return URL", function() { | ||
const hash = | ||
"794374d3e3bd6f2bb232f61d2922d9dae3f78f864a2941f3b76157f82a3e6017"; | ||
expect(subject.searchByHash(hash)).to.equal( | ||
"https://analyze.intezer.com/#/files/794374d3e3bd6f2bb232f61d2922d9dae3f78f864a2941f3b76157f82a3e6017" | ||
); | ||
}); | ||
}); | ||
}); |