Подключение по wps linux

Обновлено: 04.07.2024

Connecting Wifi with WPS "Push Button Support"

Forum rules
Please don't add support questions to tutorials,start your own thread in the appropriate sub-forum instead. Before you post please read this 2 posts • Page 1 of 1 LukeGM Level 1
Posts: 4 Joined: Mon Mar 23, 2015 7:02 am

Connecting Wifi with WPS "Push Button Support"

Post by LukeGM » Mon Mar 23, 2015 8:12 am

How to connect to a wifi network / wireless access point using the WPS button without a password.

Mint 16 and wpa_cli version 1 (But will probably work on many other versions of linux with wpa_cli, part of wpa_suplicant, version 1).

I hope this is helpful, before launching into the 'hack it and see' below, I spent some time trying to find some sort of instructions on how to connect to a wireless access point (wifi network connect) if you don't know the password but do have access to the wireless router / access point with a "WPS" button. All I could find in forums online were pretty much snide comments from some self important <word deleted by author to maintain PG rating> telling the hapless posters asking for help that WPS is insecure and that they should be using password/key. When the poor posters reiterated that they would happily use the password/key but that they had no way of retriving it, the self important ---- kept repeating over and over again not to use WPS and use the password/key. (End intro/rant).

These are the notes I made after successfuly connecting to a wifi network using the WPS button on the router, without the password/key. I hope they're helpful, it worked for me and I hope it will work for you too (but if it doesn't please don't hold me responsible and I won't be able to help you diagnose your particular issue/s as I don't have access to a wireless access point with a WPS button, nor do I have access to your particular router/AP type, your laptop type or config. Sorry but if you follow my istructions below and they don't work for you there's nothing I can add to help you, I literally guessed my way through this process and my understanding of it is minimal).

The below is all done on the command line, so start by opening up your favourite terminal emulator. (The example below is real, with real network SSIDs etc, I don't believe this exposes or discloses any security details and the access point / network has now been decommissioned.)

(Start instructions)
Setting up wifi connection using WPS Push Button Mode using wpa_cli

How to connect to Wi-Fi AP through WPS? All ways will be nice: configs, CLI, GUI - anything.

351 1 1 gold badge 4 4 silver badges 7 7 bronze badges I have no possibility to try solution for any time, but it seems good. @user51072 Did you try it? do you have a working solution? Its very good question but very complex answers :/ what is really interesting that on onther platforms its one click functionality. We might probably wait till there is better more stable way before accepting answer..

5 Answers 5

Tested using Ubuntu 16.04 LTS:

For WPS Push-button mode:

You can push the WPS button before or after this command, but you have two minutes to have the button pushed and this command ran or you'll have to do it all over again.

For WPS Pin mode:


You are correct, QSS is not the same as WPS. But this question is about WPS, so. This worked, however I also had to manually start dhcpcd ( sudo dhcpcd ) and the network icon in my taskbar showed no connection even though I could load webpages.

Stop the Network-Manager

Set yourself up a very basic wpa_supplicant.conf in /etc/wpa_supplicant.conf . This command will overwrite any pre-exsiting wpa_supplicant.conf file!:

Start wpa_supplicant in daemon mode:

Run sudo wpa_cli . This will start a interactive wpa_cli session.

  • Verify that it's working by issuing command status . You should see wpa_state=INACTIVE
  • Issue scan to scan for existing access-points.
  • Issue scan_result after a few seconds to show the results from your scan

Add our BSSID and PIN:

Where xx:xx:xx:xx:xx:xx is your BSSID from your scan results. You should see an "OK". Wait a few more seconds as wpa_supplicant picks up the BSSID and tries to associate and perform key negotiation. What you want to see is CTRL-EVENT-CONNECTED , which will indicate that the PIN was accepted and that you're now associated.

Run sudo dhclient wlan0 to get IP from the AP (assuming DHCPd were enabled).

Verify with cat /etc/wpa_supplicant.conf your newly updated config-file.

If all went well, you should have a line under this new network titled psk .

So basically, I'd like to use iwconfig to connect to my wifi network when I'm not inside X. But I just don't see a way to do it in the man page. Any idea?


3,850 2 2 gold badges 22 22 silver badges 37 37 bronze badges

9 Answers 9

iw (list/config) can only handle WEP.

You need the wpasupplicant package which provides the wpa_supplicant command, install if necessary through sudo apt-get install wpasupplicant .

You put your SSID and password into /etc/wpa_supplicant.conf (requires sudo).

Assuming your interface is wlan0 you can connect with:

"wext" is a driver and that will be specific for each card; refer to wpa_supplicant -h . Examples:

266k 37 37 gold badges 511 511 silver badges 652 652 bronze badges I just completely omit the -D option and it works! Thanks! :)

I'm copying the contents here, so we have it, in case that site goes offline.

Command line WPA

