1*780fb4a2SCy Schubertwpa_supplicant for Windows 2*780fb4a2SCy Schubert========================== 3*780fb4a2SCy Schubert 4*780fb4a2SCy SchubertCopyright (c) 2003-2009, Jouni Malinen <j@w1.fi> and contributors 5*780fb4a2SCy SchubertAll Rights Reserved. 6*780fb4a2SCy Schubert 7*780fb4a2SCy SchubertThis program is licensed under the BSD license (the one with 8*780fb4a2SCy Schubertadvertisement clause removed). 9*780fb4a2SCy Schubert 10*780fb4a2SCy Schubert 11*780fb4a2SCy Schubertwpa_supplicant has support for being used as a WPA/WPA2/IEEE 802.1X 12*780fb4a2SCy SchubertSupplicant on Windows. The current port requires that WinPcap 13*780fb4a2SCy Schubert(http://winpcap.polito.it/) is installed for accessing packets and the 14*780fb4a2SCy Schubertdriver interface. Both release versions 3.0 and 3.1 are supported. 15*780fb4a2SCy Schubert 16*780fb4a2SCy SchubertThe current port is still somewhat experimental. It has been tested 17*780fb4a2SCy Schubertmainly on Windows XP (SP2) with limited set of NDIS drivers. In 18*780fb4a2SCy Schubertaddition, the current version has been reported to work with Windows 19*780fb4a2SCy Schubert2000. 20*780fb4a2SCy Schubert 21*780fb4a2SCy SchubertAll security modes have been verified to work (at least complete 22*780fb4a2SCy Schubertauthentication and successfully ping a wired host): 23*780fb4a2SCy Schubert- plaintext 24*780fb4a2SCy Schubert- static WEP / open system authentication 25*780fb4a2SCy Schubert- static WEP / shared key authentication 26*780fb4a2SCy Schubert- IEEE 802.1X with dynamic WEP keys 27*780fb4a2SCy Schubert- WPA-PSK, TKIP, CCMP, TKIP+CCMP 28*780fb4a2SCy Schubert- WPA-EAP, TKIP, CCMP, TKIP+CCMP 29*780fb4a2SCy Schubert- WPA2-PSK, TKIP, CCMP, TKIP+CCMP 30*780fb4a2SCy Schubert- WPA2-EAP, TKIP, CCMP, TKIP+CCMP 31*780fb4a2SCy Schubert 32*780fb4a2SCy Schubert 33*780fb4a2SCy SchubertBuilding wpa_supplicant with mingw 34*780fb4a2SCy Schubert---------------------------------- 35*780fb4a2SCy Schubert 36*780fb4a2SCy SchubertThe default build setup for wpa_supplicant is to use MinGW and 37*780fb4a2SCy Schubertcross-compiling from Linux to MinGW/Windows. It should also be 38*780fb4a2SCy Schubertpossible to build this under Windows using the MinGW tools, but that 39*780fb4a2SCy Schubertis not tested nor supported and is likely to require some changes to 40*780fb4a2SCy Schubertthe Makefile unless cygwin is used. 41*780fb4a2SCy Schubert 42*780fb4a2SCy Schubert 43*780fb4a2SCy SchubertBuilding wpa_supplicant with MSVC 44*780fb4a2SCy Schubert--------------------------------- 45*780fb4a2SCy Schubert 46*780fb4a2SCy Schubertwpa_supplicant can be built with Microsoft Visual C++ compiler. This 47*780fb4a2SCy Schuberthas been tested with Microsoft Visual C++ Toolkit 2003 and Visual 48*780fb4a2SCy SchubertStudio 2005 using the included nmake.mak as a Makefile for nmake. IDE 49*780fb4a2SCy Schubertcan also be used by creating a project that includes the files and 50*780fb4a2SCy Schubertdefines mentioned in nmake.mak. Example VS2005 solution and project 51*780fb4a2SCy Schubertfiles are included in vs2005 subdirectory. This can be used as a 52*780fb4a2SCy Schubertstarting point for building the programs with VS2005 IDE. Visual Studio 53*780fb4a2SCy Schubert2008 Express Edition is also able to use these project files. 54*780fb4a2SCy Schubert 55*780fb4a2SCy SchubertWinPcap development package is needed for the build and this can be 56*780fb4a2SCy Schubertdownloaded from http://www.winpcap.org/install/bin/WpdPack_4_0_2.zip. The 57*780fb4a2SCy Schubertdefault nmake.mak expects this to be unpacked into C:\dev\WpdPack so 58*780fb4a2SCy Schubertthat Include and Lib directories are in this directory. The files can be 59*780fb4a2SCy Schubertstored elsewhere as long as the WINPCAPDIR in nmake.mak is updated to 60*780fb4a2SCy Schubertmatch with the selected directory. In case a project file in the IDE is 61*780fb4a2SCy Schubertused, these Include and Lib directories need to be added to project 62*780fb4a2SCy Schubertproperties as additional include/library directories. 63*780fb4a2SCy Schubert 64*780fb4a2SCy SchubertOpenSSL source package can be downloaded from 65*780fb4a2SCy Schuberthttp://www.openssl.org/source/openssl-0.9.8i.tar.gz and built and 66*780fb4a2SCy Schubertinstalled following instructions in INSTALL.W32. Note that if EAP-FAST 67*780fb4a2SCy Schubertsupport will be included in the wpa_supplicant, OpenSSL needs to be 68*780fb4a2SCy Schubertpatched to# support it openssl-0.9.8i-tls-extensions.patch. The example 69*780fb4a2SCy Schubertnmake.mak file expects OpenSSL to be installed into C:\dev\openssl, but 70*780fb4a2SCy Schubertthis directory can be modified by changing OPENSSLDIR variable in 71*780fb4a2SCy Schubertnmake.mak. 72*780fb4a2SCy Schubert 73*780fb4a2SCy SchubertIf you do not need EAP-FAST support, you may also be able to use Win32 74*780fb4a2SCy Schubertbinary installation package of OpenSSL from 75*780fb4a2SCy Schuberthttp://www.slproweb.com/products/Win32OpenSSL.html instead of building 76*780fb4a2SCy Schubertthe library yourself. In this case, you will need to copy Include and 77*780fb4a2SCy SchubertLib directories in suitable directory, e.g., C:\dev\openssl for the 78*780fb4a2SCy Schubertdefault nmake.mak. Copy {Win32OpenSSLRoot}\include into 79*780fb4a2SCy SchubertC:\dev\openssl\include and make C:\dev\openssl\lib subdirectory with 80*780fb4a2SCy Schubertfiles from {Win32OpenSSLRoot}\VC (i.e., libeay*.lib and ssleay*.lib). 81*780fb4a2SCy SchubertThis will end up using dynamically linked OpenSSL (i.e., .dll files are 82*780fb4a2SCy Schubertneeded) for it. Alternative, you can copy files from 83*780fb4a2SCy Schubert{Win32OpenSSLRoot}\VC\static to create a static build (no OpenSSL .dll 84*780fb4a2SCy Schubertfiles needed). 85*780fb4a2SCy Schubert 86*780fb4a2SCy Schubert 87*780fb4a2SCy SchubertBuilding wpa_supplicant for cygwin 88*780fb4a2SCy Schubert---------------------------------- 89*780fb4a2SCy Schubert 90*780fb4a2SCy Schubertwpa_supplicant can be built for cygwin by installing the needed 91*780fb4a2SCy Schubertdevelopment packages for cygwin. This includes things like compiler, 92*780fb4a2SCy Schubertmake, openssl development package, etc. In addition, developer's pack 93*780fb4a2SCy Schubertfor WinPcap (WPdpack.zip) from 94*780fb4a2SCy Schuberthttp://winpcap.polito.it/install/default.htm is needed. 95*780fb4a2SCy Schubert 96*780fb4a2SCy Schubert.config file should enable only one driver interface, 97*780fb4a2SCy SchubertCONFIG_DRIVER_NDIS. In addition, include directories may need to be 98*780fb4a2SCy Schubertadded to match the system. An example configuration is available in 99*780fb4a2SCy Schubertdefconfig. The library and include files for WinPcap will either need 100*780fb4a2SCy Schubertto be installed in compiler/linker default directories or their 101*780fb4a2SCy Schubertlocation will need to be adding to .config when building 102*780fb4a2SCy Schubertwpa_supplicant. 103*780fb4a2SCy Schubert 104*780fb4a2SCy SchubertOthen than this, the build should be more or less identical to Linux 105*780fb4a2SCy Schubertversion, i.e., just run make after having created .config file. An 106*780fb4a2SCy Schubertadditional tool, win_if_list.exe, can be built by running "make 107*780fb4a2SCy Schubertwin_if_list". 108*780fb4a2SCy Schubert 109*780fb4a2SCy Schubert 110*780fb4a2SCy SchubertBuilding wpa_gui 111*780fb4a2SCy Schubert---------------- 112*780fb4a2SCy Schubert 113*780fb4a2SCy Schubertwpa_gui uses Qt application framework from Trolltech. It can be built 114*780fb4a2SCy Schubertwith the open source version of Qt4 and MinGW. Following commands can 115*780fb4a2SCy Schubertbe used to build the binary in the Qt 4 Command Prompt: 116*780fb4a2SCy Schubert 117*780fb4a2SCy Schubert# go to the root directory of wpa_supplicant source code 118*780fb4a2SCy Schubertcd wpa_gui-qt4 119*780fb4a2SCy Schubertqmake -o Makefile wpa_gui.pro 120*780fb4a2SCy Schubertmake 121*780fb4a2SCy Schubert# the wpa_gui.exe binary is created into 'release' subdirectory 122*780fb4a2SCy Schubert 123*780fb4a2SCy Schubert 124*780fb4a2SCy SchubertUsing wpa_supplicant for Windows 125*780fb4a2SCy Schubert-------------------------------- 126*780fb4a2SCy Schubert 127*780fb4a2SCy Schubertwpa_supplicant, wpa_cli, and wpa_gui behave more or less identically to 128*780fb4a2SCy SchubertLinux version, so instructions in README and example wpa_supplicant.conf 129*780fb4a2SCy Schubertshould be applicable for most parts. In addition, there is another 130*780fb4a2SCy Schubertversion of wpa_supplicant, wpasvc.exe, which can be used as a Windows 131*780fb4a2SCy Schubertservice and which reads its configuration from registry instead of 132*780fb4a2SCy Schuberttext file. 133*780fb4a2SCy Schubert 134*780fb4a2SCy SchubertWhen using access points in "hidden SSID" mode, ap_scan=2 mode need to 135*780fb4a2SCy Schubertbe used (see wpa_supplicant.conf for more information). 136*780fb4a2SCy Schubert 137*780fb4a2SCy SchubertWindows NDIS/WinPcap uses quite long interface names, so some care 138*780fb4a2SCy Schubertwill be needed when starting wpa_supplicant. Alternatively, the 139*780fb4a2SCy Schubertadapter description can be used as the interface name which may be 140*780fb4a2SCy Schuberteasier since it is usually in more human-readable 141*780fb4a2SCy Schubertformat. win_if_list.exe can be used to find out the proper interface 142*780fb4a2SCy Schubertname. 143*780fb4a2SCy Schubert 144*780fb4a2SCy SchubertExample steps in starting up wpa_supplicant: 145*780fb4a2SCy Schubert 146*780fb4a2SCy Schubert# win_if_list.exe 147*780fb4a2SCy Schubertifname: \Device\NPF_GenericNdisWanAdapter 148*780fb4a2SCy Schubertdescription: Generic NdisWan adapter 149*780fb4a2SCy Schubert 150*780fb4a2SCy Schubertifname: \Device\NPF_{769E012B-FD17-4935-A5E3-8090C38E25D2} 151*780fb4a2SCy Schubertdescription: Atheros Wireless Network Adapter (Microsoft's Packet Scheduler) 152*780fb4a2SCy Schubert 153*780fb4a2SCy Schubertifname: \Device\NPF_{732546E7-E26C-48E3-9871-7537B020A211} 154*780fb4a2SCy Schubertdescription: Intel 8255x-based Integrated Fast Ethernet (Microsoft's Packet Scheduler) 155*780fb4a2SCy Schubert 156*780fb4a2SCy Schubert 157*780fb4a2SCy SchubertSince the example configuration used Atheros WLAN card, the middle one 158*780fb4a2SCy Schubertis the correct interface in this case. The interface name for -i 159*780fb4a2SCy Schubertcommand line option is the full string following "ifname:" (the 160*780fb4a2SCy Schubert"\Device\NPF_" prefix can be removed). In other words, wpa_supplicant 161*780fb4a2SCy Schubertwould be started with the following command: 162*780fb4a2SCy Schubert 163*780fb4a2SCy Schubert# wpa_supplicant.exe -i'{769E012B-FD17-4935-A5E3-8090C38E25D2}' -c wpa_supplicant.conf -d 164*780fb4a2SCy Schubert 165*780fb4a2SCy Schubert-d optional enables some more debugging (use -dd for even more, if 166*780fb4a2SCy Schubertneeded). It can be left out if debugging information is not needed. 167*780fb4a2SCy Schubert 168*780fb4a2SCy SchubertWith the alternative mechanism for selecting the interface, this 169*780fb4a2SCy Schubertcommand has identical results in this case: 170*780fb4a2SCy Schubert 171*780fb4a2SCy Schubert# wpa_supplicant.exe -iAtheros -c wpa_supplicant.conf -d 172*780fb4a2SCy Schubert 173*780fb4a2SCy Schubert 174*780fb4a2SCy SchubertSimple configuration example for WPA-PSK: 175*780fb4a2SCy Schubert 176*780fb4a2SCy Schubert#ap_scan=2 177*780fb4a2SCy Schubertctrl_interface= 178*780fb4a2SCy Schubertnetwork={ 179*780fb4a2SCy Schubert ssid="test" 180*780fb4a2SCy Schubert key_mgmt=WPA-PSK 181*780fb4a2SCy Schubert proto=WPA 182*780fb4a2SCy Schubert pairwise=TKIP 183*780fb4a2SCy Schubert psk="secret passphrase" 184*780fb4a2SCy Schubert} 185*780fb4a2SCy Schubert 186*780fb4a2SCy Schubert(remove '#' from the comment out ap_scan line to enable mode in which 187*780fb4a2SCy Schubertwpa_supplicant tries to associate with the SSID without doing 188*780fb4a2SCy Schubertscanning; this allows APs with hidden SSIDs to be used) 189*780fb4a2SCy Schubert 190*780fb4a2SCy Schubert 191*780fb4a2SCy Schubertwpa_cli.exe and wpa_gui.exe can be used to interact with the 192*780fb4a2SCy Schubertwpa_supplicant.exe program in the same way as with Linux. Note that 193*780fb4a2SCy Schubertctrl_interface is using UNIX domain sockets when built for cygwin, but 194*780fb4a2SCy Schubertthe native build for Windows uses named pipes and the contents of the 195*780fb4a2SCy Schubertctrl_interface configuration item is used to control access to the 196*780fb4a2SCy Schubertinterface. Anyway, this variable has to be included in the configuration 197*780fb4a2SCy Schubertto enable the control interface. 198*780fb4a2SCy Schubert 199*780fb4a2SCy Schubert 200*780fb4a2SCy SchubertExample SDDL string formats: 201*780fb4a2SCy Schubert 202*780fb4a2SCy Schubert(local admins group has permission, but nobody else): 203*780fb4a2SCy Schubert 204*780fb4a2SCy Schubertctrl_interface=SDDL=D:(A;;GA;;;BA) 205*780fb4a2SCy Schubert 206*780fb4a2SCy Schubert("A" == "access allowed", "GA" == GENERIC_ALL == all permissions, and 207*780fb4a2SCy Schubert"BA" == "builtin administrators" == the local admins. The empty fields 208*780fb4a2SCy Schubertare for flags and object GUIDs, none of which should be required in this 209*780fb4a2SCy Schubertcase.) 210*780fb4a2SCy Schubert 211*780fb4a2SCy Schubert(local admins and the local "power users" group have permissions, 212*780fb4a2SCy Schubertbut nobody else): 213*780fb4a2SCy Schubert 214*780fb4a2SCy Schubertctrl_interface=SDDL=D:(A;;GA;;;BA)(A;;GA;;;PU) 215*780fb4a2SCy Schubert 216*780fb4a2SCy Schubert(One ACCESS_ALLOWED ACE for GENERIC_ALL for builtin administrators, and 217*780fb4a2SCy Schubertone ACCESS_ALLOWED ACE for GENERIC_ALL for power users.) 218*780fb4a2SCy Schubert 219*780fb4a2SCy Schubert(close to wide open, but you have to be a valid user on 220*780fb4a2SCy Schubertthe machine): 221*780fb4a2SCy Schubert 222*780fb4a2SCy Schubertctrl_interface=SDDL=D:(A;;GA;;;AU) 223*780fb4a2SCy Schubert 224*780fb4a2SCy Schubert(One ACCESS_ALLOWED ACE for GENERIC_ALL for the "authenticated users" 225*780fb4a2SCy Schubertgroup.) 226*780fb4a2SCy Schubert 227*780fb4a2SCy SchubertThis one would allow absolutely everyone (including anonymous 228*780fb4a2SCy Schubertusers) -- this is *not* recommended, since named pipes can be attached 229*780fb4a2SCy Schubertto from anywhere on the network (i.e. there's no "this machine only" 230*780fb4a2SCy Schubertlike there is with 127.0.0.1 sockets): 231*780fb4a2SCy Schubert 232*780fb4a2SCy Schubertctrl_interface=SDDL=D:(A;;GA;;;BU)(A;;GA;;;AN) 233*780fb4a2SCy Schubert 234*780fb4a2SCy Schubert(BU == "builtin users", "AN" == "anonymous") 235*780fb4a2SCy Schubert 236*780fb4a2SCy SchubertSee also [1] for the format of ACEs, and [2] for the possible strings 237*780fb4a2SCy Schubertthat can be used for principal names. 238*780fb4a2SCy Schubert 239*780fb4a2SCy Schubert[1] 240*780fb4a2SCy Schuberthttp://msdn.microsoft.com/library/default.asp?url=/library/en-us/secauthz/security/ace_strings.asp 241*780fb4a2SCy Schubert[2] 242*780fb4a2SCy Schuberthttp://msdn.microsoft.com/library/default.asp?url=/library/en-us/secauthz/security/sid_strings.asp 243*780fb4a2SCy Schubert 244*780fb4a2SCy Schubert 245*780fb4a2SCy SchubertStarting wpa_supplicant as a Windows service (wpasvc.exe) 246*780fb4a2SCy Schubert--------------------------------------------------------- 247*780fb4a2SCy Schubert 248*780fb4a2SCy Schubertwpa_supplicant can be started as a Windows service by using wpasvc.exe 249*780fb4a2SCy Schubertprogram that is alternative build of wpa_supplicant.exe. Most of the 250*780fb4a2SCy Schubertcore functionality of wpasvc.exe is identical to wpa_supplicant.exe, 251*780fb4a2SCy Schubertbut it is using Windows registry for configuration information instead 252*780fb4a2SCy Schubertof a text file and command line parameters. In addition, it can be 253*780fb4a2SCy Schubertregistered as a service that can be started automatically or manually 254*780fb4a2SCy Schubertlike any other Windows service. 255*780fb4a2SCy Schubert 256*780fb4a2SCy SchubertThe root of wpa_supplicant configuration in registry is 257*780fb4a2SCy SchubertHKEY_LOCAL_MACHINE\SOFTWARE\wpa_supplicant. This level includes global 258*780fb4a2SCy Schubertparameters and a 'interfaces' subkey with all the interface configuration 259*780fb4a2SCy Schubert(adapter to confname mapping). Each such mapping is a subkey that has 260*780fb4a2SCy Schubert'adapter', 'config', and 'ctrl_interface' values. 261*780fb4a2SCy Schubert 262*780fb4a2SCy SchubertThis program can be run either as a normal command line application, 263*780fb4a2SCy Schuberte.g., for debugging, with 'wpasvc.exe app' or as a Windows service. 264*780fb4a2SCy SchubertService need to be registered with 'wpasvc.exe reg <full path to 265*780fb4a2SCy Schubertwpasvc.exe>'. Alternatively, 'wpasvc.exe reg' can be used to register 266*780fb4a2SCy Schubertthe service with the current location of wpasvc.exe. After this, wpasvc 267*780fb4a2SCy Schubertcan be started like any other Windows service (e.g., 'net start wpasvc') 268*780fb4a2SCy Schubertor it can be configured to start automatically through the Services tool 269*780fb4a2SCy Schubertin administrative tasks. The service can be unregistered with 270*780fb4a2SCy Schubert'wpasvc.exe unreg'. 271*780fb4a2SCy Schubert 272*780fb4a2SCy SchubertIf the service is set to start during system bootup to make the 273*780fb4a2SCy Schubertnetwork connection available before any user has logged in, there may 274*780fb4a2SCy Schubertbe a long (half a minute or so) delay in starting up wpa_supplicant 275*780fb4a2SCy Schubertdue to WinPcap needing a driver called "Network Monitor Driver" which 276*780fb4a2SCy Schubertis started by default on demand. 277*780fb4a2SCy Schubert 278*780fb4a2SCy SchubertTo speed up wpa_supplicant start during system bootup, "Network 279*780fb4a2SCy SchubertMonitor Driver" can be configured to be started sooner by setting its 280*780fb4a2SCy Schubertstartup type to System instead of the default Demand. To do this, open 281*780fb4a2SCy Schubertup Device Manager, select Show Hidden Devices, expand the "Non 282*780fb4a2SCy SchubertPlug-and-Play devices" branch, double click "Network Monitor Driver", 283*780fb4a2SCy Schubertgo to the Driver tab, and change the Demand setting to System instead. 284*780fb4a2SCy Schubert 285*780fb4a2SCy SchubertConfiguration data is in HKEY_LOCAL_MACHINE\SOFTWARE\wpa_supplicant\configs 286*780fb4a2SCy Schubertkey. Each configuration profile has its own key under this. In terms of text 287*780fb4a2SCy Schubertfiles, each profile would map to a separate text file with possibly multiple 288*780fb4a2SCy Schubertnetworks. Under each profile, there is a networks key that lists all 289*780fb4a2SCy Schubertnetworks as a subkey. Each network has set of values in the same way as 290*780fb4a2SCy Schubertnetwork block in the configuration file. In addition, blobs subkey has 291*780fb4a2SCy Schubertpossible blobs as values. 292*780fb4a2SCy Schubert 293*780fb4a2SCy SchubertHKEY_LOCAL_MACHINE\SOFTWARE\wpa_supplicant\configs\test\networks\0000 294*780fb4a2SCy Schubert ssid="example" 295*780fb4a2SCy Schubert key_mgmt=WPA-PSK 296*780fb4a2SCy Schubert 297*780fb4a2SCy SchubertSee win_example.reg for an example on how to setup wpasvc.exe 298*780fb4a2SCy Schubertparameters in registry. It can also be imported to registry as a 299*780fb4a2SCy Schubertstarting point for the configuration. 300