A laravel package to check URLs with Shodan API.
- Installation
- Usage
- Example with input and output (associative array)
- Example with input and output (JSON)
- Testing
- Security
- Credits
Install via composer
composer require rattfieldnz/shodanNote! This and next step are optional if you use laravel>=5.5 with package auto discovery feature.
Add service provider to config/app.php in providers section.
RattfieldNz\Shodan\ShodanServiceProvider::class,Register package facade in config/app.php in aliases section
RattfieldNz\Shodan\Facades\ShodanFacade::class,php artisan vendor:publish --provider="RattfieldNz\Shodan\ShodanServiceProvider" --tag="shodan"In your .env, add:
SHODAN_API_KEY=YOUR-ACTUAL-API-KEY
SHODAN_REQUEST_TIMEOUT=10@if(isset(Shodan::setUrl('https://github.com')->check()->getResults()))
// Iterate over associative array results.
// getResults(true) returns results as JSON-encoded string.
@else
<p>No results were found</p>
@endifgetResults(true) returns results as JSON-encoded string.
Shodan::setUrl('https://github.com');
Shodan::check();
Shodan::getResults();Or:
Shodan::setUrl('https://github.com')->check()->getResults();View EXAMPLE_INPUT_OUTPUT_ASSOCIATIVEARRAY.md.
View EXAMPLE_INPUT_OUTPUT_JSON.md.
From inside the root folder of this package:
$ chmod u+x run_phpunit && ./run_phpunit YOUR_SHODAN_API_KEYReplace YOUR_SHODAN_API_KEY with your actual key. Get one by visiting https://developer.shodan.io/api.
If you discover any security related issues, please email emailme@robertattfield.com instead of using the issue tracker.
This package is bootstrapped with the help of melihovv/laravel-package-generator.
