-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed #425 and updated the Spyse subdomain query
- Loading branch information
Showing
3 changed files
with
49 additions
and
276 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,49 @@ | ||
-- Copyright 2017 Jeff Foley. All rights reserved. | ||
-- Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. | ||
|
||
local json = require("json") | ||
|
||
name = "Spyse" | ||
type = "api" | ||
|
||
function start() | ||
setratelimit(2) | ||
end | ||
|
||
function vertical(ctx, domain) | ||
if (api == nil or api.key == "") then | ||
return | ||
end | ||
|
||
local page, err = request({ | ||
url=buildurl(domain), | ||
headers={['Authorization']="Bearer " .. api.key}, | ||
}) | ||
if (err ~= nil and err ~= "") then | ||
return | ||
end | ||
|
||
local resp = json.decode(page) | ||
if (resp == nil or #(resp['data'].items) == 0) then | ||
return | ||
end | ||
|
||
for i, item in pairs(resp['data'].items) do | ||
sendnames(ctx, item.name) | ||
end | ||
end | ||
|
||
function buildurl(domain) | ||
return "https://api.spyse.com/v3/data/domain/subdomain?limit=100&domain=" .. domain | ||
end | ||
|
||
function sendnames(ctx, content) | ||
local names = find(content, subdomainre) | ||
if names == nil then | ||
return | ||
end | ||
|
||
for i, v in pairs(names) do | ||
newname(ctx, v) | ||
end | ||
end |