(一百七十七) WiFi如何分辨出不同加密方式的AP?(续)

2023-12-19 07:32

本文主要是介绍(一百七十七) WiFi如何分辨出不同加密方式的AP?(续),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

前言:之前https://blog.csdn.net/sinat_20059415/article/details/99686537 看WiFi如何分辨出不同加密方式的AP? 中提到“加密方式大概是从扫描结果中的ie解析出来放在一个叫做capabilities里的,后续上面判断加密方式就简单判断下是否包含特定加密方式的字符串就好了。”抓个包看下

 

1.probe request & response

用wireshark看下有啥

1.1 arrival time

1.2 radio informatin

1.3 probe response

主要显示了mac地址

1.4 wireless LAN

可以看到至少有ssid channel和加密方式

这个psk应该也是wireshark根据特定字段解析出来的,结合之前的梳理代码看下

        // RSNE format (size unit: byte)//// | Element ID | Length | Version | Group Data Cipher Suite |//      1           1         2                 4// | Pairwise Cipher Suite Count | Pairwise Cipher Suite List |//              2                            4 * m// | AKM Suite Count | AKM Suite List | RSN Capabilities |//          2               4 * n               2// | PMKID Count | PMKID List | Group Management Cipher Suite |//        2          16 * s                 4//// Note: InformationElement.bytes has 'Element ID' and 'Length'//       stripped off alreadyprivate void parseRsnElement(InformationElement ie) {ByteBuffer buf = ByteBuffer.wrap(ie.bytes).order(ByteOrder.LITTLE_ENDIAN);try {// versionif (buf.getShort() != RSNE_VERSION) {// incorrect versionreturn;}// found the RSNE IE, hence start building the capability stringprotocol.add(ScanResult.PROTOCOL_WPA2);// group data cipher suitegroupCipher.add(parseRsnCipher(buf.getInt()));// pairwise cipher suite countshort cipherCount = buf.getShort();ArrayList<Integer> rsnPairwiseCipher = new ArrayList<>();// pairwise cipher suite listfor (int i = 0; i < cipherCount; i++) {rsnPairwiseCipher.add(parseRsnCipher(buf.getInt()));}pairwiseCipher.add(rsnPairwiseCipher);// AKM// AKM suite countshort akmCount = buf.getShort();ArrayList<Integer> rsnKeyManagement = new ArrayList<>();for (int i = 0; i < akmCount; i++) {int akm = buf.getInt();switch (akm) {case WPA2_AKM_EAP:rsnKeyManagement.add(ScanResult.KEY_MGMT_EAP);break;case WPA2_AKM_PSK:rsnKeyManagement.add(ScanResult.KEY_MGMT_PSK);break;case WPA2_AKM_FT_EAP:rsnKeyManagement.add(ScanResult.KEY_MGMT_FT_EAP);break;case WPA2_AKM_FT_PSK:rsnKeyManagement.add(ScanResult.KEY_MGMT_FT_PSK);break;case WPA2_AKM_EAP_SHA256:rsnKeyManagement.add(ScanResult.KEY_MGMT_EAP_SHA256);break;case WPA2_AKM_PSK_SHA256:rsnKeyManagement.add(ScanResult.KEY_MGMT_PSK_SHA256);break;default:// do nothingbreak;}}// Default AKMif (rsnKeyManagement.isEmpty()) {rsnKeyManagement.add(ScanResult.KEY_MGMT_EAP);}keyManagement.add(rsnKeyManagement);} catch (BufferUnderflowException e) {Log.e("IE_Capabilities", "Couldn't parse RSNE, buffer underflow");}}

这边是解析的一个

与报文对应

是反过来的

  OUI:OUI认证应该是对应的wpa2

结合起来就是wpa2_psk的加密方式

 

 

2.beacon

待续,没抓到。。。尴尬

 

3.过滤器转载

https://my.oschina.net/665544/blog/1647001

 

帧类型

过滤器语法

Management frame

wlan.fc.type == 0

Control frame

wlan.fc.type == 1

Data frame

wlan.fc.type == 2

Association request

wlan.fc.type_subtype == 0x00

Association response

wlan.fc.type_subtype == 0x01

Reassociation request

wlan.fc.type_subtype == 0x02

Reassociation response

wlan.fc.type_subtype == 0x03

Probe request

wlan.fc.type_subtype == 0x04

Probe response

wlan.fc.type_subtype == 0x05

Beacon

wlan.fc.type_subtype == 0x08

Disassociate

wlan.fc.type_subtype == 0x0A

Authentication

wlan.fc.type_subtype == 0x0B

Deauthentication

wlan.fc.type_subtype == 0x0C

Action frame

wlan.fc.type_subtype == 0x0D

Block ACK requests

wlan.fc.type_subtype == 0x18

