IPv4で使用すると、奇妙なエラー「(22 - '無効な引数')」が発生します。

IPv4で使用すると、奇妙なエラー「(22 - '無効な引数')」が発生します。

私は「(22 - '無効な引数')」を使ってnmap検索しました。https://seclists.org/nmap-dev/しかし、それはIPv6に関するもので、IPv4を使用するとこのエラーが発生しました。 IPv4への言及はありませんが、なぜこのような奇妙なエラーが発生するのですか?

私は入った:

$ nmap --send-eth --release-memory --nsock-engine=epoll --allports --fuzzy \
     --randomize-hosts --log-errors  --max-os-tries=9 -n --reason          \
     --append-output --scanflags=URGACKPSHRSTSYNFIN --max-retries=6        \
     --host-timeout=225s --stats-every=10m --ttl=255 --min-hostgroup=5 .   \
     --max-hostgroup=25 --max-rtt-timeout=60s --scan-delay=250ms .         \
     --max-scan-delay=25s --stats-every=1 -v5 -sT -sV -A -p 80-82          \
     0.18.0.0

結果は次のとおりです。

Starting Nmap 7.70 ( https://nmap.org ) at 2019-01-17 16:05 CET
NSE: Loaded 148 scripts for scanning.
NSE: Script Pre-scanning.
NSE: Starting runlevel 1 (of 2) scan.
Initiating NSE at 16:05
Completed NSE at 16:05, 0.00s elapsed
NSE: Starting runlevel 2 (of 2) scan.
Initiating NSE at 16:05
Completed NSE at 16:05, 0.00s elapsed
Initiating Ping Scan at 16:05
Scanning 0.18.0.0 [2 ports]
Stats: 0:00:01 elapsed; 0 hosts completed (0 up), 1 undergoing Ping Scan
Ping Scan Timing: About 0.00% done
Strange read error from 0.18.0.0 (22 - 'Invalid argument')
Strange read error from 0.18.0.0 (22 - 'Invalid argument')
Completed Ping Scan at 16:05, 0.50s elapsed (1 total hosts)
NSE: Script Post-scanning.
NSE: Starting runlevel 1 (of 2) scan.
Initiating NSE at 16:05
Completed NSE at 16:05, 0.00s elapsed
NSE: Starting runlevel 2 (of 2) scan.
Initiating NSE at 16:05
Completed NSE at 16:05, 0.00s elapsed
Read data files from: /usr/bin/../share/nmap
Note: Host seems down. If it is really up, but blocking our ping probes, try -Pn
Nmap done: 1 IP address (0 hosts up) scanned in 1.46 seconds

より少ない引数を使用しようとすると、次のような結果がnmap -p 80-82 0.18.0.0 得られます。

Starting Nmap 7.70 ( https://nmap.org ) at 2019-01-17 16:24 CET
Strange read error from 0.18.0.0 (22 - 'Invalid argument')
Strange read error from 0.18.0.0 (22 - 'Invalid argument')
Note: Host seems down. If it is really up, but blocking our ping probes, try -Pn
Nmap done: 1 IP address (0 hosts up) scanned in 0.12 seconds

試してみると、次のようなncat結果が得られます。

$ nc -vvv 0.18.0.0 80
0.18.0.0: inverse host lookup failed: Unknown host
(UNKNOWN) [0.18.0.0] 80 (http) : Invalid argument
 sent 0, rcvd 0

$ nc -vvv 0.18.0.0 81
0.18.0.0: inverse host lookup failed: Unknown host
(UNKNOWN) [0.18.0.0] 81 (hosts2-ns) : Invalid argument
 sent 0, rcvd 0

それでも「無効なパラメータ」がありますが、今回は22の代わりに郵便番号とサービスを受け取ります。

80 (http)
81 (hosts2-ns)

これにより、いくつかの質問が提起されます。

  1. ncat「無効な引数」はnmap同じものに関連していますか?
  2. nmap22を印刷するのではなく、どのように情報を提供できますか?
  3. リモートポートが実際に閉じられているのか、それとも実際に開いていてファイアウォールによって拒否されたのか、どうすればわかりますか?

ベストアンサー1

住所0.18.0.0(それぞれ。0.0.0.0/8)はStandard™の宛先IPアドレスとしては許可されていません。

~からRFC 6890:

2.2.2。 IPv4特殊目的アドレスレジストリキー


以下の表1から16は、IANAがIPv4特殊目的アドレスレジストリに最初に入力したエントリを示しています。

          +----------------------+----------------------------+
          | Attribute            | Value                      |
          +----------------------+----------------------------+
          | Address Block        | 0.0.0.0/8                  |
          | Name                 | "This host on this network"|
          | RFC                  | [RFC1122], Section 3.2.1.3 |
          | Allocation Date      | September 1981             |
          | Termination Date     | N/A                        |
          | Source               | True                       |
          | Destination          | False                      |
          | Forwardable          | False                      |
          | Global               | False                      |
          | Reserved-by-Protocol | True                       |
          +----------------------+----------------------------+

                Table 1: "This host on this network"

だから0.0.0.0/8だから0.18.0.0有効な宛先アドレスがないため、カーネルはEINVALIDそれを宛先として使用したいソケット操作を返します。

ヒント:以下を使用したい場合があります。RFC 1918ローカルに管理されているネットワークのアドレス。

おすすめ記事