From db6fc081f99031abeb34159b468100425080cf84 Mon Sep 17 00:00:00 2001 From: Abdullah <111275753+abdullahdevrel@users.noreply.github.com> Date: Sat, 23 Mar 2024 10:09:41 +0500 Subject: [PATCH] Added Host.io for domain lookup --- README.md | 1 + src/searcher/hostio.ts | 18 ++++++++++++++++++ src/searcher/index.ts | 3 +++ tests/searcher/hostio.spec.ts | 18 ++++++++++++++++++ 4 files changed, 40 insertions(+) create mode 100644 src/searcher/hostio.ts create mode 100644 tests/searcher/hostio.spec.ts diff --git a/README.md b/README.md index 4e0da20f..d775fb8c 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,7 @@ Mitaka is a browser extension that makes your OSINT (Open Source Intelligence) s | FortiGuard | https://fortiguard.com | IP, URL, CVE | | Google Safe Browsing | https://transparencyreport.google.com | Domain, URL | | GreyNoise | https://viz.greynoise.io | IP, domain, ASN, CVE | +| Host.io | https://host.io | Domain | | Hurricane Electric | https://bgp.he.net/ | IP, domain, ASN | | HybridAnalysis | https://www.hybrid-analysis.com | IP, domain, hash | | Intezer | https://analyze.intezer.com | Hash | diff --git a/src/searcher/hostio.ts b/src/searcher/hostio.ts new file mode 100644 index 00000000..c771af62 --- /dev/null +++ b/src/searcher/hostio.ts @@ -0,0 +1,18 @@ +import type { SearchableType } from "~/schemas"; +import type { Searcher } from "~/types"; +import { buildURL } from "~/utils"; + +export class Hostio implements Searcher { + public baseURL: string; + public name: string; + public supportedTypes: SearchableType[] = ["domain"]; + + public constructor() { + this.baseURL = "https://host.io"; + this.name = "Host.io"; + } + + public searchByDomain(query: string): string { + return buildURL(this.baseURL, `/${query}`); + } +} diff --git a/src/searcher/index.ts b/src/searcher/index.ts index eed3f4cc..0e5dc59e 100644 --- a/src/searcher/index.ts +++ b/src/searcher/index.ts @@ -24,6 +24,7 @@ import { FortiGuard, GoogleSafeBrowsing, GreyNoise, + Hostio, HurricaneElectric, HybridAnalysis, InQuest, @@ -93,6 +94,7 @@ export { FOFA } from "./fofa"; export { FortiGuard } from "./fortiguard"; export { GoogleSafeBrowsing } from "./googlesafebrowsing"; export { GreyNoise } from "./greynoise"; +export { Hostio } from "./hostio"; export { HurricaneElectric } from "./hurricaneelectric"; export { HybridAnalysis } from "./hybridanalysis"; export { InQuest } from "./inquest"; @@ -163,6 +165,7 @@ export const Searchers: Searcher[] = [ new FortiGuard(), new GoogleSafeBrowsing(), new GreyNoise(), + new Hostio(), new HurricaneElectric(), new HybridAnalysis(), new InQuest(), diff --git a/tests/searcher/hostio.spec.ts b/tests/searcher/hostio.spec.ts new file mode 100644 index 00000000..3346af71 --- /dev/null +++ b/tests/searcher/hostio.spec.ts @@ -0,0 +1,18 @@ +import { Hostio } from "~/searcher"; + +describe("Hostio", function () { + const subject = new Hostio(); + + it("should support domain", function () { + expect(subject.supportedTypes).toEqual(["domain"]); + }); + + describe("#searchByDomain", function () { + const domain = "github.com"; + it("should return a URL", function () { + expect(subject.searchByDomain(domain)).toBe( + `https://host.io/${domain}`, + ); + }); + }); +});