Compare commits

...

6 Commits
v1.3 ... master

Author SHA1 Message Date
c0d3fe88be Set CRLF for XML, CMD and BAT files 2024-10-08 01:33:52 +02:00
a192f78dce Fix typo in Ethernet 2024-10-08 01:13:58 +02:00
7e112b0552 Fixing "get MAC address" to include wireless interfaces
With Wi-Fi adapters, they often do not show as physical adapters, hence that needs to be turned off. Instead, I add a caption to better identify Wi-Fi and Gigabit Ethernet.
2024-10-07 23:08:24 +02:00
6e9bd3f3e0 Split Wi-Fi configs into FT, normal and 5G, add cleanup option 2024-10-07 22:59:22 +02:00
081e8c5d48 Change the "admin needed" warning 2024-10-07 22:49:28 +02:00
7c0cbc1f35 Add Sincoolka FT again, change filenames, modify WLAN profile XML files to conform to EAP-TTLS specs 2024-10-07 22:47:18 +02:00
6 changed files with 232 additions and 128 deletions

3
.gitattributes vendored Normal file
View File

@ -0,0 +1,3 @@
*.xml text eol=crlf
*.bat text eol=crlf
*.cmd text eol=crlf

View File

@ -1,71 +0,0 @@
<?xml version="1.0"?>
<WLANProfile xmlns="http://www.microsoft.com/networking/WLAN/profile/v1">
<name>Sincoolka 5G</name>
<SSIDConfig>
<SSID>
<hex>53696E636F6F6C6B61203547</hex>
<name>Sincoolka 5G</name>
</SSID>
</SSIDConfig>
<connectionType>ESS</connectionType>
<connectionMode>auto</connectionMode>
<MSM>
<security>
<authEncryption>
<authentication>WPA2</authentication>
<encryption>AES</encryption>
<useOneX>true</useOneX>
</authEncryption>
<PMKCacheMode>enabled</PMKCacheMode>
<PMKCacheTTL>720</PMKCacheTTL>
<PMKCacheSize>128</PMKCacheSize>
<preAuthMode>disabled</preAuthMode>
<OneX xmlns="http://www.microsoft.com/networking/OneX/v1">
<authMode>user</authMode>
<EAPConfig>
<EapHostConfig xmlns="http://www.microsoft.com/provisioning/EapHostConfig">
<EapMethod>
<Type xmlns="http://www.microsoft.com/provisioning/EapCommon">25</Type>
<VendorId xmlns="http://www.microsoft.com/provisioning/EapCommon">0</VendorId>
<VendorType xmlns="http://www.microsoft.com/provisioning/EapCommon">0</VendorType>
<AuthorId xmlns="http://www.microsoft.com/provisioning/EapCommon">0</AuthorId>
</EapMethod>
<Config xmlns="http://www.microsoft.com/provisioning/EapHostConfig">
<Eap xmlns="http://www.microsoft.com/provisioning/BaseEapConnectionPropertiesV1">
<Type>25</Type>
<EapType xmlns="http://www.microsoft.com/provisioning/MsPeapConnectionPropertiesV1">
<ServerValidation>
<DisableUserPromptForServerValidation>false</DisableUserPromptForServerValidation>
<ServerNames>radius.sin.cvut.cz</ServerNames>
<TrustedRootCA>2b 8f 1b 57 33 0d bb a2 d0 7a 6c 51 f7 0e e9 0d da b9 ad 8e </TrustedRootCA>
</ServerValidation>
<FastReconnect>true</FastReconnect>
<InnerEapOptional>false</InnerEapOptional>
<Eap xmlns="http://www.microsoft.com/provisioning/BaseEapConnectionPropertiesV1">
<Type>26</Type>
<EapType xmlns="http://www.microsoft.com/provisioning/MsChapV2ConnectionPropertiesV1">
<UseWinLogonCredentials>false</UseWinLogonCredentials>
</EapType>
</Eap>
<EnableQuarantineChecks>false</EnableQuarantineChecks>
<RequireCryptoBinding>false</RequireCryptoBinding>
<PeapExtensions>
<PerformServerValidation xmlns="http://www.microsoft.com/provisioning/MsPeapConnectionPropertiesV2">true</PerformServerValidation>
<AcceptServerName xmlns="http://www.microsoft.com/provisioning/MsPeapConnectionPropertiesV2">true</AcceptServerName>
<PeapExtensionsV2 xmlns="http://www.microsoft.com/provisioning/MsPeapConnectionPropertiesV2">
<AllowPromptingWhenServerCANotFound xmlns="http://www.microsoft.com/provisioning/MsPeapConnectionPropertiesV3">true</AllowPromptingWhenServerCANotFound>
</PeapExtensionsV2>
</PeapExtensions>
</EapType>
</Eap>
</Config>
</EapHostConfig>
</EAPConfig>
</OneX>
</security>
</MSM>
<MacRandomization xmlns="http://www.microsoft.com/networking/WLAN/profile/v3">
<enableRandomization>false</enableRandomization>
<randomizationSeed>1813427014</randomizationSeed>
</MacRandomization>
</WLANProfile>

