[Realtek] WPA_SUPPLICANT + WPA_CLI使用指南

这篇具有很好参考价值的文章主要介绍了[Realtek] WPA_SUPPLICANT + WPA_CLI使用指南。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

开启wpa_supplicant

wpa_supplicant –Dnl80211 -iwlan0 -c  ./wpa.conf –B

或者

wpa_supplicant -Dwext -iwlan0 -c ./wpa.conf -B

扫描AP

wpa_cli -p/var/run/wpa_supplicant scan

查看AP扫描结果

wpa_cli -p/var/run/wpa_supplicant scan_results

连接到热点

OPEN

wpa_cli -p/var/run/wpa_supplicant remove_network 0 
wpa_cli -p/var/run/wpa_supplicant ap_scan 1 
wpa_cli -p/var/run/wpa_supplicant add_network 
wpa_cli -p/var/run/wpa_supplicant set_network 0 ssid "test"
wpa_cli -p/var/run/wpa_supplicant set_network 0 key_mgmt NONE 
wpa_cli -p/var/run/wpa_supplicant select_network 0

WEP40 with open system

wpa_cli -p/var/run/wpa_supplicant remove_network 0 
wpa_cli -p/var/run/wpa_supplicant ap_scan 1 
wpa_cli -p/var/run/wpa_supplicant add_network 
wpa_cli -p/var/run/wpa_supplicant set_network 0 ssid "test"
wpa_cli -p/var/run/wpa_supplicant set_network 0 key_mgmt NONE 
wpa_cli -p/var/run/wpa_supplicant set_network 0 wep_key0 1234567890 
wpa_cli -p/var/run/wpa_supplicant set_network 0 wep_tx_keyidx 0 
wpa_cli -p/var/run/wpa_supplicant select_network 0

WEP40 with shared key mode

wpa_cli -p/var/run/wpa_supplicant remove_network 0 
wpa_cli -p/var/run/wpa_supplicant ap_scan 1 
wpa_cli -p/var/run/wpa_supplicant add_network 
wpa_cli -p/var/run/wpa_supplicant set_network 0 ssid "test" 
wpa_cli -p/var/run/wpa_supplicant set_network 0 key_mgmt NONE 
wpa_cli -p/var/run/wpa_supplicant set_network 0 wep_key0 1234567890 
wpa_cli -p/var/run/wpa_supplicant set_network 0 wep_tx_keyidx 0 
wpa_cli –p/var/run/wpa_supplicant set_network 0 auth_alg SHARED 
wpa_cli -p/var/run/wpa_supplicant select_network 0 

WEP104 with open system

wpa_cli -p/var/run/wpa_supplicant remove_network 0 
wpa_cli -p/var/run/wpa_supplicant ap_scan 1 
wpa_cli -p/var/run/wpa_supplicant add_network 
wpa_cli -p/var/run/wpa_supplicant set_network 0 ssid "test" 
wpa_cli -p/var/run/wpa_supplicant set_network 0 key_mgmt NONE 
wpa_cli -p/var/run/wpa_supplicant set_network 0 wep_key0 12345678901234567890123456 
wpa_cli -p/var/run/wpa_supplicant set_network 0 wep_tx_keyidx 0 
wpa_cli -p/var/run/wpa_supplicant select_network 0

WEP104 with shared key mode

wpa_cli -p/var/run/wpa_supplicant remove_network 0 
wpa_cli -p/var/run/wpa_supplicant ap_scan 1 
wpa_cli -p/var/run/wpa_supplicant add_network 
wpa_cli -p/var/run/wpa_supplicant set_network 0 ssid "test"
wpa_cli -p/var/run/wpa_supplicant set_network 0 key_mgmt NONE 
wpa_cli -p/var/run/wpa_supplicant set_network 0 wep_key0 12345678901234567890123456 
wpa_cli -p/var/run/wpa_supplicant set_network 0 wep_tx_keyidx 0 
wpa_cli –p/var/run/wpa_supplicant set_network 0 auth_alg SHARED 
wpa_cli -p/var/run/wpa_supplicant select_network 0 

wep key is ASCII

#If wep key is ASCII type,use the following cmd:

#WEP40:

