rockymeza / wifi

[unmaintained] WiFi tools for linux
http://pypi.python.org/pypi/wifi
BSD 2-Clause "Simplified" License
304 stars 151 forks source link

Adding WPA2 Entreprise #52

Open irgusite opened 9 years ago

irgusite commented 9 years ago

Would it be possible to add WPA2 Entreprise support?

rockymeza commented 9 years ago

Hi @irgusite,

I would love to add WPA2 Enterprise support, but unfortunately, I don't have access to a WPA2 Enterprise network. I don't know what's required to connect to that kind of network. Pull requests are welcome though.

irgusite commented 9 years ago

For WPA2-enterprise you have to use wpa_supplicant. I will try to code something simple but I don't know how you want it implemented.

A little example of the config file and the command to use to connect:

#/etc/wpa_supplicant.conf

network={
    ssid="ssid"
    proto=RSN
    key_mgmt=WPA-EAP
    pairwise=CCMP
    auth_alg=OPEN
    eap=MSCHAPV2
    identity="username"
    password="password"
}

Then you connect to the network with:

sudo wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf

I use this to connect my raspi to my network.

rockymeza commented 9 years ago

I managed to get the WPA2 Personal running without the wpa-supplicant, I'm not really sure what it does, I just figured out how it was hashing the passwords and implemented that in Python, that was I didn't have to use a different method to connect to WPA networks.

I don't know what the difference between WPA Personal and Enterprise is, I hope to get some time after the New Year to work on this, but I don't know where I could get access to a WPA Enterprise network to test it.

irgusite commented 9 years ago

The enterprise connections asks you for username and password and verifies if the couple exists in a database. That's the big lines of the functioning.

This couple has to be set in the wpa_supplicant file.

Philipp Schuler irgusite@gmail.com PGP: 0x9942BD22

MrDadaGuy commented 9 years ago

+1 I would also like to see this implemented - thanks!

DamianPe commented 8 years ago

Hi! Is there any progres regarding Enterprise, please. This would make your work even more amazing! Cheers!

irgusite commented 8 years ago

Actually not on my side, I had problems with my WPA2 entreprise installation and have not worked on it. I have only integrated the detection of the WPA2/entreprise.

Le 8 janvier 2016 20:32:26 GMT+01:00, DamianPe notifications@github.com a écrit :

Hi! Is there any progres regarding Enterprise, please. This would make your work even more amazing! Cheers!


Reply to this email directly or view it on GitHub: https://github.com/rockymeza/wifi/issues/52#issuecomment-170100896

Envoyé de mon appareil Android avec K-9 Mail. Veuillez excuser ma brièveté.

MrDadaGuy commented 8 years ago

Hi - I was watching this on github and saw your note. I ended up rolling my own Enterprise mode for a different project. I didn't break it out to a separate module but it should be easy enough to see & copy what I've done:

https://bitbucket.org/veggiebenz/pyspresso/src/1a15df69102ae96abd5fd352267445bd9dab0bae/ispresso.py?fileviewer=file-view-default

Starting around line 688 thru 833

Good luck, hope this helps.

Chris

On Fri, Jan 8, 2016 at 1:32 PM, DamianPe notifications@github.com wrote:

Hi! Is there any progres regarding Enterprise, please. This would make your work even more amazing! Cheers!

— Reply to this email directly or view it on GitHub https://github.com/rockymeza/wifi/issues/52#issuecomment-170100896.

DamianPe commented 8 years ago

Hello irgusite,

Thanks for fast response and sorry for mine late one. Is detection of WPA2 Enterprise included in main branch of your code? I have one available and when I read "encryption_type" it returns only "wpa2", exactly the same as while asking about regular WPA2 network (my personal one)...

Hi MrDadaGuy,

Thanks for your code, I appreciate your help, I didn't expect such a response :) When I deal with detection of WPA2 Enterprise, I will take your code as an example :)

irgusite commented 8 years ago

Hi, Yes, my main branch includes the detection. I don't know if I've pushed the code on github. I look at it when I'm back home :)

Le 17 janvier 2016 12:19:12 GMT+01:00, DamianPe notifications@github.com a écrit :

Hello irgusite,

Thanks for fast response and sorry for mine late one. Is detection of WPA2 Enterprise included in main branch of your code? I have one available and when I read "encryption_type" it returns only "wpa2", exactly the same as while asking about regular WPA2 network (my personal one)...

Hi MrDadaGuy,

Thanks for your code, I appreciate your help, I didn't expect such a response :) When I deal with detection of WPA2 Enterprise, I will take your code as an example :)


Reply to this email directly or view it on GitHub: https://github.com/rockymeza/wifi/issues/52#issuecomment-172314964

Envoyé de mon appareil Android avec K-9 Mail. Veuillez excuser ma brièveté.

irgusite commented 8 years ago

@DamianPe So, yeah I've checked and the detection is included. The last thing to do is correct the integration tests. Because i've no WPA2/Entreprise wifi I can't correct it. Look at 88d62fdc5fde36472ff0d011a6c5c11e23dc3a6d and 5e3805f98e29c57a7fd8ce240c444aa163c834d4 to see the modifications ;)

DamianPe commented 8 years ago

Thanks for checking that for me. I tried to install tkat specific commit (the one with spelling errors corrected) but for some reason it keeps returning an error. I have no idea where is the fault. Can you quide me through, please?

2016-01-17 17:07 GMT+01:00 irgusite notifications@github.com:

@DamianPe https://github.com/DamianPe So, yeah I've checked and the detection is included. The last thing to do is correct the integration tests. Because i've no WPA2/Entreprise wifi I can't correct it. Look at 88d62fd https://github.com/rockymeza/wifi/commit/88d62fdc5fde36472ff0d011a6c5c11e23dc3a6d and 5e3805f https://github.com/rockymeza/wifi/commit/5e3805f98e29c57a7fd8ce240c444aa163c834d4 to see the modifications ;)

— Reply to this email directly or view it on GitHub https://github.com/rockymeza/wifi/issues/52#issuecomment-172345056.

irgusite commented 8 years ago

@DamianPe I can. But waht error is it returning?

DamianPe commented 8 years ago

@irgusite

Copy-paste from PuTTy: root@raspberry:/home/pi# pip install git+git://github.com/rockymeza/wifi.git@5e 3805f98e29c57a7fd8ce240c444aa163c834d4 Downloading/unpacking git+git://github.com/rockymeza/wifi.git@5e3805f98e29c57a7f d8ce240c444aa163c834d4 Cloning git://github.com/rockymeza/wifi.git (to 5e3805f98e29c57a7fd8ce240c444a a163c834d4) to /tmp/pip-MErJ9y-build Could not find a tag or branch '5e3805f98e29c57a7fd8ce240c444aa163c834d4', ass uming commit. fatal: reference is not a tree: 5e3805f98e29c57a7fd8ce240c444aa163c834d4 Complete output from command /usr/bin/git checkout -q 5e3805f98e29c57a7fd8ce24 0c444aa163c834d4:


Command /usr/bin/git checkout -q 5e3805f98e29c57a7fd8ce240c444aa163c834d4 failed with error code 128 in /tmp/pip-MErJ9y-build Storing complete log in /root/.pip/pip.log

irgusite commented 8 years ago

The commit doesn't exists on this repo as it's not merged. Try maybe git@github.com:irgusite/wifi.git.

DamianPe commented 8 years ago

@irgusite This worked perfectly, thank you! I Should have asked you several hours earlier ;)

DamianPe commented 8 years ago

@irgusite I have a problem again, unfortunately. Everything worked beautifully last time but my Raspberry Pi started to crash at boot and I had to format SD card, install brand new OS and I'm now restoring my config. I'm stuck at the commit of yours, I keep getting different errors from github, last one is:

ERROR: Repository not found.
fatal: Could not read from remote repository.

What am I doing wrong this time? Or maybe you have changed something?

irgusite commented 8 years ago

What command are you using? I've changed nothing since the last time :)

Le 1 février 2016 11:55:21 GMT+01:00, DamianPe notifications@github.com a écrit :

@irgusite I have a problem again, unfortunately. Everything worked beautifully last time but my Raspberry Pi started to crash at boot and I had to format SD card, install brand new OS and I'm now restoring my config. I'm stuck at the commit of yours, I keep getting different errors from github, last one is:

ERROR: Repository not found.
fatal: Could not read from remote repository.

What am I doing wrong this time? Or maybe you have changed something?


Reply to this email directly or view it on GitHub: https://github.com/rockymeza/wifi/issues/52#issuecomment-177913555

Envoyé de mon appareil Android avec K-9 Mail. Veuillez excuser ma brièveté.

DamianPe commented 8 years ago

I am using pip install git+ssh://git@github.com:irgusite/wifi.git@5e3805f98e29c57a7fd8ce240c444aa163c834d4

irgusite commented 8 years ago

Okay so, I've tried and I can't clone the repo with ssh but it works with https so try with that and telle me if it's working. Could you also supply the iwlist scan output? Would be nice so I can add the test and and we could merge the changes to the main branch ;)

DamianPe commented 8 years ago

OK, it worked with https, thanks! Would you like to receive output from scan here or maybe on private? I don't think it should be pasted here :)

irgusite commented 8 years ago

Yes, send me a pm. Thank you :)

Le 1 février 2016 13:21:02 GMT+01:00, DamianPe notifications@github.com a écrit :

OK, it worked with https, thanks! Would you like to receive output from scan here or maybe on private? I don't think it should be pasted here :)


Reply to this email directly or view it on GitHub: https://github.com/rockymeza/wifi/issues/52#issuecomment-177947397

Envoyé de mon appareil Android avec K-9 Mail. Veuillez excuser ma brièveté.

DamianPe commented 8 years ago

PMs on Github? Rather impossible. Maybe an e-mail but I don't have yours... yet :)

2016-02-01 13:22 GMT+01:00 irgusite notifications@github.com:

Yes, send me a pm. Thank you :)

Le 1 février 2016 13:21:02 GMT+01:00, DamianPe notifications@github.com a écrit :

OK, it worked with https, thanks! Would you like to receive output from scan here or maybe on private? I don't think it should be pasted here :)


Reply to this email directly or view it on GitHub: https://github.com/rockymeza/wifi/issues/52#issuecomment-177947397

Envoyé de mon appareil Android avec K-9 Mail. Veuillez excuser ma brièveté.

— Reply to this email directly or view it on GitHub https://github.com/rockymeza/wifi/issues/52#issuecomment-177947617.

irgusite commented 8 years ago

irgusite (at) gmail ;)

DamianPe commented 8 years ago

@irgusite Have you received my e-mail?

irgusite commented 8 years ago

Yes I have, it seems you haven't got my answer. :) I will send it back :)

Le 3 février 2016 08:38:10 GMT+01:00, DamianPe notifications@github.com a écrit :

@irgusite Have you received my e-mail?


Reply to this email directly or view it on GitHub: https://github.com/rockymeza/wifi/issues/52#issuecomment-179067672

Envoyé de mon appareil Android avec K-9 Mail. Veuillez excuser ma brièveté.

DamianPe commented 8 years ago

Nope, I checked SPAM folder, nothing there from you either... Weird...