View File

@ -6,9 +6,11 @@
<hex>53696E636F6F6C6B61</hex>
<name>Sincoolka</name>
</SSID>
<nonBroadcast>false</nonBroadcast>
</SSIDConfig>
<connectionType>ESS</connectionType>
<connectionMode>auto</connectionMode>
<autoSwitch>false</autoSwitch>
<MSM>
<security>
<authEncryption>
@ -21,46 +23,35 @@
<PMKCacheSize>128</PMKCacheSize>
<preAuthMode>disabled</preAuthMode>
<OneX xmlns="http://www.microsoft.com/networking/OneX/v1">
<cacheUserData>true</cacheUserData>
<authMode>user</authMode>
<EAPConfig>
<EapHostConfig xmlns="http://www.microsoft.com/provisioning/EapHostConfig">
<EapMethod>
<Type xmlns="http://www.microsoft.com/provisioning/EapCommon">25</Type>
<VendorId xmlns="http://www.microsoft.com/provisioning/EapCommon">0</VendorId>
<VendorType xmlns="http://www.microsoft.com/provisioning/EapCommon">0</VendorType>
<AuthorId xmlns="http://www.microsoft.com/provisioning/EapCommon">0</AuthorId>
</EapMethod>
<Config xmlns="http://www.microsoft.com/provisioning/EapHostConfig">
<Eap xmlns="http://www.microsoft.com/provisioning/BaseEapConnectionPropertiesV1">
<Type>25</Type>
<EapType xmlns="http://www.microsoft.com/provisioning/MsPeapConnectionPropertiesV1">
<ServerValidation>
<DisableUserPromptForServerValidation>false</DisableUserPromptForServerValidation>
<ServerNames>radius.sin.cvut.cz</ServerNames>
<TrustedRootCA>2b 8f 1b 57 33 0d bb a2 d0 7a 6c 51 f7 0e e9 0d da b9 ad 8e </TrustedRootCA>
</ServerValidation>
<FastReconnect>true</FastReconnect>
<InnerEapOptional>false</InnerEapOptional>
<Eap xmlns="http://www.microsoft.com/provisioning/BaseEapConnectionPropertiesV1">
<Type>26</Type>
<EapType xmlns="http://www.microsoft.com/provisioning/MsChapV2ConnectionPropertiesV1">
<UseWinLogonCredentials>false</UseWinLogonCredentials>
</EapType>
</Eap>
<EnableQuarantineChecks>false</EnableQuarantineChecks>
<RequireCryptoBinding>false</RequireCryptoBinding>
<PeapExtensions>
<PerformServerValidation xmlns="http://www.microsoft.com/provisioning/MsPeapConnectionPropertiesV2">true</PerformServerValidation>
<AcceptServerName xmlns="http://www.microsoft.com/provisioning/MsPeapConnectionPropertiesV2">true</AcceptServerName>
<PeapExtensionsV2 xmlns="http://www.microsoft.com/provisioning/MsPeapConnectionPropertiesV2">
<AllowPromptingWhenServerCANotFound xmlns="http://www.microsoft.com/provisioning/MsPeapConnectionPropertiesV3">true</AllowPromptingWhenServerCANotFound>
</PeapExtensionsV2>
</PeapExtensions>
</EapType>
</Eap>
</Config>
</EapHostConfig>
</EAPConfig>
<EapHostConfig xmlns="http://www.microsoft.com/provisioning/EapHostConfig">
<EapMethod>
<Type xmlns="http://www.microsoft.com/provisioning/EapCommon">21</Type>
<VendorId xmlns="http://www.microsoft.com/provisioning/EapCommon">0</VendorId>
<VendorType xmlns="http://www.microsoft.com/provisioning/EapCommon">0</VendorType>
<AuthorId xmlns="http://www.microsoft.com/provisioning/EapCommon">311</AuthorId>
</EapMethod>
<Config xmlns="http://www.microsoft.com/provisioning/EapHostConfig">
<EapTtls
xmlns="http://www.microsoft.com/provisioning/EapTtlsConnectionPropertiesV1">
<ServerValidation>
<ServerNames>radius.sin.cvut.cz</ServerNames>
<TrustedRootCAHash>2b 8f 1b 57 33 d bb a2 d0 7a 6c 51 f7 e e9 d da b9 ad 8e </TrustedRootCAHash>
<DisablePrompt>true</DisablePrompt>
</ServerValidation>
<Phase2Authentication>
<PAPAuthentication />
</Phase2Authentication>
<Phase1Identity>
<IdentityPrivacy>true</IdentityPrivacy>
<AnonymousIdentity>anonymous@sin.cvut.cz</AnonymousIdentity>
</Phase1Identity>
</EapTtls>
</Config>
</EapHostConfig>
</EAPConfig>
</OneX>
</security>
</MSM>
@ -68,4 +59,4 @@
<enableRandomization>false</enableRandomization>
<randomizationSeed>1813427014</randomizationSeed>
</MacRandomization>
</WLANProfile>
</WLANProfile>

