diff --git a/README.md b/README.md index 8467dcf5..15a973f5 100644 --- a/README.md +++ b/README.md @@ -54,8 +54,9 @@ Mitaka is a browser extension that makes your OSINT (Open Source Intelligence) s | Checkphish | https://checkphish.ai | IP, domain | | Coalition | https://ess.coalitioninc.com | CVE | | crt.sh | https://crt.sh | Domain | -| DNSlytics | https://dnslytics.com | IP, domain | +| CVE | https://cve.org | CVE | | DNS Coffee | https://dns.coffee | Domain | +| DNSlytics | https://dnslytics.com | IP, domain | | DomainTools | https://www.domaintools.com | IP, domain | | EmailRep | https://emailrep.io | Email | | FileScan.IO | https://filescan.io | Hash | diff --git a/src/searcher/cve.ts b/src/searcher/cve.ts new file mode 100644 index 00000000..e9f26c8a --- /dev/null +++ b/src/searcher/cve.ts @@ -0,0 +1,22 @@ +import { ok } from "neverthrow"; + +import type { SearchableType } from "~/schemas"; +import { buildURL } from "~/utils"; + +import { Base } from "./base"; + +export class CVE extends Base { + public baseURL: string; + public name: string; + public supportedTypes: SearchableType[] = ["cve"]; + + public constructor() { + super(); + this.baseURL = "https://cve.org"; + this.name = "CVE"; + } + + public searchByCVE(query: string) { + return ok(buildURL(this.baseURL, `/CVERecord?id=${query}`)); + } +} diff --git a/src/searcher/index.ts b/src/searcher/index.ts index 2fc7802e..e4067d7c 100644 --- a/src/searcher/index.ts +++ b/src/searcher/index.ts @@ -30,6 +30,7 @@ import { JoeSandbox, Maltiverse, MalwareBazaar, + MITRE, NVD, OCCRP, ONYPHE, @@ -71,6 +72,7 @@ export { Censys } from "./censys"; export { CheckPhish } from "./checkphish"; export { Coalition } from "./coalition"; export { Crtsh } from "./crtsh"; +export { CVE as MITRE } from "./cve"; export { DNSCoffee } from "./dnsCoffee"; export { DNSlytics } from "./dnslytics"; export { DomainBigData } from "./domainbigdata"; @@ -156,6 +158,7 @@ export const Searchers: Searcher[] = [ new JoeSandbox(), new Maltiverse(), new MalwareBazaar(), + new MITRE(), new NVD(), new OCCRP(), new ONYPHE(), diff --git a/tests/searcher/cve.spec.ts b/tests/searcher/cve.spec.ts new file mode 100644 index 00000000..85a15138 --- /dev/null +++ b/tests/searcher/cve.spec.ts @@ -0,0 +1,18 @@ +import { MITRE } from "~/searcher"; + +describe("MITRE", function () { + const subject = new MITRE(); + + it("should support cve", function () { + expect(subject.supportedTypes).toEqual(["cve"]); + }); + + describe("#searchByCVE", function () { + const cve = "CVE-2018-8013"; + it("should return a URL", function () { + expect(subject.searchByCVE(cve)._unsafeUnwrap()).toBe( + `https://cve.org/CVERecord?id=${cve}`, + ); + }); + }); +});