Skip to content

Commit f9faa9b

Browse files
author
GomoR
committed
4.19.0 Fri 14 Mar 16:23:17 CET 2025
- WARNING: ASD APIs are still BETA and interface may be subject to change - Bugfix: onyphe: -asd-pivot-query needs -field param - Bugfix: Onyphe::Api: check api keys & endpoints are configured from .onyphe.ini or dies - New: onyphe: -asd-score-inventory API - New: onyphe: -asd-domain-soa API - Update: onyphe: review of usage information - Update: onyphe: -aslines set to 0 by default for -asd-score-inventory API, and to 1 for others APIs - Rename: onyphe: -asd-ip-whois to -asd-subnet-inventory - Rename: onyphe: -asd-domain-exist to -asd-dns-domain-exist - Rename: onyphe: -asd-domain-ns to -asd-dns-domain-ns - Rename: onyphe: -asd-domain-mx to -asd-dns-domain-mx - Rename: onyphe: -asd-domain-soa to -asd-dns-domain-soa - Rename: onyphe: -asd-domain-ns to -asd-dns-domain-ns
1 parent 36f97cf commit f9faa9b

File tree

7 files changed

+199
-56
lines changed

7 files changed

+199
-56
lines changed

Changes

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
11
Revision history for Perl extension Onyphe.
22

3+
4.19.0 Fri 14 Mar 16:23:17 CET 2025
4+
- WARNING: ASD APIs are still BETA and interface may be subject to change
5+
- Bugfix: onyphe: -asd-pivot-query needs -field param
6+
- Bugfix: Onyphe::Api: check api keys & endpoints are configured from .onyphe.ini or dies
7+
- New: onyphe: -asd-score-inventory API
8+
- New: onyphe: -asd-domain-soa API
9+
- Update: onyphe: review of usage information
10+
- Update: onyphe: -aslines set to 0 by default for -asd-score-inventory API,
11+
and to 1 for others APIs
12+
- Rename: onyphe: -asd-ip-whois to -asd-subnet-inventory
13+
- Rename: onyphe: -asd-domain-exist to -asd-dns-domain-exist
14+
- Rename: onyphe: -asd-domain-ns to -asd-dns-domain-ns
15+
- Rename: onyphe: -asd-domain-mx to -asd-dns-domain-mx
16+
- Rename: onyphe: -asd-domain-soa to -asd-dns-domain-soa
17+
- Rename: onyphe: -asd-domain-ns to -asd-dns-domain-ns
18+
319
4.18 Tue 4 Mar 16:02:41 CET 2025
20+
- WARNING: ASD APIs are still BETA and interface may be subject to change
421
- New: OPP Proc: rename to rename fields
522
- New: onyphe: -includep & -excludep arguments
623
- Rename: Onyphe::Api: all ASD APIs

META.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,11 @@
178178
},
179179
"Onyphe" : {
180180
"file" : "lib/Onyphe.pm",
181-
"version" : "4.18"
181+
"version" : "v4.19.0"
182182
},
183183
"Onyphe::Api" : {
184184
"file" : "lib/Onyphe/Api.pm",
185-
"version" : "4.18"
185+
"version" : "v4.19.0"
186186
}
187187
},
188188
"release_status" : "stable",
@@ -191,6 +191,6 @@
191191
"http://opensource.org/licenses/BSD-3-Clause"
192192
]
193193
},
194-
"version" : "4.18",
194+
"version" : "v4.19.0",
195195
"x_serialization_backend" : "JSON::PP version 4.06"
196196
}

META.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,10 @@ provides:
117117
version: '1.00'
118118
Onyphe:
119119
file: lib/Onyphe.pm
120-
version: '4.18'
120+
version: v4.19.0
121121
Onyphe::Api:
122122
file: lib/Onyphe/Api.pm
123-
version: '4.18'
123+
version: v4.19.0
124124
requires:
125125
Carp: '0'
126126
Config::INI::Tiny: '0'
@@ -139,5 +139,5 @@ requires:
139139
Tie::IxHash: '0'
140140
resources:
141141
license: http://opensource.org/licenses/BSD-3-Clause
142-
version: '4.18'
142+
version: v4.19.0
143143
x_serialization_backend: 'CPAN::Meta::YAML version 0.018'

bin/onyphe