wpa_cli -p/var/run/wpa_supplicant set_network 0 wep_key0 "12345"

#WEP104:

wpa_cli -p/var/run/wpa_supplicant set_network 0 wep_key0 '"1234567890123"'

#WEP key index is X from 0 to 3, change X for other key index and select it.

#wpa_cli -p/var/run/wpa_supplicant set_network 0 wep_keyX 12345678901234567890123456 #wpa_cli -p/var/run/wpa_supplicant set_network 0 wep_tx_keyidx X

TKIP and AES

wpa_cli -p/var/run/wpa_supplicant remove_network 0 
wpa_cli -p/var/run/wpa_supplicant ap_scan 1 
wpa_cli -p/var/run/wpa_supplicant add_network 
wpa_cli -p/var/run/wpa_supplicant set_network 0 ssid "test"
wpa_cli -p/var/run/wpa_supplicant set_network 0 key_mgmt WPA-PSK
wpa_cli -p/var/run/wpa_supplicant set_network 0 psk "12345678"
wpa_cli -p/var/run/wpa_supplicant select_network 0

Ad-hoc mode

OPEN 

wpa_cli -p/var/run/wpa_supplicant scan 
wpa_cli -p/var/run/wpa_supplicant scan_results 
wpa_cli -p/var/run/wpa_supplicant remove_network 0 
wpa_cli -p/var/run/wpa_supplicant ap_scan 2 
wpa_cli -p/var/run/wpa_supplicant add_network 
wpa_cli -p/var/run/wpa_supplicant set_network 0 ssid '"Adhoc_test"' 
wpa_cli -p/var/run/wpa_supplicant set_network 0 mode 1 
wpa_cli -p/var/run/wpa_supplicant set_network 0 key_mgmt NONE 
wpa_cli -p/var/run/wpa_supplicant set_network 0 frequency 2412 
wpa_cli -p/var/run/wpa_supplicant select_network 0

#frequency is to set the channel frequency for Ad-hoc master.

WEP40

wpa_cli -p/var/run/wpa_supplicant scan 
wpa_cli -p/var/run/wpa_supplicant scan_results 
wpa_cli -p/var/run/wpa_supplicant remove_network 0 
wpa_cli -p/var/run/wpa_supplicant ap_scan 2 
wpa_cli -p/var/run/wpa_supplicant add_network 
wpa_cli -p/var/run/wpa_supplicant set_network 0 ssid '"Adhoc_test"' 
wpa_cli -p/var/run/wpa_supplicant set_network 0 mode 1 
wpa_cli -p/var/run/wpa_supplicant set_network 0 key_mgmt NONE 
wpa_cli -p/var/run/wpa_supplicant set_network 0 wep_key0 1234567890 
wpa_cli -p/var/run/wpa_supplicant set_network 0 wep_tx_keyidx 0 
wpa_cli -p/var/run/wpa_supplicant set_network 0 frequency 2412 
wpa_cli -p/var/run/wpa_supplicant select_network 0 

WEP104

wpa_cli -p/var/run/wpa_supplicant scan 
wpa_cli -p/var/run/wpa_supplicant scan_results 
wpa_cli -p/var/run/wpa_supplicant remove_network 0 
wpa_cli -p/var/run/wpa_supplicant ap_scan 2 
wpa_cli -p/var/run/wpa_supplicant add_network 
wpa_cli -p/var/run/wpa_supplicant set_network 0 ssid '"Adhoc_test"' 
wpa_cli -p/var/run/wpa_supplicant set_network 0 mode 1 
wpa_cli -p/var/run/wpa_supplicant set_network 0 key_mgmt NONE 
wpa_cli -p/var/run/wpa_supplicant set_network 0 wep_key0 12345678901234567890123456 
wpa_cli -p/var/run/wpa_supplicant set_network 0 wep_tx_keyidx 0 
wpa_cli -p/var/run/wpa_supplicant set_network 0 frequency 2412 
wpa_cli -p/var/run/wpa_supplicant select_network 0

Save the Current Connection AP configuration

wpa_cli -p/var/run/wpa_supplicant save_config

WPS Connection

Push Button

wpa_cli -p/var/run/wpa_supplicant remove_network 0 
wpa_cli -p/var/run/wpa_supplicant wps_pbc any 