62
Wi-Fi-Sincoolka5G.xml Normal file
View File

@ -0,0 +1,62 @@
<?xml version="1.0"?>
<WLANProfile xmlns="http://www.microsoft.com/networking/WLAN/profile/v1">
<name>Sincoolka 5G</name>
<SSIDConfig>
<SSID>
<hex>53696E636F6F6C6B61203547</hex>
<name>Sincoolka 5G</name>
</SSID>
<nonBroadcast>false</nonBroadcast>
</SSIDConfig>
<connectionType>ESS</connectionType>
<connectionMode>auto</connectionMode>
<autoSwitch>false</autoSwitch>
<MSM>
<security>
<authEncryption>
<authentication>WPA2</authentication>
<encryption>AES</encryption>
<useOneX>true</useOneX>
</authEncryption>
<PMKCacheMode>enabled</PMKCacheMode>
<PMKCacheTTL>10</PMKCacheTTL>
<PMKCacheSize>128</PMKCacheSize>
<preAuthMode>disabled</preAuthMode>
<OneX xmlns="http://www.microsoft.com/networking/OneX/v1">
<cacheUserData>true</cacheUserData>
<authMode>user</authMode>
<EAPConfig>
<EapHostConfig xmlns="http://www.microsoft.com/provisioning/EapHostConfig">
<EapMethod>
<Type xmlns="http://www.microsoft.com/provisioning/EapCommon">21</Type>
<VendorId xmlns="http://www.microsoft.com/provisioning/EapCommon">0</VendorId>
<VendorType xmlns="http://www.microsoft.com/provisioning/EapCommon">0</VendorType>
<AuthorId xmlns="http://www.microsoft.com/provisioning/EapCommon">311</AuthorId>
</EapMethod>
<Config xmlns="http://www.microsoft.com/provisioning/EapHostConfig">
<EapTtls
xmlns="http://www.microsoft.com/provisioning/EapTtlsConnectionPropertiesV1">
<ServerValidation>
<ServerNames>radius.sin.cvut.cz</ServerNames>
<TrustedRootCAHash>2b 8f 1b 57 33 d bb a2 d0 7a 6c 51 f7 e e9 d da b9 ad 8e </TrustedRootCAHash>
<DisablePrompt>true</DisablePrompt>
</ServerValidation>
<Phase2Authentication>
<PAPAuthentication />
</Phase2Authentication>
<Phase1Identity>
<IdentityPrivacy>true</IdentityPrivacy>
<AnonymousIdentity>anonymous@sin.cvut.cz</AnonymousIdentity>
</Phase1Identity>
</EapTtls>
</Config>
</EapHostConfig>
</EAPConfig>
</OneX>
</security>
</MSM>
<MacRandomization xmlns="http://www.microsoft.com/networking/WLAN/profile/v3">
<enableRandomization>false</enableRandomization>
<randomizationSeed>1813427014</randomizationSeed>
</MacRandomization>
</WLANProfile>

