IPv4와 함께 사용할 때 이상한 오류 "(22 - '잘못된 인수')"가 발생합니다.

IPv4와 함께 사용할 때 이상한 오류 "(22 - '잘못된 인수')"가 발생합니다.

을 사용하여 "(22 - '잘못된 인수')"가 있습니다 nmap. 구글링해서 얻었어요https://seclists.org/nmap-dev/, IPv4를 사용할 때 이 오류가 발생하는 동안 IPv6에 대해 논의하고 있습니다. 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. "잘못된 인수" ncatnmap동일한 내용이 관련되어 있습니까?
  2. nmap22를 인쇄하는 대신 정보를 제공하려면 어떻게 해야 합니까 ?
  3. 원격 포트가 실제로 닫혀 있는지, 아니면 실제로 열려 있고 방화벽 때문에 거부되는지 어떻게 알 수 있습니까?

답변1

주소0.18.0.0(관련.0.0.0.0/8)은 표준™에 따라 대상 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로컬로 관리되는 네트워크의 주소입니다.

관련 정보