From 038c0fb6ee43c578546fa44b66b80219c9c788a3 Mon Sep 17 00:00:00 2001 From: Siddharth Balyan Date: Tue, 19 Jul 2022 10:36:24 +0200 Subject: [PATCH] BeVigil Source Added --- resources/scripts/api/bevigil.ads | 53 +++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 resources/scripts/api/bevigil.ads diff --git a/resources/scripts/api/bevigil.ads b/resources/scripts/api/bevigil.ads new file mode 100644 index 000000000..3e9d8c0cf --- /dev/null +++ b/resources/scripts/api/bevigil.ads @@ -0,0 +1,53 @@ +local json = require("json") + +name = "BeVigil" +type = "api" + +function start() + set_rate_limit(2) +end + +function check() + local c + local cfg = datasrc_config() + if cfg ~= nil then + c = cfg.credentials + end + + if (c ~= nil and c.key ~= nil and c.key ~= "") then + return true + end + return false +end + +function vertical(ctx, domain) + local c + local cfg = datasrc_config() + if cfg ~= nil then + c = cfg.credentials + end + + -- if (c == nil or c.key == nil or c.key == "") then + -- return + -- end + + local vurl = "http://osint.bevigil.com/api/" .. domain .. "/subdomains/" + local resp, err = request(ctx, { + url=vurl, + headers={['X-Access-Token']=c.key}, + }) + if (err ~= nil and err ~= "") then + log(ctx, "vertical request to service failed: " .. err) + return + end + + local d = json.decode(resp) + if (d == nil or #(d.subdomains) == 0) then + return + end + + for i, v in pairs(d.subdomains) do + new_name(ctx, v) + end + +end \ No newline at end of file