Installation
When we speak about data and API access, we have to provide users with a Command Line Interface (CLI). That’s the best way to interact with APIs. Furthermore, we have created our own ONYPHE Processing Pipeline language called OPP.
It’s basically an expandable way of parsing JSON, like jq, but in a more easier way to play with. This OPP language is now also a standalone tool you can use on any JSON data.
Dependencies for Ubuntu/Debian/Kali systems
sudo apt-get install cpanminus libmojolicious-perl libtie-ixhash-perl
sudo apt-get install liblwp-protocol-https-perl libjson-xs-perl libfile-slurp-perl
sudo apt-get install libregexp-ipv6-perl libtext-csv-xs-perl
sudo cpanm -n Config::INI::Tiny Text::ParseWords Net::IPv4Addr Regexp::IPv4
Dependencies for other systems
First, install your system cpanminus package. Then, install Perl dependencies:
sudo cpanm -n Mojolicious Config::INI::Tiny Tie::IxHash LWP::Protocol::https JSON::XS
sudo cpanm -n Text::ParseWords File::Slurp
sudo cpanm -n Regexp::IPv4 Text::CSV_XS Net::IPv4Addr Regexp::IPv6
Configure ONYPHE CLI
You have to setup your API key in order to access ONYPHE API with your license authorizations:
echo 'api_endpoint = https://www.onyphe.io/api/v2' > ~/.onyphe.ini
echo 'api_key = YOUR_APIKEY' >> ~/.onyphe.ini
Install ONYPHE CLI Perl module
Now, you can install the ONYPHE CLI Perl module itself, as dependencies and configuration are ready:
wget https://github.com/onyphe/training/raw/master/Onyphe-4.08.tar.gz
tar zxvf Onyphe-4.08.tar.gz
cd Onyphe-4.08
perl Build.PL
./Build && ./Build test
sudo ./Build install
You’re done
To verify everything works, you can try the following queries:
onyphe -version
onyphe -help
onyphe -search 'protocol:http | uniq domain | addcount'
More configuration options
Automatic paging
Maybe you want to setup automatic paging with Search API? There is an option for that. By default, it is not activated as each page consume 1 query credit. Thus, by default, searches only render 1 page and consume 1 credit.
echo 'api_maxpage = 1000' >> ~/.onyphe.ini
onyphe -search 'protocol:http | uniq domain | addcount'
For Unrated API option
We provide Unrated API access with a paid option to all our Enterprise licenses. Contact sales[at]onyphe{dot}io to learn more.
echo 'api_unrated_endpoint = https://www.onyphe.io/unrated/api/v2' > ~/.onyphe.ini
echo 'api_unrated_email = YOUR_LOGIN_EMAIL' >> ~/.onyphe.ini
echo 'api_key = YOUR_APIKEY' >> ~/.onyphe.ini