-
-
Notifications
You must be signed in to change notification settings - Fork 185
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 #92 from kpcyrd/current_exe
Fix current_exe path issue on openbsd
- Loading branch information
Showing
8 changed files
with
1,259 additions
and
2,588 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
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,51 @@ | ||
-- Description: Add a domains NS records to scope | ||
-- Version: 0.1.0 | ||
-- License: GPL-3.0 | ||
-- Source: domains | ||
|
||
function strip_root_dot(name) | ||
local m = regex_find("(.+)\\.$", name) | ||
if last_err() then return end | ||
|
||
if m == nil then | ||
return name | ||
else | ||
return m[2] | ||
end | ||
end | ||
|
||
function each(r) | ||
local name = strip_root_dot(r) | ||
local domain = psl_domain_from_dns_name(name) | ||
if last_err() then return end | ||
|
||
-- add domain | ||
local domain_id = db_add('domain', { | ||
value=domain, | ||
}) | ||
if last_err() then return end | ||
if domain_id == nil then return end | ||
|
||
-- add subdomain | ||
local subdomain_id = db_add('subdomain', { | ||
domain_id=domain_id, | ||
value=name, | ||
}) | ||
if last_err() then return end | ||
end | ||
|
||
function run(arg) | ||
local records = dns(arg['value'], { | ||
record='NS', | ||
}) | ||
if last_err() then return end | ||
if records['error'] ~= nil then return end | ||
records = records['answers'] | ||
|
||
for i=1, #records do | ||
local r = records[i][2] | ||
debug(r) | ||
each(r['NS']) | ||
if last_err() then return end | ||
end | ||
end |
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,46 @@ | ||
-- Description: Search for the same domain base on all TLDs | ||
-- Version: 0.1.0 | ||
-- License: GPL-3.0 | ||
-- Source: domains | ||
|
||
function run(arg) | ||
local m = regex_find('^([^\\.]+)\\.', arg['value']) | ||
local base = m[2] | ||
|
||
-- TODO: we need a way to cache this | ||
-- TODO: .co.uk is missing | ||
local url = 'https://data.iana.org/TLD/tlds-alpha-by-domain.txt' | ||
|
||
local session = http_mksession() | ||
local req = http_request(session, 'GET', url, {}) | ||
local resp = http_send(req) | ||
if last_err() then return end | ||
if resp['status'] ~= 200 then | ||
return 'http error: ' .. resp['status'] | ||
end | ||
|
||
local tlds = regex_find_all('([^\n]+)', resp['text']) | ||
|
||
for i=1, #tlds do | ||
local tld = tlds[i][1]:lower() | ||
|
||
if not tld:match('^#') then | ||
local domain = base .. '.' .. tld | ||
|
||
debug(domain) | ||
records = dns(domain, { | ||
record='NS', | ||
}) | ||
if last_err() then | ||
clear_err() | ||
else | ||
if records['error'] == nil and records['answers'][1] then | ||
debug(records) | ||
db_add('domain', { | ||
value=domain, | ||
}) | ||
end | ||
end | ||
end | ||
end | ||
end |
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 |
---|---|---|
@@ -1,3 +1 @@ | ||
.env | ||
# this can be removed after -registry rejoins the workspace | ||
/target/ |
Oops, something went wrong.