Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rattfieldnz/shodan
A laravel package to check URLs with Shodan API.
https://github.com/rattfieldnz/shodan
api laravel php shodan shodan-api
Last synced: 16 days ago
JSON representation
A laravel package to check URLs with Shodan API.
- Host: GitHub
- URL: https://github.com/rattfieldnz/shodan
- Owner: rattfieldnz
- License: mit
- Created: 2019-08-17T06:01:28.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-02-01T22:08:50.000Z (almost 2 years ago)
- Last Synced: 2024-10-12T10:47:09.198Z (about 1 month ago)
- Topics: api, laravel, php, shodan, shodan-api
- Language: HTML
- Homepage:
- Size: 667 KB
- Stars: 4
- Watchers: 4
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Shodan
[![PHP Version](https://img.shields.io/badge/php-7.3%2B-green.svg)](https://packagist.org/packages/rattfieldnz/shodan) [![PHP Version](https://img.shields.io/badge/php-7.2%2B-green.svg)](https://packagist.org/packages/rattfieldnz/shodan)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Latest Version on Packagist][ico-version]][link-packagist]
[![Total Downloads][ico-downloads]][link-downloads]
[![Build Status][ico-travis]][link-travis]
[![StyleCI][ico-styleci]][link-styleci]
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/rattfieldnz/shodan/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/rattfieldnz/shodan/?branch=master)
[![codecov](https://codecov.io/gh/rattfieldnz/shodan/branch/master/graph/badge.svg)](https://codecov.io/gh/rattfieldnz/shodan)A laravel package to check URLs with Shodan API.
* [Installation](#installation)
* [Register Service Provider](#register_service_provider)
* [Register Facade](#register_facade)
* [Register Facade](#register_facade)
* [Publish Configuration File](#publish_config_file)
* [Set your Shodan API key](#set_shodan_api_key)
* [Usage](#usage)
* [Using Blade Syntax](#using_blade_syntax)
* [Using Facades](#using_facades)
* [Example with input and output (associative array)](#example_input_output_associative_array)
* [Example with input and output (JSON)](#example_input_output_json)
* [Testing](#testing)
* [Security](#security)
* [Credits](#credits)Install via composer
```bash
composer require rattfieldnz/shodan
```**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.
```php
RattfieldNz\Shodan\ShodanServiceProvider::class,
```Register package facade in `config/app.php` in `aliases` section
```php
RattfieldNz\Shodan\Facades\ShodanFacade::class,
```### Publish Configuration File
```bash
php artisan vendor:publish --provider="RattfieldNz\Shodan\ShodanServiceProvider" --tag="shodan"
```In your `.env`, add:
```bash
SHODAN_API_KEY=YOUR-ACTUAL-API-KEY
SHODAN_REQUEST_TIMEOUT=10
``````php
@if(isset(Shodan::setUrl('https://github.com')->check()->getResults()))
// Iterate over associative array results.
// getResults(true) returns results as JSON-encoded string.
@else
No results were found
@endif
````getResults(true)` returns results as JSON-encoded string.
```php
Shodan::setUrl('https://github.com');
Shodan::check();
Shodan::getResults();
```Or:
```php
Shodan::setUrl('https://github.com')->check()->getResults();
```
## Example with input and output (associative array)View [EXAMPLE_INPUT_OUTPUT_ASSOCIATIVEARRAY.md](https://github.com/rattfieldnz/shodan/blob/master/EXAMPLE_INPUT_OUTPUT_ASSOCIATIVEARRAY.md).
## Example with input and output (JSON)
View [EXAMPLE_INPUT_OUTPUT_JSON.md](https://github.com/rattfieldnz/shodan/blob/master/EXAMPLE_INPUT_OUTPUT_JSON.md).
From inside the root folder of this package:
``` bash
$ 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](https://developer.shodan.io/api).If you discover any security related issues, please email [email protected]
instead of using the issue tracker.- [Robert Attfield](https://github.com/rattfieldnz/shodan)
- [All contributors](https://github.com/rattfieldnz/shodan/graphs/contributors)This package is bootstrapped with the help of
[melihovv/laravel-package-generator](https://github.com/melihovv/laravel-package-generator).[ico-version]: https://img.shields.io/packagist/v/rattfieldnz/shodan.svg?style=flat-square
[ico-downloads]: https://img.shields.io/packagist/dt/rattfieldnz/shodan.svg?style=flat-square
[ico-travis]: https://img.shields.io/travis/rattfieldnz/shodan/master.svg?style=flat-square
[ico-styleci]: https://styleci.io/repos/202842370/shield[link-packagist]: https://packagist.org/packages/rattfieldnz/shodan
[link-downloads]: https://packagist.org/packages/rattfieldnz/shodan
[link-travis]: https://travis-ci.org/rattfieldnz/shodan
[link-styleci]: https://styleci.io/repos/202842370
[link-author]: https://github.com/rattfieldnz