62
Wi-Fi-SincoolkaFT.xml Normal file
View File

@ -0,0 +1,62 @@
<?xml version="1.0"?>
<WLANProfile xmlns="http://www.microsoft.com/networking/WLAN/profile/v1">
<name>Sincoolka FT</name>
<SSIDConfig>
<SSID>
<hex>53696E636F6F6C6B61204654</hex>
<name>Sincoolka FT</name>
</SSID>
<nonBroadcast>false</nonBroadcast>
</SSIDConfig>
<connectionType>ESS</connectionType>
<connectionMode>auto</connectionMode>
<autoSwitch>false</autoSwitch>
<MSM>
<security>
<authEncryption>
<authentication>WPA2</authentication>
<encryption>AES</encryption>
<useOneX>true</useOneX>
</authEncryption>
<PMKCacheMode>enabled</PMKCacheMode>
<PMKCacheTTL>10</PMKCacheTTL>
<PMKCacheSize>128</PMKCacheSize>
<preAuthMode>disabled</preAuthMode>
<OneX xmlns="http://www.microsoft.com/networking/OneX/v1">
<cacheUserData>true</cacheUserData>
<authMode>user</authMode>
<EAPConfig>
<EapHostConfig xmlns="http://www.microsoft.com/provisioning/EapHostConfig">
<EapMethod>
<Type xmlns="http://www.microsoft.com/provisioning/EapCommon">21</Type>
<VendorId xmlns="http://www.microsoft.com/provisioning/EapCommon">0</VendorId>
<VendorType xmlns="http://www.microsoft.com/provisioning/EapCommon">0</VendorType>
<AuthorId xmlns="http://www.microsoft.com/provisioning/EapCommon">311</AuthorId>
</EapMethod>
<Config xmlns="http://www.microsoft.com/provisioning/EapHostConfig">
<EapTtls
xmlns="http://www.microsoft.com/provisioning/EapTtlsConnectionPropertiesV1">
<ServerValidation>
<ServerNames>radius.sin.cvut.cz</ServerNames>
<TrustedRootCAHash>2b 8f 1b 57 33 d bb a2 d0 7a 6c 51 f7 e e9 d da b9 ad 8e </TrustedRootCAHash>
<DisablePrompt>true</DisablePrompt>
</ServerValidation>
<Phase2Authentication>
<PAPAuthentication />
</Phase2Authentication>
<Phase1Identity>
<IdentityPrivacy>true</IdentityPrivacy>
<AnonymousIdentity>anonymous@sin.cvut.cz</AnonymousIdentity>
</Phase1Identity>
</EapTtls>
</Config>
</EapHostConfig>
</EAPConfig>
</OneX>
</security>
</MSM>
<MacRandomization xmlns="http://www.microsoft.com/networking/WLAN/profile/v3">
<enableRandomization>false</enableRandomization>
<randomizationSeed>1813427014</randomizationSeed>
</MacRandomization>
</WLANProfile>

View File

