microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.08k stars 797 forks source link

wsl2 mirrored nmap filtered #11761

Open lcarea opened 3 weeks ago

lcarea commented 3 weeks ago

Windows Version

Windows11 23H2 22631.3810 X64

WSL Version

2.2.4.0

Are you using WSL 1 or WSL 2?

Kernel Version

No response

Distro Version

kali linux

Other Software

1、wsl2 use mirrored nmap port filtered eg: nmap -sV -v -p 80 192.168.0.1 PORT STATE SERVICE VERSION 80/tcp filtered http Microsoft IIS httpd 10.0 Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows

2、wsl2 no use mirrored nmap port open eg: nmap -sV -v -p 80 192.168.0.1 PORT STATE SERVICE VERSION 80/tcp open http Microsoft IIS httpd 10.0 Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows

Repro Steps

.wslconfig

# Settings apply across all Linux distros running on WSL 2
[wsl2]

# Limits VM memory to use no more than 4 GB, this can be set as whole numbers using GB or MB
memory=8GB

# Sets the VM to use two virtual processors
processors=8

[experimental]
autoMemoryReclaim=gradual # 开启自动回收内存,可在 gradual, dropcache, disabled 之间选择
networkingMode=mirrored # 开启镜像网络
dnsTunneling=true # 开启 DNS Tunneling
firewall=true # 开启 Windows 防火墙
autoProxy=true # 开启自动同步代理
sparseVhd=true # 开启自动释放 WSL2 虚拟硬盘空间
hostAddressLoopback=true

Expected Behavior

wsl2 use mirrored nmap port open eg: nmap -sV -v -p 80 192.168.0.1 PORT STATE SERVICE VERSION 80/tcp open http Microsoft IIS httpd 10.0 Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows

Actual Behavior

wsl2 use mirrored nmap port filtered eg: nmap -sV -v -p 80 192.168.0.1 PORT STATE SERVICE VERSION 80/tcp filtered http Microsoft IIS httpd 10.0 Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows

Diagnostic Logs

No response

github-actions[bot] commented 3 weeks ago

Logs are required for review from WSL team

If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'. Otherwise please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.

How to collect WSL logs Download and execute [collect-wsl-logs.ps1](https://github.com/Microsoft/WSL/blob/master/diagnostics/collect-wsl-logs.ps1) in an **administrative powershell prompt**: ``` Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1 Set-ExecutionPolicy Bypass -Scope Process -Force .\collect-wsl-logs.ps1 ``` The scipt will output the path of the log file once done. Once completed please upload the output files to this Github issue. [Click here for more info on logging](https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#8-collect-wsl-logs-recommended-method) If you choose to email these logs instead of attaching to the bug, please send them to wsl-gh-logs@microsoft.com with the number of the github issue in the subject, and in the message a link to your comment in the github issue and reply with '/emailed-logs'.

View similar issues

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

lcarea commented 2 weeks ago

/question

github-actions[bot] commented 2 weeks ago
Diagnostic information ``` Found '/question', adding tag 'question' ```
lcarea commented 2 weeks ago

预期:正常的WSL2 mirrored Nmap Open image-20240715155155272

image-20240715155235752

非预期:不正常的WSL2 mirrored Nmap filtered

相同配置

nmap -sV -v -p 80 203.130.44.44
PORT   STATE SERVICE VERSION
80/tcp filtered  http    Microsoft IIS httpd 10.0

PS:防火墙关闭状态!

我该怎么做才能在WSL2使用镜像模式,nmap不会filtered

lcarea commented 2 weeks ago

question

lcarea commented 2 weeks ago

/question

github-actions[bot] commented 2 weeks ago
Diagnostic information ``` Found '/question', adding tag 'question' ```