rattfieldnz / shodan
A laravel package to check URLs with Shodan API.
Fund package maintenance!
www.blockchain.com/btc/payment_request?address=13vYNWKj3npQTYr7EJVBhcoVkwncEbDUvJ
Installs: 7
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 4
Forks: 0
Open Issues: 5
Language:HTML
Type:package
Requires
- php: >=7.2
- ext-curl: *
- ext-json: *
- curl/curl: ^2.2
- illuminate/support: ~8.31.0
Requires (Dev)
- barryvdh/laravel-ide-helper: 2.9.*
- fzaninotto/faker: ~1.8
- mockery/mockery: ^1.4
- orchestra/testbench: ^6.13.0
- php-cs-fixer/phpunit-constraint-isidenticalstring: ^1.2
- phpspec/prophecy: ^1.10.3
- phpunit/php-code-coverage: ^9.2.5
- phpunit/phpunit: ~9.5
- sempro/phpunit-pretty-print: ^1.4
- squizlabs/php_codesniffer: ^3.5
- dev-master
- 1.0.2
- 1.0.1
- 1.0.0
- dev-dependabot/composer/symfony/http-kernel-5.4.20
- dev-dependabot/composer/composer/composer-2.3.5
- dev-dependabot/composer/guzzlehttp/psr7-1.8.5
- dev-dependabot/composer/doctrine/dbal-3.1.4
- dev-dependabot/composer/league/flysystem-1.1.4
- dev-scrutinizer-patch-3
- dev-scrutinizer-patch-2
- dev-analysis-z45E2w
- dev-analysis-zOld6L
- dev-analysis-XVJA9D
- dev-scrutinizer-patch-1
- dev-analysis-qvlMOr
This package is auto-updated.
Last update: 2024-10-30 01:31:53 UTC
README
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
Installation
Install via composer
composer require rattfieldnz/shodan
Register Service Provider
Note! 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 Facade
Register package facade in config/app.php
in aliases
section
RattfieldNz\Shodan\Facades\ShodanFacade::class,
Publish Configuration File
php artisan vendor:publish --provider="RattfieldNz\Shodan\ShodanServiceProvider" --tag="shodan"
Set your Shodan API key
In your .env
, add:
SHODAN_API_KEY=YOUR-ACTUAL-API-KEY SHODAN_REQUEST_TIMEOUT=10
Usage
Using Blade Syntax
@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> @endif
getResults(true)
returns results as JSON-encoded string.
Using Facades
Shodan::setUrl('https://github.com'); Shodan::check(); Shodan::getResults();
Or:
Shodan::setUrl('https://github.com')->check()->getResults();
Example with input and output (associative array)
View EXAMPLE_INPUT_OUTPUT_ASSOCIATIVEARRAY.md.
Example with input and output (JSON)
View EXAMPLE_INPUT_OUTPUT_JSON.md.
Testing
From inside the root folder of this package:
$ chmod u+x run_phpunit && ./run_phpunit YOUR_SHODAN_API_KEY
Replace YOUR_SHODAN_API_KEY with your actual key. Get one by visiting https://developer.shodan.io/api.
Security
If you discover any security related issues, please email emailme@robertattfield.com instead of using the issue tracker.
Credits
This package is bootstrapped with the help of melihovv/laravel-package-generator.