guisehn/willdurand-nmap

nmap 是一个用于网络探索的免费安全扫描器 Nmap 的 PHP 封装。已更新为支持 PHP 7.1

维护者

详细信息

github.com/guisehn/nmap

源代码

0.7.0 2018-05-19 12:27 UTC

This package is not auto-updated.

Last update: 2024-09-23 22:44:29 UTC


README

nmap 是一个网络探索免费安全扫描器 Nmap 的 PHP 封装。

Build Status

使用方法

$hosts = Nmap::create()->scan([ 'williamdurand.fr' ]);

$ports = $hosts->getOpenPorts();

您可以指定要扫描的端口

$nmap = new Nmap();

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

默认情况下,操作系统检测服务信息 被禁用,如果您想启用它们,请使用 enableOsDetection() 和/或 enableServiceInfo() 方法

$nmap
    ->enableOsDetection()
    ->scan([ 'williamdurand.fr' ]);

$nmap
    ->enableServiceInfo()
    ->scan([ 'williamdurand.fr' ]);

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

通过使用 enableVerbose() 方法开启 详细模式

$nmap
    ->enableVerbose()
    ->scan([ 'williamdurand.fr' ]);

由于某些原因,您可能希望禁用端口扫描,这就是为什么 nmap 提供了 disablePortScan() 方法

$nmap
    ->disablePortScan()
    ->scan([ 'williamdurand.fr' ]);

您还可以使用 disableReverseDNS() 禁用反向 DNS 解析

$nmap
    ->disableReverseDNS()
    ->scan([ 'williamdurand.fr' ]);

您可以使用 setTimeout() 定义进程超时(默认为 60 秒)

$nmap
    ->setTimeout(120)
    ->scan([ 'williamdurand.fr' ]);

安装

安装 nmap 的推荐方法是使用 Composer

{
    "require": {
        "willdurand/nmap": "@stable"
    }
}

提示:您应该浏览 willdurand/nmap 页面,选择要使用的稳定版本,避免使用 @stable 元约束。

许可证

nmap 在 MIT 许可证下发布。有关详细信息,请参阅附带 LICENSE 文件。