Se connecter par wifi avec la console

Bonjour,

J’essaye de me connecter en wifi en mode console. J’ai trouvé de nombreuses solution sur le net mais aucune n’a pu résoudre mon problème.

Le premier essai est de se connecter à un AP qui ne pose pas de problème (je peux le faire avec network-manager/wcid) et ensuite sur une Bbox qui pour l’instant refuse toute connexion.

J’utilise wlan1 qui est une carte awus036H branché en usb. Elle fonctionne parfaitement sur n’importe quel AP sauf ma bbox.
Pour l’instant le but est de se connecter en mode console au premier AP.

[code]root@localhost:~# iwconfig
wlan0 IEEE 802.11bgn ESSID:off/any
Mode:Managed Access Point: Not-Associated Tx-Power=15 dBm
Retry short limit:7 RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off

lo no wireless extensions.

eth0 no wireless extensions.

wlan1 IEEE 802.11bg ESSID:off/any
Mode:Managed Access Point: Not-Associated Tx-Power=20 dBm
Retry short limit:7 RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off[/code]

Le contenu de /etc/network/interfaces : http://www.pastebin.com/Fwu31bM9
Le contenu de /etc/wpa_supplicant/wpa_supplicant.conf : http://www.pastebin.com/XPrd3VSD

Avec la méthode 1 et 2 :

[code]root@localhost:~# sudo /etc/init.d/networking restart
[warn] Running /etc/init.d/networking restart is deprecated because it may not re-enable some interfaces … (warning).
[…] Reconfiguring network interfaces…Internet Systems Consortium DHCP Client 4.2.2
Copyright 2004-2011 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/wlan1/00:c0:ca:75:ce:e3
Sending on LPF/wlan1/00:c0:ca:75:ce:e3
Sending on Socket/fallback
DHCPRELEASE on wlan1 to 192.168.2.1 port 67
Reloading /etc/samba/smb.conf: smbd only.
wpa_supplicant: /sbin/wpa_supplicant daemon failed to start
run-parts: /etc/network/if-pre-up.d/wpasupplicant exited with return code 1
Internet Systems Consortium DHCP Client 4.2.2
Copyright 2004-2011 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/wlan1/00:c0:ca:00:00:00
Sending on LPF/wlan1/00:c0:ca:00:00:00
Sending on Socket/fallback
DHCPDISCOVER on wlan1 to 255.255.255.255 port 67 interval 4
DHCPDISCOVER on wlan1 to 255.255.255.255 port 67 interval 11
DHCPDISCOVER on wlan1 to 255.255.255.255 port 67 interval 12
DHCPDISCOVER on wlan1 to 255.255.255.255 port 67 interval 8
DHCPDISCOVER on wlan1 to 255.255.255.255 port 67 interval 9
DHCPDISCOVER on wlan1 to 255.255.255.255 port 67 interval 10
DHCPDISCOVER on wlan1 to 255.255.255.255 port 67 interval 7
No DHCPOFFERS received.
No working leases in persistent database - sleeping.
done.[/code]

root@localhost:~# wpa_supplicant -Dwext -iwlan1 -c/etc/wpa_supplicant/wpa_supplicant.conf ioctl[SIOCSIWENCODEEXT]: Invalid argument ioctl[SIOCSIWENCODEEXT]: Invalid argument ctrl_iface exists and seems to be in use - cannot override it Delete '/var/run/wpa_supplicant/wlan1' manually if it is not used anymore Failed to initialize control interface '/var/run/wpa_supplicant'. You may have another wpa_supplicant process already running or the file was left by an unclean termination of wpa_supplicant in which case you will need to manually remove this file before starting wpa_supplicant again.
Je suis sur kali 1.1.0 qui est une distribution basé sur debian et tout est à jour.

Avant de t’embêter avec la conf dans /etc/network/interfaces, essaye d’abord de faire marche wpa_supplicant. On pourra ensuite voir pour l’automatisation :slightly_smiling:

