herzcthu/laravel-nmap

nmap wrapper for laravel 5.2
293 10
Install
composer require herzcthu/laravel-nmap
Latest Version:v0.1.0
PHP:>=5.3.0
License:MIT
Last Updated:Aug 25, 2020
Links: GitHub  ·  Packagist
Maintainer: herzcthu

LaravelNmap

Nmap wrapper for laravel.

Not all nmap arguments supported. All arguments method can use method chaining. But try to use correct combination according to nmap usage.

See below for supported arguments.

--help

$help = new LaravelNmap();
$help->NmapHelp();

-v (Verbose)

$nmap = new LaravelNmap();
$nmap->verbose();

-O (Detect OS)

$nmap->detectOS();

-sV (Detect Services)

$nmap->getServices();

-sn (Disable port scan - same with -sP) This method cannot be use with other scan type. See nmap help for more information.

$nmap->disablePortScan();

-p [ports] (select port scan - see more for nmap help)

$nmap->scanPorts('22,80,443');

*** target *** (This method is mandatory for all scan type)

$nmap->setTarget('192.168.43.0/24');

Output

There are 3 types of output.

  • Nmap raw output for stdout.
  • SimpleXML object
  • Array
$nmap->getRawOutput();
$nmap->getXmlObject();
$nmap->getArray();

Security

This package allow to use root permission if php user is in sudo group. Highly discourage if you don't know security risks regarding nmap.

Below code will enable sudo permission -

$nmap = new LaravelNmap(true);

Other options

Other options supported are setTimeout($seconds) and setEnv($name, $value).

If you want to increase default process timeout, use setTimeout().

Example:

$nmap->setTimeout('300');

If you want to set environment variable when running process, use setEnv($name, $value);

Related Packages

gabrieloliverio/laravel5-generators

Database metadata-based generators for Laravel 5

1
erirk/paypalpayment

laravel-paypalpayment is simple package help you process direct credit card paym...

0
doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

631,580,251 9,707
laravel/framework

The Laravel Framework.

580,311,802 34,925
laravel/tinker

Powerful REPL for the Laravel framework.

489,754,436 7,444