Windows10 WiFi配置文件是否支持密码空白?

问题描述 投票:1回答:1

密码以空格开头时无法使用xml配置文件连接到Wi-Fi

您好,我正在使用Windows10,我的Wi-Fi卡是Intel(R)Dual Band Wireless-AC 7265。

我的ESSID(我将其称为“ MY_NETWORK_SSID”)的密码以空格开头(假设为“ StartsWithWhiteSpace”),如果我通过选择网络名称并手动键入密码来手动连接到ESSID,则可以正常工作,但是如果我使用此配置文件通过netsh命令进行连接,则会失败:

    <?xml version="1.0"?>
    <WLANProfile xmlns="http://www.microsoft.com/networking/WLAN/profile/v1">
        <name>MY_NETWORK_SSID</name>
        <SSIDConfig>
            <SSID>
                <hex>6D746C70617461625DA3546455727473</hex>
                <name>MY_NETWORK_SSID</name>
            </SSID>
        </SSIDConfig>
        <connectionType>ESS</connectionType>
        <connectionMode>auto</connectionMode>
        <MSM>
            <security>
                <authEncryption>
                <authentication>WPA2PSK</authentication>
                    <encryption>AES</encryption>
                    <useOneX>false</useOneX>
                    </authEncryption>
                    <sharedKey>
                        <keyType>passPhrase</keyType>
                        <protected>false</protected>
                        <keyMaterial>  StartsWithWhiteSpace</keyMaterial>
                    </sharedKey>
            </security>
        </MSM>
        <MacRandomization xmlns="http://www.microsoft.com/networking/WLAN/profile/v3">
            <enableRandomization>false</enableRandomization>
            <randomizationSeed>1191479147</randomizationSeed>
        </MacRandomization>
    </WLANProfile>

注:我也尝试过(&#32;和\ u0020)代表空白。我还尝试了protected = true并对该XML的password keyMaterial字段进行编码:" P@ssword!23" | ConvertTo-SecureString -AsPlainText -Force | ConvertFrom-SecureString

但是不幸的是,这也不起作用。

xml powershell wifi netsh wificonfiguration
1个回答
0
投票

这是预期的行为,因为XML解析器清除了空格。应该可以改用PSK,在这种用例中这也更加安全。未测试(没有Windows框),但尝试编辑XML,如下所示:

            <sharedKey>
                <keyType>networkKey</keyType>
                <protected>true</protected>
                <keyMaterial>XXX</keyMaterial>
            </sharedKey>

相反,XXX在此处放置了PSK,可以使用各种工具或在线女巫客户端JavaScript在这些页面之一上进行计算:

https://www.wireshark.org/tools/wpa-psk.html

http://jorisvr.nl/wpapsk.html

© www.soinside.com 2019 - 2024. All rights reserved.