Pour ma part, je ne m’embête pas à préciser les options de chiffrement (ou je ne sais quoi) dans ma conf wpa_supplicant, je mets juste le SSID, le type (open, WEP, WPA, etc.) et le phrase de passe.

network={
	ssid="NOM_SSID"
        proto=WPA RSN
        key_mgmt=WPA-PSK
        psk="PHRASEDEPASSE"
}

Et ça a fonctionné partout pour le moment.

J’ai changé mon wpa_supplicant.conf et un /etc/init.d/networking restart n’y change rien, j’ai toujours le même résultat.

EDIT : en faîte je viens de remarquer que même si j’indique pas de psk j’ai le même résultat
EDIT 2 : ok pour wpa_supplicant

Donc, essaye déjà de juste faire marcher wpa_supplicant, on verra le reste après.

Par cette méthode ?

root@localhost:~# wpa_supplicant -iwlan1 -c/etc/wpa_supplicant/wpa_supplicant.conf ioctl[SIOCSIWENCODEEXT]: Invalid argument ioctl[SIOCSIWENCODEEXT]: Invalid argument wlan1: Trying to associate with d8:49:2f:86:xx:xx (SSID='MON_SSID' freq=2422 MHz) wlan1: Associated with 00:00:00:00:00:00 wlan1: CTRL-EVENT-DISCONNECTED bssid=d8:49:2f:86:xx:xx reason=0 ioctl[SIOCSIWENCODEEXT]: Invalid argument ioctl[SIOCSIWENCODEEXT]: Invalid argument wlan1: Trying to associate with d8:49:2f:86:xx:xx (SSID='MON_SSID' freq=2422 MHz) wlan1: Associated with 00:00:00:00:00:00 wlan1: WPA: No SSID info found (msg 1 of 4) wlan1: CTRL-EVENT-DISCONNECTED bssid=d8:49:2f:86:xx:xx reason=0 ioctl[SIOCSIWENCODEEXT]: Invalid argument ioctl[SIOCSIWENCODEEXT]: Invalid argument wlan1: Trying to associate with d8:49:2f:86:xx:xx (SSID='MON_SSID' freq=2422 MHz) wlan1: Associated with d8:49:2f:86:xx:xx wlan1: WPA: 4-Way Handshake failed - pre-shared key may be incorrect wlan1: CTRL-EVENT-DISCONNECTED bssid=d8:49:2f:86:xx:xx reason=0 ioctl[SIOCSIWENCODEEXT]: Invalid argument ioctl[SIOCSIWENCODEEXT]: Invalid argument wlan1: Trying to associate with d8:49:2f:86:xx:xx (SSID='MON_SSID' freq=2422 MHz) wlan1: Associated with d8:49:2f:86:xx:xx wlan1: CTRL-EVENT-DISCONNECTED bssid=d8:49:2f:86:xx:xx reason=0 ioctl[SIOCSIWENCODEEXT]: Invalid argument ioctl[SIOCSIWENCODEEXT]: Invalid argument wlan1: Trying to associate with d8:49:2f:86:xx:xx (SSID='MON_SSID' freq=2422 MHz) wlan1: Associated with d8:49:2f:86:xx:xx wlan1: WPA: 4-Way Handshake failed - pre-shared key may be incorrect wlan1: CTRL-EVENT-DISCONNECTED bssid=d8:49:2f:86:xx:xx reason=0 ioctl[SIOCSIWENCODEEXT]: Invalid argument ioctl[SIOCSIWENCODEEXT]: Invalid argument wlan1: Trying to associate with d8:49:2f:86:xx:xx (SSID='MON_SSID' freq=2422 MHz) wlan1: Associated with d8:49:2f:86:xx:xx wlan1: WPA: 4-Way Handshake failed - pre-shared key may be incorrect wlan1: CTRL-EVENT-DISCONNECTED bssid=d8:49:2f:86:xx:xx reason=0 ioctl[SIOCSIWENCODEEXT]: Invalid argument ioctl[SIOCSIWENCODEEXT]: Invalid argument wlan1: Trying to associate with d8:49:2f:86:xx:xx (SSID='MON_SSID' freq=2422 MHz) wlan1: Associated with 00:00:00:00:00:00 wlan1: CTRL-EVENT-DISCONNECTED bssid=d8:49:2f:86:xx:xx reason=0 ioctl[SIOCSIWENCODEEXT]: Invalid argument ioctl[SIOCSIWENCODEEXT]: Invalid argument wlan1: Trying to associate with d8:49:2f:86:xx:xx (SSID='MON_SSID' freq=2422 MHz) wlan1: Associated with 00:00:00:00:00:00 wlan1: CTRL-EVENT-DISCONNECTED bssid=d8:49:2f:86:xx:xx reason=0 ioctl[SIOCSIWENCODEEXT]: Invalid argument ioctl[SIOCSIWENCODEEXT]: Invalid argument wlan1: Trying to associate with d8:49:2f:86:xx:xx (SSID='MON_SSID' freq=2422 MHz) wlan1: Associated with d8:49:2f:86:xx:xx wlan1: WPA: No SSID info found (msg 1 of 4) wlan1: CTRL-EVENT-DISCONNECTED bssid=d8:49:2f:86:xx:xx reason=0 ioctl[SIOCSIWENCODEEXT]: Invalid argument ioctl[SIOCSIWENCODEEXT]: Invalid argument wlan1: Trying to associate with d8:49:2f:86:xx:xx (SSID='MON_SSID' freq=2422 MHz) wlan1: Associated with 00:00:00:00:00:00 wlan1: CTRL-EVENT-DISCONNECTED bssid=d8:49:2f:86:xx:xx reason=0 ioctl[SIOCSIWENCODEEXT]: Invalid argument ioctl[SIOCSIWENCODEEXT]: Invalid argument wlan1: Trying to associate with d8:49:2f:86:xx:xx (SSID='MON_SSID' freq=2422 MHz) wlan1: Associated with 00:00:00:00:00:00 wlan1: CTRL-EVENT-DISCONNECTED bssid=d8:49:2f:86:xx:xx reason=0 ioctl[SIOCSIWENCODEEXT]: Invalid argument ioctl[SIOCSIWENCODEEXT]: Invalid argument ^Cwlan1: CTRL-EVENT-TERMINATING - signal 2 received
ensuite sa tourne en boucle

