首页 > 学院 > 开发设计 > 正文

linux-80211n-csitool安装方法

2019-11-06 09:17:06
字体:
来源:转载
供稿:网友

linux-80211n-csitool安装方法

csitool是一个运行在Linux平台上的方便获取CSI信息的工具,仅支持Intel 5300无线网卡,淘宝上50¥以下就可以买到,插在台式机主板PCI-e插槽上,就可以使用了。


官网的安装方法有两个版本: 1. old Installation Instructions http://dhalperi.github.io/linux-80211n-csitool/old_installation.html 2. Installation Instructions http://dhalperi.github.io/linux-80211n-csitool/installation.html 较为麻烦。 清华大学Wifi Radar团队将old Installation Instructions进行了整理,在Ubuntu下可以进行一键式安装,简单有效,推荐大家使用此方法进行安装。 csi_tool软件包及安装说明下载: http://pan.baidu.com/s/1dDhFuNJ#list/path=%2F

在高版本的Ubuntu系统上安装会出现一些问题,为保证兼容性,我采用了Ubuntu 11.04 32位系统(64位系统安装未成功)。

按照此方法,很容易就可以安装成功。


CSI_TOOL支持四种工作模式:

Client mode: The packet is transmitted by the connected AP, and the destination is either the local address or broadcast.

AP mode: The packet is transmitted by a connected client.

IBSS (ad-hoc) mode: The packet is transmitted by another station in the connected IBSS, and the destination is either the local address or broadcast.

Monitor mode: The packet is addressed both to and from a hardcoded, fixed address 00:16:ea:12:34:56. 详情可参考官方FAQ: http://dhalperi.github.io/linux-80211n-csitool/faq.html

本人重点使用了Monitor模式,根据官方说明:https://github.com/dhalperi/linux-80211n-csitool-supplementary/tree/master/injection

需要首先按照LORCON(是一个开源的对于无线数据包进行注入的玩意儿),以下对官方说明做出解释。 (1)sudo apt-get install libpcap-dev (2)git clone https://github.com/dhalperi/lorcon-old.git (3)cd lorcon-old ./configure make sudo make install

monitor模式至少需要两台电脑(一个发送,一个接受)。monitor mode 的脚本在linux-80211n-csitool-supplementary/injection 目录下,首次访问需要编译一下: make

(1)接收端: ./setup_monitor_csi.sh 64 HT20 sudo ../netlink/log_to_file log.dat

64指信道编号,可通过iwlist channel命令查看有哪些信道。 (2)发送端: ./setup_inject.sh 64 HT20 echo 0x4101 | sudo tee `sudo find /sys -name monitor_tx_rate` sudo ./random_packets 1 100 1

第二个命令为发送速率的选择(不可少)。 每一位的含义 第三个命令为发送包,第一个参数为包的数量,第二个参数为包的大小,第三个参数为模式选择,设为1即可,还可设置第四个参数:发送时间间隔,单位为us.

注意:经测试,包里面的脚本setup_inject.sh有问题,参考其他人的方案后,修改为:#!/usr/bin/sudo /bin/bash sudo modPRobe -r iwlwifi mac80211 modprobe -r iwlwifi mac80211 cfg80211 modprobe iwlwifi debug=0x40000 if [ "$#" -ne 2 ]; then echo "Going to use default settings!" chn=64 bw=HT20 else chn=$1 bw=$2 fi ifconfig wlan0 2>/dev/null 1>/dev/null while [ $? -ne 0 ] do ifconfig wlan0 2>/dev/null 1>/dev/null done iw dev wlan0 interface add mon0 type monitor ifconfig wlan0 down while [ $? -ne 0 ] do ifconfig wlan0 down done ifconfig mon0 up while [ $? -ne 0 ] do ifconfig mon0 up done iw mon0 set channel $chn $bw 现在即可得到csi数据了,csi数据需要经过matlab处理。在linux-80211n-csitool-supplementary/matlab下面有matlab的代码。可以读出csi信息。
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表