Pin Code

wpa_cli -p/var/run/wpa_supplicant remove_network 0 
wpa_cli -p/var/run/wpa_supplicant wps_pin any 12345670 
or 
wpa_cli -p/var/run/wpa_supplicant remove_network 0 
wpa_cli -p/var/run/wpa_supplicant wps_pin any 

Get Current Status of wpa_supplicant

wpa_cli -p/var/run/wpa_supplicant status 

Disable current network connection

wpa_cli -p/var/run/wpa_supplicant disable_network 0

WPA_SUPPLICANT + WPA_CLI - Control interface commands

Following commands can be used with wpa_cli

PING

This command can be used to test whether wpa_supplicant is replying to the control interface commands. The expected reply is PING if the connection is open and wpa_supplicant is processing commands.

STATUS

Request current status information. The output is a text block with each line in variable=value format. For example:

bssid=02:00:01:02:03:04

ssid=test network

pairwise_cipher=CCMP

group_cipher=CCMP

key_mgmt=WPA-PSK

wpa_state=COMPLETED

LIST_NETWORKS

List configured networks.

network id / ssid / bssid / flags

0 example network any [CURRENT]

(note: fields are separated with tabs)

SCAN

Request a new BSS scan.

SCAN_RESULTS

Get the latest scan results.

bssid / frequency / signal level / flags / ssid

00:09:5b:95:e0:4e 2412 208 [WPA-PSK-CCMP] jkm private

02:55:24:33:77:a3 2462 187 [WPA-PSK-TKIP] testing

00:09:5b:95:e0:4f 2412 209 jkm guest

(note: fields are separated with tabs)

ADD_NETWORK

Add a new network. This command creates a new network with empty configuration. The new network is disabled and once it has been configured it can be enabled with ENABLE_NETWORK command. ADD_NETWORK returns the network id of the new network or FAIL on failure

SELECT_NETWORK <network_id>

Select a network (disable others). Network id can be received from the LIST_NETWORKS command output.

ENABLE_NETWORK <network_id>

Enable a network. Network id can be received from the LIST_NETWORKS command output.

DISABLE_NETWORK <network_id>

Disable a network. Network id can be received from the LIST_NETWORKS command output. Special network id all can be used to disable all network. .

REMOVE_NETWORK <network_id>

Remove a network. Network id can be received from the LIST_NETWORKS command output. Special network id all can be used to remove all network.

SET_NETWORK <network_id> <variable> <value>

Set network variables. Network id can be received from the LIST_NETWORKS command output. This command uses the same variables and data formats as the configuration file.

• ssid (network name, SSID)

• psk (WPA passphrase or pre-shared key)

• key_mgmt (key management protocol, NONE, WPA-PSK, WPA-EAP)

• proto ( WPA WPA2)

• pairwise ( CCMP TKIP)

• group ( CCMP TKIP WEP40 WEP104)

• wep_key0 ( set wep key for key index 0)

• wep_tx_keyidx ( select wep key index)

• frequency ( Channel frequency in megahertz (MHz) for IBSS )

GET_NETWORK <network_id> <variable>

Get network variables. Network id can be received from the LIST_NETWORKS command output.

SAVE_CONFIG

Save the current configuration.

AP_SCAN <ap_scan_value>

Change ap_scan value: 0 = no scanning, 1 = wpa_supplicant requests scans and uses scan results to select the AP, 2 = wpa_supplicant does not use scanning and just requests driver to associate and take care of AP selection

参考Realtek官方说明文档文章来源地址https://www.toymoban.com/news/detail-644478.html

