Search code examples
pythonsecuritynetwork-programmingwindows-7wifi

Simple Python program to connect to a secure wifi network with user input credentials


My question I guess is: Is this possible without shelling out to command line and without 3rd party Python packages? I can't seem to find any native Python commands to manipulate or configure a wireless network connection. I know there are already built-in 'netsh wlan' commands in Windows 7, but would rather this all be in python. I am also confused by the logistics of this operation. With the netsh stuff, you still are required to have a wireless profile xml file specified in the command. My current image doesn't have any wireless profiles and I do not really understand the purpose of that if you are connecting to a brand new network. Why is this not automatically generated when you connect?


A little bit about the network

Network type: Infrastructure

Authentication: WPA2-Enterprise

Encryption: CCMP


The ultimate goal is to have a script that my users can just launch, put in their credentials, and never see the multiple Windows dialogues while doing so. I'm not asking for someone to write this for me. That's what I'm suppose to do. I just need to know if anyone has successfully done something like this in strictly Python or point me in the right direction. Thanks!


Solution

  • No. Python standard library doesn't ship with any functionality to control platform-specific functionality like wireless adapters. You have to invoke the tools shipped with the platform, find some 3rd party libraries that control this functionality, or write your own such libraries.