Block ACK

wlan.fc.type_subtype == 0x19

Power save poll

wlan.fc.type_subtype == 0x1A

Request to send

wlan.fc.type_subtype == 0x1B

Clear to send

wlan.fc.type_subtype == 0x1C

ACK

wlan.fc.type_subtype == 0x1D

Contention free period end

wlan.fc.type_subtype == 0x1E

NULL data

wlan.fc.type_subtype == 0x24

QoS data

wlan.fc.type_subtype == 0x28

Null QoS data

wlan.fc.type_subtype == 0x2C

 

4.总结

与之前总结基本一致,加密方式其实就是从datagram的特定字段解析出来的,结合抓包可以定位是解析的

RSN Information的AKM字段,里面包含认证和类型两个小字段,比如wpa2+psk

 

PS:

The RSN information element was brought out by the IEEE 802.11i Task Group. RSN stands for Robust Security Network and it made AES cipher mandatory with the use of Robust Security Network.

高级加密标准(Advanced Encryption Standard: AES)

IEEE 802.11i引入了RSN信息元素。RSN表示强健安全网络,它使用健壮安全网络和强制AES加密。

这篇关于(一百七十七) WiFi如何分辨出不同加密方式的AP?(续)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/511370

相关文章

python logging模块详解及其日志定时清理方式

《pythonlogging模块详解及其日志定时清理方式》:本文主要介绍pythonlogging模块详解及其日志定时清理方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地... 目录python logging模块及日志定时清理1.创建logger对象2.logging.basicCo

C#TextBox设置提示文本方式(SetHintText)

《C#TextBox设置提示文本方式(SetHintText)》:本文主要介绍C#TextBox设置提示文本方式(SetHintText),具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑... 目录C#TextBox设置提示文本效果展示核心代码总结C#TextBox设置提示文本效果展示核心代

SpringValidation数据校验之约束注解与分组校验方式

《SpringValidation数据校验之约束注解与分组校验方式》本文将深入探讨SpringValidation的核心功能,帮助开发者掌握约束注解的使用技巧和分组校验的高级应用,从而构建更加健壮和可... 目录引言一、Spring Validation基础架构1.1 jsR-380标准与Spring整合1

Android实现打开本地pdf文件的两种方式

《Android实现打开本地pdf文件的两种方式》在现代应用中,PDF格式因其跨平台、稳定性好、展示内容一致等特点,在Android平台上,如何高效地打开本地PDF文件,不仅关系到用户体验,也直接影响... 目录一、项目概述二、相关知识2.1 PDF文件基本概述2.2 android 文件访问与存储权限2.

Java中使用Hutool进行AES加密解密的方法举例

《Java中使用Hutool进行AES加密解密的方法举例》AES是一种对称加密,所谓对称加密就是加密与解密使用的秘钥是一个,下面:本文主要介绍Java中使用Hutool进行AES加密解密的相关资料... 目录前言一、Hutool简介与引入1.1 Hutool简介1.2 引入Hutool二、AES加密解密基础

Spring中配置ContextLoaderListener方式

《Spring中配置ContextLoaderListener方式》:本文主要介绍Spring中配置ContextLoaderListener方式,具有很好的参考价值,希望对大家有所帮助,如有错误... 目录Spring中配置ContextLoaderLishttp://www.chinasem.cntene

AJAX请求上传下载进度监控实现方式

《AJAX请求上传下载进度监控实现方式》在日常Web开发中,AJAX(AsynchronousJavaScriptandXML)被广泛用于异步请求数据,而无需刷新整个页面,:本文主要介绍AJAX请... 目录1. 前言2. 基于XMLHttpRequest的进度监控2.1 基础版文件上传监控2.2 增强版多

Docker镜像修改hosts及dockerfile修改hosts文件的实现方式

《Docker镜像修改hosts及dockerfile修改hosts文件的实现方式》:本文主要介绍Docker镜像修改hosts及dockerfile修改hosts文件的实现方式,具有很好的参考价... 目录docker镜像修改hosts及dockerfile修改hosts文件准备 dockerfile 文

Linux中的计划任务(crontab)使用方式

《Linux中的计划任务(crontab)使用方式》:本文主要介绍Linux中的计划任务(crontab)使用方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录一、前言1、linux的起源与发展2、什么是计划任务(crontab)二、crontab基础1、cro

Win11安装PostgreSQL数据库的两种方式详细步骤

《Win11安装PostgreSQL数据库的两种方式详细步骤》PostgreSQL是备受业界青睐的关系型数据库,尤其是在地理空间和移动领域,:本文主要介绍Win11安装PostgreSQL数据库的... 目录一、exe文件安装 (推荐)下载安装包1. 选择操作系统2. 跳转到EDB(PostgreSQL 的