Sometimes you'll be at a command line with no access to GUI networking tools -- but your access point is secured with WPA. What do you do?

Assuming your wireless card actually works (i.e. iwconfig can see it and interact with it), using wpa_supplicant is actually pretty simple. Installing wpa_supplicant

Most distros nowadays have wpa_supplicant installed by default. If you have the commands wpa_passphrase and wpa_supplicant available, then you're good to go. Otherwise, you will need to install the package by doing something like (for Ubuntu):

Or whatever the command is for your distro.

Generating the config file

Now that wpa_supplicant is installed, we will create its configuration file. Once you know the SSID and WPA passphrase, all you have to do is run:

Of course, replace "myrouter" with the SSID of your router, "mypassphrase" with your WPA passphrase, and "wpa.conf" with whatever file you want to store the configuration in. This filename does not have to follow a particular format or have a particular extension.

Alternatively, to avoid typing the passphrase on the command line (so it doesn't get saved in the shell's history), you can specify just the SSID on the command line. wpa_passphrase will wait for you to type in the passphrase followed by enter:

You should end up with a file looking like this:

Getting connected

Now we will actually run wpa_supplicant to connect to the wireless network. First, if your router broadcasts its SSID (they all do by default), you probably want to make sure your wireless card can actually see it:

You might have to run that as root to force a refresh.

Next, you will need to know three pieces of information:

Now that you have this data, run (as root):

There are no spaces between the options and parameters. Don't include the brackets as I just added those for clarity. For example, for my laptop it looks like this:

You can also run it in the background by using the -B option so that it doesn't take up your console.

Now you're associated with the network.

Getting online

To actually get online, you'll have to get an IP somehow. Most people will just want to get a dynamic IP from a DHCP server, probably the one built into the router. (I'm not going to cover setting a static IP and routing table because that's a beast in itself.)

To get a DHCP lease, first release whatever leases you're still holding onto (as root):

Then ask for a new lease (of course replacing eth1 with the name of your network device, the same one as you used in the previous section):


Мануал

WPS позволяет вам присоединиться к безопасной сети WiFi без ввода сетевого имени и ввода пароля, он пытается создать соединение между маршрутизатором и беспроводными устройствами быстрее и проще.

WPS работает только для беспроводных сетей с персональной защитой WPA Personal или WPA2.

Wi-Fi Protected Setup была хорошей идеей, но использование ее является ошибкой.

WPS имеет «кнопку» для подключения беспроводных устройств к вашему маршрутизатору.

Когда вы подключаете устройство, поддерживающее WPS, у вас есть возможность использовать WPS вместо входа по паролю от сети WiFi.

Затем поставьте устройство, которое хотите подключить в области состояния WPS (выбрав его на своем устройстве, например смартфон, планшет и т. д.).

Затем нажмите кнопку WPS на вашем маршрутизаторе/модеме.

Наконец, два устройства обмениваются информацией, и устройство будет подключаться.

Существуют два разных метода работы WPS:

PBC (Push Button Connect): Как я объяснил ранее, WPS имеет физическую кнопку.

После попытке подключения вашего устройства к маршрутизатору вы можете просто нажать физическую кнопку WPS на маршрутизаторе, обычно находящуюся на задней панели.

Устройства могут подключаться только к этому методу в течение нескольких минут после нажатия кнопки или после подключения отдельных устройств. Это (похоже) более безопасно, оно не будет активно и доступно для использования все время.

Соединение с WPS-соединением кажется в значительной степени безопасным, но уязвимость использования этого способа находится на этой кнопке.

Кто бы мог добраться до этой кнопки, можно было подключиться к этой беспроводной сети, даже если они не знали кодовую фразу Wi-Fi.

PIN-код: маршрутизатор имеет восьмизначный PIN-код, который необходимо ввести на устройства для подключения.

Это делает PIN-код WPS очень легким для брутфорса, он не сразу проверяет весь восьмизначный PIN-код, маршрутизатор проверяет первые четыре цифры отдельно от последних четырех цифр.

Угадывая разные комбинации, и существует только 11 000 из четырех цифр кода, и как только инструмент брута получает первые четыре цифры правильно, злоумышленник может перейти к остальным цифрам.

Многие маршрутизаторы не осуществляют тайм-аут после того, как неправильный PIN-код WPS согласован, что позволяет хакерам ломиться снова и снова.

PIN-код WPS может быть принудительно выполнен в течение всего дня.

У Kali linux есть несколько инструментов, чтобы выполнить команду wps.

В этом уроке я не взломаю WPS-маршрутизатор, я просто покажу вам, как сканировать вашу цель, независимо от того, включен ли WPS или нет.

ШАГ 1: установите режим монитора

Во-первых, установите беспроводной интерфейс в режиме монитора с помощью airmon-ng и не забудьте сделать «check kill».

Читайте также: