Coder Social home page Coder Social logo

nmapandroid's Introduction

NMAPAndroid

NMAP Android

This library include the NMAP binary for x86 and armeabi architectures.

Features

This library is based on kost/nmap-android repository at GitHub. There are compiled versions of NMAP for different architectures including:

  • arm64
  • armeabi
  • mips
  • mips64el
  • x86
  • x86_64

The difference of NMAPAndroid is that this library can be used as an API to install and run NMAP with custom commands. This library contains the binary data for arm and x86 based systems. The following flowchart shows the process of the NMAP Android installation.

NMAP Android Installation Process

Including Library In Your Project

Including the library is very simple. Just add the following dependency in your app level gradle file:

implementation 'ir.mstajbakhsh:nmap-android:1.0.0'

The only needed permission for the library is INTERNET which should be included in Manifest:

<uses-permission android:name="android.permission.INTERNET" />

Sample Code

The code is very simple. Just create a NMAPUtilities instance with a context. After that call startInstallation(). It will install automatically if it was not installed. After that pass an OutputStream and NMAP Params to the NMAPUtilities instance. That's it! ๐ŸŽ‰

Here is the code:

NMAPUtilities n = new NMAPUtilities(context);
n.startInstallation();

final StringBuilder line_buffer = new StringBuilder();
OutputStream ops = new OutputStream() {
	@Override
    public void write(int b) {
    	if (b == '\n') {
            System.out.println(line_buffer.toString());
            line_buffer.setLength(0);
        } else {
            line_buffer.append(Character.toChars(b));
        }
    }
};

try {
    n.execCommand(ops, "-A", "192.168.1.0/24", "--system-dns");
} catch (Exception e) {
    e.printStackTrace();
}

Here is the sample output:

Sample Result

Donate

โ˜• Don't forget to buy me a cup of coffee

My bitcoin wallet address:

1F5uiEmdCLJX5KktWHE1wkc63feKJYMmxS

Contact

You can reach me at my web site available at: https://mstajbakhsh.ir

nmapandroid's People

Contributors

mirsamantajbakhsh avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.