@ -7,12 +7,15 @@ set rights_admin=0
NET SESSION >nul 2>&1
IF NOT %ERRORLEVEL% EQU 0 (
echo ####### Running as a regular user #########
echo # The Wi-Fi profiles will be installed #
echo # for the current user. #
echo # Run as administrator to install them #
echo # for all users. #
echo ###########################################
echo ############### !! FRIENDLY NOTICE ##############
echo # Please, run this script as an administrator. #
echo # Otherwise, the added Wi-Fi network will #
echo # NOT remember your username and password. #
echo # #
echo # Please close this window, right-click the #
echo # sin-setup.bat, and select #
echo # Run as administrator. #
echo #################################################
echo.
pause
) ELSE (
@ -28,17 +31,31 @@ IF NOT %ERRORLEVEL% EQU 0 (
:main
cls
ECHO What you want to do now?
ECHO 1. Configure Wi-Fi connection
rem ECHO 2. Configure Wired connection
ECHO 3. Print MAC adresses
ECHO 4. Exit
ECHO 1. Configure Wi-Fi connection - Sincoolka FT (recommended)
ECHO 2. Configure Wi-Fi connection - Sincoolka (if the FT does not work properly)
ECHO 3. Configure Wi-Fi connection - Sincoolka 5G (expert, 5 GHz only)
ECHO.
ECHO 4. Remove all Sincoolka profiles
ECHO.
IF %rights_admin% EQU 1 (
ECHO 5. Configure wired connection for 802.1X
ECHO.
)
ECHO 9. Print MAC adresses
ECHO 0. Exit
ECHO.
set choice=
set /p choice=Choice:
if not '%choice%'=='' set choice=%choice:~0,1%
if '%choice%'=='1' goto setup_wifi
rem if '%choice%'=='2' goto setup_eth
if '%choice%'=='3' goto print_mac
if '%choice%'=='4' EXIT
if '%choice%'=='1' goto setup_wifi_ft
if '%choice%'=='2' goto setup_wifi
if '%choice%'=='3' goto setup_wifi_5g
if '%choice%'=='4' goto cleanup_wifi
IF %rights_admin% EQU 1 (
if '%choice%'=='5' goto setup_eth
)
if '%choice%'=='9' goto print_mac
if '%choice%'=='0' EXIT
ECHO "%choice%" is not valid, try again
ECHO.
goto main
@ -47,7 +64,22 @@ goto main
:: Import Sincoolka and Sincoolka 5G Wi-Fi profile
:: Import Sincoolka FT Wi-Fi profile
:setup_wifi_ft
cls
set cmd_user=current
IF %rights_admin% EQU 1 (
set cmd_user=all
)
netsh wlan add profile "filename=%mypath%Wi-Fi-SincoolkaFT.xml" user=%cmd_user%
echo.
set /p iface="Press Enter to continue . . . "
goto main
:: Import Sincoolka Wi-Fi profile
:setup_wifi
cls
@ -56,7 +88,21 @@ IF %rights_admin% EQU 1 (
set cmd_user=all
)
netsh wlan add profile "filename=%mypath%Wi-Fi-Sincoolka.xml" user=%cmd_user%
netsh wlan add profile "filename=%mypath%Wi-Fi-Sincoolka 5G.xml" user=%cmd_user%
echo.
set /p iface="Press Enter to continue . . . "
goto main
:: Import Sincoolka 5G Wi-Fi profile
:setup_wifi_5g
cls
set cmd_user=current
IF %rights_admin% EQU 1 (
set cmd_user=all
)
netsh wlan add profile "filename=%mypath%Wi-Fi-Sincoolka5G.xml" user=%cmd_user%
echo.
@ -64,6 +110,17 @@ set /p iface="Press Enter to continue . . . "
goto main
:cleanup_wifi
cls
:: Cleanup all our Wi-Fi profiles
netsh wlan delete profile name="Sincoolka" i=*
netsh wlan delete profile name="Sincoolka FT" i=*
netsh wlan delete profile name="Sincoolka 5G" i=*
echo.
set /p iface="Press Enter to continue . . . "
goto main
@ -98,7 +155,7 @@ echo.
:setEth
:: Print all network interfaces
echo List of Avaliable Interfaces:
echo List of Available Interfaces:
echo.
wmic nic where 'NOT Manufacturer like "%%Microsoft%%" and PhysicalAdapter=TRUE and NOT Manufacturer like "%%Windows%%"' get Manufacturer,MACAddress,NetConnectionID 2>nul
IF NOT %ERRORLEVEL% EQU 0 (
@ -134,7 +191,7 @@ goto main
:print_mac
cls
wmic nic where 'NOT Manufacturer like "%%Microsoft%%" and PhysicalAdapter=TRUE and NOT Manufacturer like "%%Windows%%"' get Manufacturer,MACAddress,NetConnectionID 2>nul
wmic nic where 'NOT Manufacturer like "%%Microsoft%%" and NOT Manufacturer like "%%Windows%%"' get MACAddress,Caption,NetConnectionID 2>nul
IF NOT %ERRORLEVEL% EQU 0 (
getmac /v 2>nul
IF NOT %ERRORLEVEL% EQU 0 (