Lines changed: 44 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env perl
22
#
3-
# $Id: onyphe,v f6e25824c774 2025/03/04 14:57:46 gomor $
3+
# $Id: onyphe,v 6200d9520468 2025/03/14 14:28:43 gomor $
44
#
55
use strict;
66
use warnings;
@@ -89,17 +89,19 @@ GetOptions(
8989
# ASD APIs:
9090
"asd-pivot-query=s" => \$lopts{'asd-pivot-query'},
9191
"asd-domain-tld=s" => \$lopts{'asd-domain-tld'},
92-
"asd-domain-ns=s" => \$lopts{'asd-domain-ns'},
93-
"asd-domain-mx=s" => \$lopts{'asd-domain-mx'},
9492
"asd-domain-certso=s" => \$lopts{'asd-domain-certso'},
9593
"asd-domain-wildcard=s" => \$lopts{'asd-domain-wildcard'},
96-
"asd-domain-exist=s" => \$lopts{'asd-domain-exist'},
9794
"asd-certso-domain=s" => \$lopts{'asd-certso-domain'},
9895
"asd-certso-wildcard=s" => \$lopts{'asd-certso-wildcard'},
9996
"asd-org-inventory=s" => \$lopts{'asd-org-inventory'},
100-
"asd-ip-whois=s" => \$lopts{'asd-ip-whois'},
10197
"asd-ip-inventory=s" => \$lopts{'asd-ip-inventory'},
98+
"asd-subnet-inventory=s" => \$lopts{'asd-subnet-inventory'},
10299
"asd-vhost-inventory=s" => \$lopts{'asd-vhost-inventory'},
100+
"asd-score-inventory=s" => \$lopts{'asd-score-inventory'},
101+
"asd-dns-domain-ns=s" => \$lopts{'asd-dns-domain-ns'},
102+
"asd-dns-domain-mx=s" => \$lopts{'asd-dns-domain-mx'},
103+
"asd-dns-domain-soa=s" => \$lopts{'asd-dns-domain-soa'},
104+
"asd-dns-domain-exist=s" => \$lopts{'asd-dns-domain-exist'},
103105
"asd-task-id=s" => \$lopts{'asd-task-id'},
104106
"asd-task-poll=s" => \$lopts{'asd-task-poll'},
105107
"asd-task-list" => \$lopts{'asd-task-list'},
@@ -195,8 +197,14 @@ my $opp_json_cb = sub {
195197
$opp->process_as_json(\@results, $opl);
196198
};
197199

198-
# Set default values for arguments:
199-
$lopts{aslines} = 1 unless defined($lopts{aslines});
200+
# Exception for ASD Score Inventory API:
201+
if (defined($lopts{'asd-score-inventory'}) && !defined($lopts{aslines})) {
202+
$lopts{aslines} = 0;
203+
}
204+
else {
205+
# Set default values for arguments:
206+
$lopts{aslines} = 1 unless defined($lopts{aslines});
207+
}
200208

201209
my $opp_cb = $lopts{aslines} ? $opp_json_cb : $opp_perl_cb;
202210

@@ -421,6 +429,14 @@ elsif (defined($asd_api_opt)) {
421429
my $v = $lopts{$asd_api_opt};
422430
$oa->$asd_api_func($v, $params, $opp_cb, $opl);
423431
}
432+
elsif ($asd_api_opt =~ m{^asd-pivot}) {
433+
my $v = $lopts{$asd_api_opt};
434+
$params->{field} = $lopts{field} if defined $lopts{field};
435+
$params->{astask} = $lopts{astask} if defined $lopts{astask};
436+
$params->{includep} = $lopts{includep} if defined $lopts{includep};
437+
$params->{excludep} = $lopts{excludep} if defined $lopts{excludep};
438+
$oa->$asd_api_func($v, $params, $opp_cb, $opl);
439+
}
424440
else {
425441
$params->{astask} = $lopts{astask} if defined $lopts{astask};
426442
$params->{trusted} = $lopts{trusted} if defined $lopts{trusted};
@@ -467,8 +483,8 @@ API options:
467483
-import <0|1> turn off/on import of results into ONYPHE
468484
-trusted <0|1> turn off/on trusted results from ONYPHE ASD APIs
469485
-field <FIELD> use given field to set field param on API call
470-
-includep <WORD1,WORD2,...,WORD3> use given inclusion patterns on param API call
471-
-excludep <WORD1,WORD2,...,WORD3> use given exclusion patterns on param API call
486+
-includep <WORD1,WORD2,...,WORD3> use given inclusion patterns on param API call
487+
-excludep <WORD1,WORD2,...,WORD3> use given exclusion patterns on param API call
472488
473489
General APIs:
474490
@@ -499,30 +515,35 @@ Ondemand APIs:
499515
-ondemand-scope-hostname 'HOSTNAME' launch a scan against given hostname
500516
-ondemand-scope-hostname-bulk 'input.txt' launch a scan against a given list of hostname from an input file
501517
-ondemand-scope-port PORT launch a scan against a given port on full IPv4 address space
502-
-ondemand-scope-result \$scan_id retrieve a scope scan results given a scan ID
518+
-ondemand-scope-result SCAN_ID retrieve a scope scan results given a scan ID
503519
-ondemand-resolver-domain 'DOMAIN' launch a DNS enumeration and resolution against given domain
504520
-ondemand-resolver-domain-bulk 'input.txt' launch a DNS enumeration and resolution against a given list of domain from an input file
505-
-ondemand-resolver-result \$scan_id retrieve a resolver scan results given a scan ID
521+
-ondemand-resolver-result SCAN_ID retrieve a resolver scan results given a scan ID
506522
507523
ASD APIs:
508524
509-
-asd-pivot-query OQL -field FIELD search unique values for a given field from an OQL query
510-
-asd-domain-tld DOMAIN1,DOMAIN2,...|input.txt search related domains by TLDs
511-
-asd-domain-ns DOMAIN1,DOMAIN2,...|input.txt search related domains by using nameservers
512-
-asd-domain-mx DOMAIN1,DOMAIN2,...|input.txt search related domains by using MX records
525+
-asd-pivot-query OQL -field FIELD search unique value(s) for a given field from an OQL query
526+
-asd-domain-tld DOMAIN1,DOMAIN2,...|input.txt search related domain(s) by TLDs
513527
-asd-domain-certso SO1,SO2,...|input.txt search domain(s) belonging to given subject orgnanization(s)
514528
-asd-domain-wildcard DOMAIN1,DOMAIN2,...|input.txt search domain(s) matching given wildcard(s)
515-
-asd-domain-exist DOMAIN1,DOMAIN2,...|input.txt search existing domain(s)
516529
-asd-certso-domain DOMAIN1,DOMAIN2,...|input.txt search subject organization(s) belonging to given domain(s)
517530
-asd-certso-wildcard SO1,SO2,...|input.txt search subject organization(s) matching given wildcard(s)
518-
-asd-org-inventory INVENTORY.txt search hosting organization(s) for given inventory data
519-
-asd-ip-whois INVENTORY.txt search subnet(s) belonging to given inventory data
520-
-asd-ip-inventory INVENTORY.txt search ip value(s) for given inventory data
521-
-asd-vhost-inventory INVENTORY.txt search forward value(s) for given inventory data
522-
-asd-task-id TASKID retrieve an ASD Task results for given task ID
523-
-asd-task-poll TASKID retrieve an ASD Task results by polling given task ID
531+
-asd-org-inventory INVENTORY.txt search hosting organization(s) for given inventory data
532+
-asd-ip-inventory INVENTORY.txt search ip(s) for given inventory data
533+
-asd-subnet-inventory INVENTORY.txt search subnet(s) belonging to given inventory data
534+
-asd-vhost-inventory INVENTORY.txt search forward(s) for given inventory data
535+
-asd-score-inventory INVENTORY.txt search risks for given inventory, compute a score and returns data
536+
-asd-task-id TASK_ID retrieve an ASD Task results for given task ID
537+
-asd-task-poll TASK_ID retrieve an ASD Task results by polling given task ID
524538
-asd-task-list list all tasks, actually running or finished
525-
-asd-task-kill kill a given task ID
539+
-asd-task-kill TASK_ID kill a given task ID
540+
541+
WARNING: the following APIs will execute DNS requests:
542+
543+
-asd-dns-domain-ns DOMAIN1,DOMAIN2,...|input.txt search related domain(s) by using nameservers
544+
-asd-dns-domain-mx DOMAIN1,DOMAIN2,...|input.txt search related domain(s) by using MX records
545+
-asd-dns-domain-soa DOMAIN1,DOMAIN2,...|input.txt search related domain(s) by using SOA records
546+
-asd-dns-domain-exist DOMAIN1,DOMAIN2,...|input.txt search existing domain(s)
526547
527548
EOF
528549
;

install.sh

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,28 @@ then
2121
if [[ ! -f ~/.onyphe.ini ]]
2222
then
2323
echo "*** Creating .onyphe.ini squeleton..."
24-
echo 'api_endpoint = https://www.onyphe.io/api/v2' > ~/.onyphe.ini
24+
echo '# General APIs:' > ~/.onyphe.ini
25+
echo 'api_endpoint = https://www.onyphe.io/api/v2' >> ~/.onyphe.ini
2526
echo "api_key = $APIKEY" >> ~/.onyphe.ini
27+
echo '' >> ~/.onyphe.ini
28+
echo '# Unrated General APIs option:' >> ~/.onyphe.ini
29+
echo '#api_unrated_endpoint = https://www.onyphe.io/unrated/api/v2' >> ~/.onyphe.ini
30+
echo '#api_unrated_email = youremail@yourdomain.lan' >> ~/.onyphe.ini
31+
echo '' >> ~/.onyphe.ini
32+
echo '# Ondemand APIs:' >> ~/.onyphe.ini
33+
echo 'api_ondemand_endpoint = https://www.onyphe.io/api/v3' >> ~/.onyphe.ini
34+
echo "api_ondemand_key = $APIKEY" >> ~/.onyphe.ini
35+
echo '' >> ~/.onyphe.ini
36+
echo '# ASD APIs:' >> ~/.onyphe.ini
37+
echo 'api_asd_endpoint = https://www.onyphe.io/api/v1' >> ~/.onyphe.ini
38+
echo "api_asd_key = $APIKEY" >> ~/.onyphe.ini
39+
echo '' >> ~/.onyphe.ini
40+
echo '# Tunables:' >> ~/.onyphe.ini
2641
echo 'api_maxpage = 1000' >> ~/.onyphe.ini
42+
echo '#api_size = 100' >> ~/.onyphe.ini
43+
echo '#api_trackquery = 1' >> ~/.onyphe.ini
44+
echo '#api_calculated = 1' >> ~/.onyphe.ini
45+
echo '#api_keepalive = 0' >> ~/.onyphe.ini
2746
echo "*** Creating .onyphe.ini squeleton...done"
2847
echo ''
2948
fi
@@ -39,9 +58,28 @@ else
3958
if [[ ! -f ~/.onyphe.ini ]]
4059
then
4160
echo "*** Creating .onyphe.ini squeleton..."
42-
echo 'api_endpoint = https://www.onyphe.io/api/v2' > ~/.onyphe.ini
61+
echo '# General APIs:' > ~/.onyphe.ini
62+
echo 'api_endpoint = https://www.onyphe.io/api/v2' >> ~/.onyphe.ini
4363
echo "api_key = $APIKEY" >> ~/.onyphe.ini
64+
echo '' >> ~/.onyphe.ini
65+
echo '# Unrated General APIs option:' >> ~/.onyphe.ini
66+
echo '#api_unrated_endpoint = https://www.onyphe.io/unrated/api/v2' >> ~/.onyphe.ini
67+
echo '#api_unrated_email = youremail@yourdomain.lan' >> ~/.onyphe.ini
68+
echo '' >> ~/.onyphe.ini
69+
echo '# Ondemand APIs:' >> ~/.onyphe.ini
70+
echo 'api_ondemand_endpoint = https://www.onyphe.io/api/v3' >> ~/.onyphe.ini
71+
echo "api_ondemand_key = $APIKEY" >> ~/.onyphe.ini
72+
echo '' >> ~/.onyphe.ini
73+
echo '# ASD APIs:' >> ~/.onyphe.ini
74+
echo 'api_asd_endpoint = https://www.onyphe.io/api/v1' >> ~/.onyphe.ini
75+
echo "api_asd_key = $APIKEY" >> ~/.onyphe.ini
76+
echo '' >> ~/.onyphe.ini
77+
echo '# Tunables:' >> ~/.onyphe.ini
4478
echo 'api_maxpage = 1000' >> ~/.onyphe.ini
79+
echo '#api_size = 100' >> ~/.onyphe.ini
80+
echo '#api_trackquery = 1' >> ~/.onyphe.ini
81+
echo '#api_calculated = 1' >> ~/.onyphe.ini
82+
echo '#api_keepalive = 0' >> ~/.onyphe.ini
4583
echo "*** Creating .onyphe.ini squeleton...done"
4684
echo ''
4785
fi

lib/Onyphe.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#
2-
# $Id: Onyphe.pm,v 89c47923554c 2025/02/10 07:46:31 gomor $
2+
# $Id: Onyphe.pm,v 70c24256e451 2025/03/05 16:13:54 gomor $
33
#
44
package Onyphe;
55
use strict;
66
use warnings;
77

8-
our $VERSION = '4.18';
8+
our $VERSION = '4.19.0';
99

1010
use experimental qw(signatures);
1111

0 commit comments

Comments
 (0)