jShodan


Source link: https://github.com/fooock/jshodan

jShodan

Powerful Shodan client written using RxJava and Retrofit. You can integrate this client into existing apps or create new one. With this Shodan client you can:

  • Search Shodan
  • Exploit search
  • Streaming API to consume Shodan data in real time (in development)

Installation

If you use gradle add to your build.gradle

repositories {

  jcenter() 
}
 

Also you can use maven central

repositories {

  mavenCentral() 
}
 

And in your dependencies block add this line

compile 'com.fooock:jshodan:0.4.8' 

or if you are using maven add to you pom.xml

<dependency>
<groupId>com.fooock</groupId>
<artifactId>jshodan</artifactId>
<version>0.4.8</version>
<type>pom</type> </dependency> 

Getting started

You need an API key to use this client. You can do this in Shodan.io

  • Rest API
ShodanRestApi api = new ShodanRestApi("your api key here");

A simple example of query Shodan with facet info. Note that executing this query consumes 1 query credit

api.hostSearch("port:8333", "bitcoin.ip:10,city:10")
  .subscribe(new DisposableObserver<HostReport>() {

@Override

public void onCompleted() {

 // called when the request is completed

}

 @Override

public void onError(Throwable e) {

 // called if an error occurs

}

 @Override

public void onNext(HostReport hostReport) {

 // result of the query

}
 
}
);

The result of this, if success, is an object HostReport that contains all info.

int total = hostReport.getTotal();
 List<Banner> banners = hostReport.getBanners();
 FacetReport facet = hostReport.getFacet();

You can use other method calls from the rest API. See the ApiService class for a complete list.

  • Exploit API Use this API to search for exploits from multiple data sources like Exploit DB, Metasploit and CVE. The use of this API is very simply and similar to the previous
ShodanExploitApi api = new ShodanExploitApi("your api key here");

A simple example

api.search("ssl", "type")
  .subscribe(new DisposableObserver<ExploitReport>() {

@Override

public void onCompleted() {

 // called when the request is completed

}

 @Override

public void onError(Throwable e) {

 // called if an error occurs

}

 @Override

public void onNext(ExploitReport exploitReport) {

 // result of the query

}
 
}
);

The result of this call, if success, is ExploitReport class that contains all info

  • Streaming API This API returns a real-time stream of data collected by Shodan.
ShodanStreamingApi api = new ShodanStreamingApi("your api key here");

Example to get all data that Shodan collects

api.banners()
  .subscribe(new DisposableObserver<BannerReport>() {

@Override

public void onCompleted() {

 // called when the request is completed

}

 @Override

public void onError(Throwable e) {

 // called if an error occurs

}

 @Override

public void onNext(BannerReport bannerReport) {

 // result of the query

}
 
}
);

Note: To use the streaming API you need a Shodan subscription-based API plan. You can obtain it in Shodan pricing

Android support

If your plan is to create a new Android app using this, you need to add this dependency

compile 'io.reactivex.rxjava2:rxandroid:x.y.z' 

Dependencies

Enjoy it!

Roadmap

  1. Testing
  2. Documentation
  3. Better readme with more examples

Links

Resources

Android Library to change drawable color dynamically.

Extension of RecyclerView.Adapter. You can add header/footer to RecyclerView for LinearLayoutManager and GridLayoutManager.

Some useful utility classes for Android.

This library allows to generate low poly images.

A custom checkbox with animation.

Simple example for flip animation.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes