<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:wfw="http://wellformedweb.org/CommentAPI/">
<channel>
<title>dwt&#039;s life - nmap</title>
<link>https://dwt.life/tag/nmap/</link>
<atom:link href="https://dwt.life/feed/tag/nmap/" rel="self" type="application/rss+xml" />
<language>zh-CN</language>
<description></description>
<lastBuildDate>Thu, 17 Feb 2022 00:19:00 +0800</lastBuildDate>
<pubDate>Thu, 17 Feb 2022 00:19:00 +0800</pubDate>
<item>
<title>Nmap web在线精确扫描、检测服务器端口开放</title>
<link>https://dwt.life/archives/192/</link>
<guid>https://dwt.life/archives/192/</guid>
<pubDate>Thu, 17 Feb 2022 00:19:00 +0800</pubDate>
<dc:creator>Ricky</dc:creator>
<description><![CDATA[composer安装项目目录执行composer require palepurple/nmap修改代码原来的composer src中的代码并不会进行精确扫描，需要修改文件vendor/pal...]]></description>
<content:encoded xml:lang="zh-CN"><![CDATA[
<h2>composer安装</h2><p>项目目录执行<code>composer require palepurple/nmap</code></p><h2>修改代码</h2><p>原来的composer src中的代码并不会进行精确扫描，需要修改文件<code>vendor/palepurple/nmap/src/Nmap/Nmap.php</code>代码实现该功能：</p><pre><code class="lang-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;
    }</code></pre><h2>注</h2><p>针对Centos，可以使用<code>yum install nmap</code>进行安装，否则将无法运行扫描。<br>另外需要开放<code>exec</code>函数的执行权限。<br>最后如果要对接web，可以使用workerman websocket连接实现逐行显示。<br>可以见我实现的功能：<a href="https://tool.hi.cn/port/">端口开放在线检测工具</a></p><p><a href="https://tool.hi.cn/port/">https://tool.hi.cn/port/</a></p>
]]></content:encoded>
<slash:comments>0</slash:comments>
<comments>https://dwt.life/archives/192/#comments</comments>
<wfw:commentRss>https://dwt.life/feed/tag/nmap/</wfw:commentRss>
</item>
</channel>
</rss>