<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://purl.org/rss/1.0/"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel rdf:about="https://dwt.life/feed/rss/tag/nmap/">
<title>dwt&#039;s life - nmap</title>
<link>https://dwt.life/tag/nmap/</link>
<description></description>
<items>
<rdf:Seq>
<rdf:li resource="https://dwt.life/archives/192/"/>
</rdf:Seq>
</items>
</channel>
<item rdf:about="https://dwt.life/archives/192/">
<title>Nmap web在线精确扫描、检测服务器端口开放</title>
<link>https://dwt.life/archives/192/</link>
<dc:date>2022-02-17T00:19:00+08:00</dc:date>
<description>composer安装项目目录执行composer require palepurple/nmap修改代码原来的composer src中的代码并不会进行精确扫描，需要修改文件vendor/palepurple/nmap/src/Nmap/Nmap.php代码实现该功能：    private $enableTcp = false;

    public function buildCommand(array $targets, array $ports = array()): array
    {

        if (true === $this-&gt;enableTcp) {
            $options[] = &#039;-sT&#039;;
        }
    }

    public function enableTcp($enable = true): self
    {
        $this-&gt;enableTcp = $enable;

        return $this;
    }注针对Centos，可以使用yum install nmap进行安装，否则将无法运行扫描。另外需要开放exec函数的执行权限。最后如果要对接web，可以使用workerman websocket连接实现逐行显示。可以见我实现的功能：端口开放在线检测工具https://tool.hi.cn/port/</description>
</item>
</rdf:RDF>