Ubuntu14.04上安装CSI tool
本文目的
记录在Ubuntu14.04系统上安装CSI tool的过程。低版本Ubuntu系统上安装CSI tool推荐清华软件学院wifiradar项目附带的“CSI工具安装说明”。
本文安装的软件
CSI tool是华盛顿大学版本,作者dhalperi,
源码链接https://github.com/dhalperi/linux-80211n-csitool/
安装过程
依据其个人主页的 安装指导手册
具体步骤:
1安装必要的工具
sudo apt-get install gcc make linux-headers-$(uname -r) git-core
sudo apt-get install iw
echo iface wlan0 inet manual | sudo tee -a /etc/network/interfaces
sudo restart network-manager
echo blacklist iwldvm | sudo tee -a /etc/modprobe.d/csitool.conf
echo blacklist iwlwifi | sudo tee -a /etc/modprobe.d/csitool.conf
2创建和安装新的驱动
CSITOOL_KERNEL_TAG=csitool-$(uname -r | cut -d . -f 1-2)
git clone https://github.com/dhalperi/linux-80211n-csitool.git
cd linux-80211n-csitool
git checkout ${CSITOOL_KERNEL_TAG}
UBUNTU_KERNEL_TAG=Ubuntu-3.13.0-32.57
注意:正确选择Ubuntu系统的内核版本标签,标签查询链接为http://people.canonical.com/~kernel/info/kernel-version-map.html
. /etc/lsb-release
git remote add ubuntu \
git://kernel.ubuntu.com/ubuntu/ubuntu-${DISTRIB_CODENAME}.git
git pull --no-edit ubuntu ${UBUNTU_KERNEL_TAG}
make -C /lib/modules/$(uname -r)/build \
M=$(pwd)/drivers/net/wireless/iwlwifi modules
sudo make -C /lib/modules/$(uname -r)/build \
M=$(pwd)/drivers/net/wireless/iwlwifi \
INSTALL_MOD_DIR=updates modules_install
sudo depmod
cd ..
3安装新的固件
git clone \
https://github.com/dhalperi/linux-80211n-csitool-supplementary.git
for file in /lib/firmware/iwlwifi-5000-*.ucode; do sudo mv $file $file.orig; done
sudo cp linux-80211n-csitool-supplementary/firmware/iwlwifi-5000-2.ucode.sigcomm2010 /lib/firmware/
sudo ln -s iwlwifi-5000-2.ucode.sigcomm2010 /lib/firmware/iwlwifi-5000-2.ucode
4创建Logging程序
make -C linux-80211n-csitool-supplementary/netlink
5更新无线网卡模块
sudo modprobe -r iwlwifi mac80211
sudo modprobe iwlwifi connector_log=0x1
注意:每次reboot系统后需要重新执行
6命令行启动无线网卡
sudo ip link set wlan0 up
7探测AP、连接非加密AP、分配地址
sudo iw dev wlan0 scan
sudo iw wlan0 connect -w xxxx
sudo dhclient wlan0
8启动捕获程序
sudo linux-80211n-csitool-supplementary/netlink/log_to_file csi.dat
注意:csi.dat should not be empty if AP工作在HT模式