Donc il me répond par :
[ul]wlan1: WPA: 4-Way Handshake failed - pre-shared key may be incorrect
wlan1: WPA: No SSID info found (msg 1 of 4)
wlan1: Associated with 00:00:00:00:00:00[/ul]

J’ai la version 1.0 de wpa_supplicant

Est-ce que ce SSID est caché ?

non

voici un airodump :

[code]BSSID PWR Beacons #Data, #/s CH MB ENC CIPHER AUTH ESSID

D8:49:2F:86:xx:xx -28 5 0 0 3 54e. WPA2 CCMP PSK Imprimante-Yohan[/code]

Bonjour

Si tu as toujours des problèmes tu as la solution wicd-curses. Peut être existe il la même chose avec network-manager?

Dans l’optique de me rapprocher de l’aide que peut m’apporter ce forum j’ai installé wicd-curses.

Pour se connecter au premier AP pas de soucie, tout fonctionne comme network-manager.
En revanche pour se connecter à ma bbox j’ai le même soucie, il boque au niveau de “validation de l’authentification”. Je suis pourtant certains que c’est le bon psk.
Je vais essayer de bidouiller les paramètres.

Comme l’indique le titre, l’intéret de se connecter en mode console est de pouvoir lire l’intégralité de la procédure pour en savoir d’avantage sur les erreurs qui surviennent.

Tu ne ferais pas un filtrage par adresses MAC à tout hasard ?

Le propriétaire a verrouillé l’accès à la box de peur que “je casse tout en bidouillant” :neutral_face:
Dans tout les cas il ne m’a pas parlé de ça.

De toute façon s’il y a un filtrage MAC ma machine ne devrait même pas pouvoir s’associer pour ensuite vérifier l’authentification.
Un visionnage complet de la procédure pourrait clarifier la situation.