到了这里,关于[Realtek] WPA_SUPPLICANT + WPA_CLI使用指南的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • 【MTK平台】【wpa_supplicant】关于wpa_supplicant_8/src/p2p/p2p_go_neg.c文件的介绍

    本文主要介绍external/wpa_supplicant_8/src/p2p/p2p_go_neg.c文件  这里主要介绍2个方法 1. p2p_connect_send接受来自 p2p.c 文件中调用p2p_connect方法发送的GON Request帧 2. p2p_process_go_neg_resp处理来自GON Response帧的处理流程 先看下p2p_connect_send方法

    2024年02月14日
    浏览(57)
  • Linux|centos7操作系统|无线WiFi的命令行配置---wpa_supplicant详解

    Linux系统下,可以配置无线网卡的工具和方法有很多,比如,nmcli,iw,wap_supplicant,hostapd 或者直接安装桌面,图形化配置等等 这些工具比较多,但基本都是一个共同的流程:先利用工具扫描到AP,然后设置无线网卡的连接方式,最后无线网卡连接无线路由,完成WiFi连接 那么

    2024年01月23日
    浏览(64)
  • Wifi 认证,关联,四次握手(WPA/WPA2/WPA3-SAE)

    WPA3-SAE也是针对四次握手的协议。 四次握手是 AP (authenticator) 和 (supplicant)进行四次信息交互,生成一个用于加密无线数据的秘钥。 这个过程发生在 WIFI 连接 的 过程。 为了更好的阐述 WPA3-SAE 的作用 和 凸显其优点。我们需要借助 WPA2-psk 来做对比。 先来简单阐述一下

    2023年04月10日
    浏览(37)
  • Wlan安全——认证与加密方式(WPA/WPA2)

    目录 终端认证技术 WEP认证 PSK认证 802.1x认证与MAC认证 Portal认证 数据加密技术 WEP加密 TKIP加密 CCMP加密 TKIP和CCMP生成密钥所需要的密钥信息 802.11安全标准 WEP共享密钥认证、加密工作原理 WEP共享密钥认证 WEP加解密过程 PSK认证以及生成动态密钥的工作原理 802.1x认证以及生成动

    2024年02月12日
    浏览(29)
  • 深度理解 RGMII (包含Linux和realtek)

    目录 RGMII的工作范围 RGMII不同带宽下的波形 RGMII有主从模式吗? Linux中Link up和RGMII的什么有关?

    2023年04月20日
    浏览(31)
  • 卸载了Realtek Audio,扬声器没有声音

    1,打开电脑的设备管理器,如下图查看Realtek(R) Audio是否运转正常: 2,打开控制面板中的声音,查看设备,若没有显示扬声器,说明此驱动已损坏: 1.打开这个网址:https://www.ludashi.com/,安装鲁大师,1分钟左右装完; 2.打开鲁大师,驱动检测,发现问题会有提示驱动安装

    2024年02月12日
    浏览(57)
  • realtek高清晰音频管理器没有声音设置?

    realtek高清晰音频管理器没有声音设置怎么解决?最近有用户询问这个问题,在使用电脑的时候遇到了realtek高清晰音频管理器没声音的情况,耳机和外放都没声音这是怎么回事呢?就此,本篇带来了详细的解决方法啦。 realtek高清晰音频管理器没有声音设置方法: 1、首先点击

    2024年02月12日
    浏览(69)
  • 从WiFI渗透攻击到WPA3

      WiFi从发明到现在已经融入到生活的每个方面,在这个互联网发达的时代,无线网络遍布每个角落。而提供给人们方便的同时也隐藏着安全问题,我们通过了解WLAN的一种技术———Wi-Fi(Wireless-Fidelity),测试其中存在的安全问题,同时也解决WiFi的隐藏问题。 提示:以下

    2024年02月05日
    浏览(36)
  • 腾达无线路由器的WPA加密功能详解

        一、无线局域网的安全技术涉及到很多的领域,那么我们要怎样去面对WPA技术和WEP技术呢?这里就详细的说明一下,对于加密,WPA技术使用临时密钥完整性协议的加密是必选项,TKIP使用了一个新的加密算法取代了WEP,比WEP的加密算法更强壮,同时还能使用现有的无线硬件

    2024年02月05日
    浏览(46)
  • Linux 系统下安装 Realtek 8852BE 网卡驱动

    联想小新Pro16无线网卡是realtek8852,可能是因为这个网卡不够成熟没有进linux内核。 安装时需要联网,可以用手机连USB线给电脑提供网络 查看网卡型号 检查内核版本 不同的linux内核版本可能对网卡驱动要求不一样 首先得查找内核版本 在终端输入: unname 可用来获取操作系统的

    2024年02月06日
    浏览(120)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包