安装osmocom
参考:http://drops.wooyun.org/tips/723
http://www.creturn.com/radiowar-%E4%B9%8Bosmocombb-sms-sniffer
[size=x-large][b]简介[/b][/size]
osmocom是GSM协议栈(Protocols stack)的开源实现,全称是Open source mobile communication Baseband。目的是要实现手机端从物理层(layer1)到layer3的三层实现。
[size=x-large][b]环境[/b][/size]
基本kali linux,安装过程见上篇
[size=x-large][b]安装依赖[/b][/size]
sudo apt-get install libtool shtool autoconf git-core pkg-config make gcc build-essential libgmp3-dev libmpfr-dev libx11-6 libx11-dev texinfo flex bison libncurses5 libncurses5-dbg libncurses5-dev libncursesw5 libncursesw5-dbg libncursesw5-dev zlibc zlib1g-dev libmpfr4 libmpc-dev
[size=x-large][b]安装交叉编译环境[/b][/size]
参考:http://bb.osmocom.org/trac/wiki/GnuArmToolchain
[*]交叉编译环境的依赖
sudo apt-get install build-essential libgmp3-dev libmpfr-dev libx11-6 libx11-dev texinfo flex bison libncurses5 libncurses5-dbg libncurses5-dev libncursesw5 libncursesw5-dbg libncursesw5-dev zlibc zlib1g-dev libmpfr4 libmpc-dev
[*]创建文件夹
mkdir ~/lib/gnuarm
cd ~/lib/gnuarm
mkdir build install src
[*]下载build脚本
wget http://bb.osmocom.org/trac/raw-attachment/wiki/GnuArmToolchain/gnu-arm-build.2.sh
chmod +x gnu-arm-build.2.sh
[*]下载相关源代码
cd src/
wget http://ftp.gnu.org/gnu/gcc/gcc-4.5.2/gcc-4.5.2.tar.bz2
wget http://ftp.gnu.org/gnu/binutils/binutils-2.21.1a.tar.bz2
wget ftp://sources.redhat.com/pub/newlib/newlib-1.19.0.tar.gz
[*]开始build
这一步非常耗时,一边去看个电影吧
cd ..
./gnu-arm-build.2.sh
[*]设置环境变量
~/.bashrc 添加一行
$vi ~/.bashrc
# 添加下面这一行,记得替换用户名
export PATH=$PATH:/home/${username}/lib/gnuarm/install/bin
$source ~/.bashrc
没有设置此环境变量的情况下,编译osmocombb的时候会遇到以下错误
[quote]
src/target/firmware/include/asm/swab.h:32: Error: no such instruction: `eor %edx,%ecx,%ecx,ror'
[/quote]
[size=x-large][b]安装osmocombb、libosmocore[/b][/size]
[*]下载源码
cd ~
git clone git://git.osmocom.org/osmocom-bb.git
git clone git://git.osmocom.org/libosmocore.git
[*]编译 libosmocore
cd ~/libosmocore
autoreconf -i
./configure
make
sudo make install
sudo /sbin/ldconfig
[*]编译osmocombb
cd ~/osmocom-bb
git checkout --track origin/luca/gsmmap
cd src
make
第一次编译的时候遇到以下错误,原因是最初没有设置gcc交叉编译环境,后来设置交叉编译环境的时候移动了gnuarm的位置,导致的错误,严格按照以上步骤执行即可。
[quote]
报错:没有规则可以创建“apps/hello_world/main.o”需要的目标“/home/${username}/gnuarm/bin/../lib/gcc/arm-elf/3.4.3/../../../../arm-elf/sys-include/sys/types.h” 停止。
[/quote]
finally, done~