cultrix/nmap 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

cultrix/nmap

Composer 安装命令:

composer require cultrix/nmap

包简介

A PHP wrapper for Nmap, a free security scanner for network exploration.

README 文档

README

A PHP wrapper for Nmap, a free security scanner for network exploration. Forked from the original script by William Durrand (https://github.com/willdurand/nmap); updated to work with the latest version of Symfony and will be expanded to take advantage of all Nmap features in time.

Usage

use Nmap\Nmap;

$hosts = Nmap::create()->scan([ 'scanme.nmap.org' ]);

$ports = $hosts->getOpenPorts();

You can specify the ports you want to scan:

$nmap = new Nmap();

$nmap->scan([ 'scanme.nmap.org' ], [ 21, 22, 80 ]);

OS detection and Service Info are disabled by default, if you want to enable them, use the enableOsDetection() and/or enableServiceInfo() methods:

$nmap
    ->enableOsDetection()
    ->scan([ 'scanme.nmap.org' ]);

$nmap
    ->enableServiceInfo()
    ->scan([ 'scanme.nmap.org' ]);

// Fluent interface!
$nmap
    ->enableOsDetection()
    ->enableServiceInfo()
    ->scan([ 'scanme.nmap.org' ]);

Turn on the verbose mode by using the enableVerbose() method:

$nmap
    ->enableVerbose()
    ->scan([ 'scanme.nmap.org' ]);

For some reasons, you might want to disable port scan, that is why nmap provides a disablePortScan() method:

$nmap
    ->disablePortScan()
    ->scan([ 'scanme.nmap.org' ]);

You can also disable the reverse DNS resolution with disableReverseDNS():

$nmap
    ->disableReverseDNS()
    ->scan([ 'scanme.nmap.org' ]);

You can define the process timeout (default to 60 seconds) with setTimeout():

$nmap
    ->setTimeout(120)
    ->scan([ 'scanme.nmap.org' ]);

Installation

The recommended way to install nmap is through Composer:

{
    "require": {
        "cultrix/nmap": "@master"
    }
}

Or:

composer require cultrix/nmap

License

nmap is released under the MIT License. See the bundled LICENSE file for details.

统计信息

  • 总下载量: 130
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 54
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-09-02