LSX-blog

Feed Rss

【原创】OsmocomBB 之SMS Sniffer

11.27.2013, DIY, Linux, by .

本文大部分是按照官方的步骤直接经过试验并总结的 http://bb.osmocom.org/trac/wiki/Software/GettingStarted

必备的条件

  • 简单的英文阅读能力
  • linux环境 最好是apt-get 包管理方式的(像KaliUbuntuDebian、ArchLinux)在虚拟机中运行和物理机都没有关系,推荐ubuntu 12.04 X64位,记得使用64位,这样你可以使用我编译好的精简包,就可以不用下面的长时间编译了。
  • 交叉编译环境(具体是什么可以问度娘)
  • 手机C118 或者 C139
  • CP2102模块一个
  • 耳机插头一个

    安装相关环境

    一、安装依赖包

    1
    
    sudo apt-get -y install libtool shtool autoconf git-core pkg-config make gcc

    二、安装libosmocore源码包

     

    1
    2
    3
    4
    5
    6
    7
    8
    9
    
    $ cd /opt
    $ git clone git://git.osmocom.org/libosmocore.git
    $ cd libosmocore/ 
    $ autoreconf -i 
    $ ./configure 
    $ make 
    $ sudo make install
    $ ldconfig
    $ cd ..

    以上步骤完成后,如果你不想进行下面复杂的编译步骤可以下载编译好的精简版本,但请注意这个只适应64位

    三、精简版本使用(使用精简版本不需要再执行四五步骤)

    osmocom-bb.tar.gz

    下载好,直接传到你机器上面的/opt目录解压,直接使用后可以看后面的章节 补充内容后面的内容了

    四、安装交叉编译环境

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    
    $ cd /opt
    $ mkdir GnuArmToolchain
    $ cd GnuArmToolchain
    $ wget http://bb.osmocom.org/trac/raw-attachment/wiki/\
    GnuArmToolchain/gnu-arm-build.2.sh
    $ chmod +x gnu-arm-build.2.sh
    $ sudo apt-get -y 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 build install src
    $ 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
    $ cd ..
    $ ./gnu-arm-build.2.sh 
    I will build an arm-elf cross-compiler:
     
      Prefix: /install
      Sources: /src
      Build files: /build
     
    Press ^C now if you do NOT want to do this.

    按任意键编译 完成之后添加以下环境变量到~/.bashrc

     

    1
    
    export PATH=$PATH:/opt/GnuArmToolchain/install/bin

    如果你是ubuntu 直接执行如下命令后重起

    1
    
    sudo bash -c 'echo "export PATH=$PATH:/opt/GnuArmToolchain/install/bin" > /etc/bash.bashrc'

    五、安装osmocom-bb

    如果你准备打上255错误补丁请看http://blog.lishixin.net/archives/1393这个文章

    并在git checkout –track origin/luca/gsmmap这一步后面,用文章中的补丁文件覆盖同

    名文件即可,解决在运行中经常出现255的错误,当然这一步并不是必须的

    1
    2
    3
    4
    5
    6
    
    $ cd /opt
    $ git clone git://git.osmocom.org/osmocom-bb.git
    $ cd osmocom-bb
    $ git checkout --track origin/luca/gsmmap
    $ cd src  
    $ make

    补充内容(只做参照,无需操作)

    摘自:http://www.blogjava.net/baicker/archive/2013/11/13/406293.html ######################################################### 另:Sylvain/burst_ind分支是网上说的比较多的带sniffer功能的分支,但是编译完无法刷固件,需要修改osmocom-bb/src/host/osmocon/osmocon.c,文件中添加定义 #define I_HAVE_A_CP210x 否则会出现“Unable to set custom baudrate, please use appropriate cable”,即使这里通过了我刷了还是不行。 ok,我们使用luca/gsmmap分支, GsmMap项目使用osmocom-bb项目所支持的手机通过捕捉GSM数据,对应地理位置;然后用户上传后被分析,结果会被展示在项目主页上的地图上。 该项目的主要目标是建立GSM网络的地理分布,然后分析 伪造,拦截和跟踪的可能性,会在官网上披露GSM的安全性。 官方提供一个自己的LiveCD,基于Debian,木有xWindow,参加项目的可以傻瓜化的使用并且抓包,用VirtualBOX或者VMware载入,开机后记得把osmocom-bb所用的C1**系列手机和数据线连到虚拟机,然后按照提示输入gsm即可开始。 默认编译出的版本发送信号相关的功能是被注释掉的,用mobile启动layer23后会一直于搜信号的过程中,因为无法发送信号。 如果需要进行实网测试需要打开src/target/firmware/Makefile文件中的编译开关 把osmocom-bb/src/target/firmwire/下的Makefile中的 CONFIG_TX_ENABLE宏打开: # Uncomment this line if you want to enable Tx (Transmit) Support. -#CFLAGS +=-DCONFIG_TX_ENABLE +CFLAGS +=-DCONFIG_TX_ENABLE 然后到src目录下编译 cd src make layer1和src/host/layer23/src/mobile/mobile程序,实现了从layer1到layer3的功能,我们主要用layer1,rssi是用来测试信号的,不同的信道信号强度等等一些相关信息,需要配合chainload或loader刷入,这几个应用详细说明在这里:http://bb.osmocom.org/trac/wiki/Applications image #########################################################

    六、模块连接

    QQ截图20140112204320

    经过上面几步,固件及程序以前躺在那里等着你了,下面就是使用它们了 第一步,将CP2102模块插入电脑USB  如果你是虚拟机请看如下图 image 这个是把模块连接到虚拟机中 登陆linux操作系统运行如下命令

    1
    
    $ lsusb

    出现如下图,说明连接成功 image 第二步,刷固件

     

    1
    
    $ cd /opt/osmocom-bb/src/host/osmocon/

    然后再点击开机键,记得是点击,不是开机,像点鼠标那样

     

    1
    2
    
    $ ./osmocon -m c123xor -p /dev/ttyUSB0 ../../target/firmware/board/\
    compal_e88/layer1.compalram.bin

    如果你已经硬刷了C118,直接运行以下命令既可,然后再点击开机键,记得是点击,不是开机,像点鼠标那样

    1
    
    $ ./osmocon

    输出如下结果 image 说明成功刷入 另看一个窗口打描基站信号(注意参数是大写的字母O(欧))

    1
    2
    
    $ cd /opt/osmocom-bb/src/host/layer23/src/misc
    $ ./cell_log -O

    出现下图后,找一个PWR绝对值在75以下的,绝对值越低表明信号越强,为下一步ccch_scan -a的参数做准备 1 找个ARFCN通道 ccch_scan扫描

    1
    
    $ ./ccch_scan -i 127.0.0.1 -a 110

    出现下图表明运行正常可能还会有红色字符产生,屏幕有源源不断的数据滚动表示正常 2 再打开一窗口运行

    1
    
    wireshark -k -i lo -f 'port 4729'

    image uplink只有换过芯片的才可以抓取到 

【原创】OsmocomBB 之SMS Sniffer 有 96 条回应

  1. Hi to all, how is everything, I think every one is getting more from this website, and your views are fastidious for new viewers.| а

    回复
  2. It’s hard to come by educated people in this particular topic, but you seem like you know what you’re talking about! Thanks| а

    回复
  3. Hello there, just became alert to your blog through Google, and found that it’s truly informative. I am gonna watch out for brussels. I will appreciate if you continue this in future. Many people will be benefited from your writing. Cheers!| а

    回复
  4. Hi there everyone, it’s my first visit at this web page, and paragraph is actually fruitful designed for me, keep up posting these types of articles.| а

    回复
  5. What’s up everyone, it’s my first visit at this web page, and post is actually fruitful designed for me, keep up posting these types of content.| а

    回复
  6. Please let me know if you’re looking for a author for your site. You have some really great posts and I think I would be a good asset. If you ever want to take some of the load off, I’d absolutely love to write some content for your blog in exchange for a link back to mine. Please shoot me an email if interested. Cheers!| а

    回复
  7. I’m truly enjoying the design and layout of your website. It’s a very easy on the eyes which makes it much more pleasant for me to come here and visit more often. Did you hire out a developer to create your theme? Exceptional work!| а

    回复
  8. It is not my first time to pay a visit this website, i am visiting this web site dailly and take pleasant information from here everyday.| а

    回复
  9. Today, I went to the beachfront with my kids. I found a sea shell and gave it to my 4 year old daughter and said “You can hear the ocean if you put this to your ear.” She placed the shell to her ear and screamed. There was a hermit crab inside and it pinched her ear. She never wants to go back! LoL I know this is entirely off topic but I had to tell someone!| а

    回复
  10. I do not even know the way I stopped up here, but I believed this publish was once good. I do not realize who you might be however definitely you are going to a famous blogger if you are not already. Cheers!| а

    回复
  11. Hi, i feel that i noticed you visited my site thus i came to go back the prefer?.I’m attempting to to find issues to improve my web site!I suppose its adequate to use some of your concepts!!| а

    回复
  12. Hi there to every one, it’s genuinely a nice for me to pay a quick visit this website, it contains valuable Information.| а

    回复
  13. You really make it appear really easy along with your presentation but I find this topic to be actually one thing which I think I’d never understand. It sort of feels too complicated and extremely huge for me. I am having a look ahead in your next put up, I will attempt to get the dangle of it!| а

    回复
  14. Hello there, I discovered your web site by means of Google whilst searching for a similar topic, your website came up, it appears good. I’ve bookmarked it in my google bookmarks. а

    回复
  15. I got this web site from my pal who told me concerning this web site and at the moment this time I am visiting this website and reading very informative articles here.| а

    回复
  16. Thank you for the auspicious writeup. It in fact was a amusement account it. Look advanced to far added agreeable from you! However, how could we communicate?| а

    回复
  17. Excellent weblog right here! Also your website loads up very fast! What host are you using? Can I get your affiliate hyperlink in your host? I desire my web site loaded up as fast as yours lol| а

    回复
  18. I am extremely impressed with your writing skills as well as with the layout on your blog. Is this a paid theme or did you modify it yourself? Anyway keep up the nice quality writing, it’s rare to see a nice blog like this one these days.| а

    回复
  19. I read this piece of writing fully concerning the comparison of most recent and earlier technologies, it’s remarkable article.| а

    回复
  20. I’m not sure why but this blog is loading extremely slow for me.
    Is anyone else having this problem or is it a problem on my end?
    I’ll check back later on and see if the problem still exists.

    回复
  21. Hey there! Do you know if they make any plugins to assist
    with Search Engine Optimization? I’m trying
    to get my blog to rank for some targeted keywords but I’m not seeing very good
    gains. If you know of any please share. Cheers!

    回复
  22. Hi excellent website! Does running a blog similar to this take a massive amount work? I’ve absolutely no expertise in programming however I had been hoping to start my own blog in the near future. Anyways, if you have any recommendations or tips for new blog owners please share. I understand this is off subject but I just had to ask. Appreciate it!| а

    回复
  23. Hey! I know this is kinda off topic but I was wondering if you knew where I could get a captcha plugin for
    my comment form? I’m using the same blog platform as yours and
    I’m having trouble finding one? Thanks a lot!

    回复
  24. Excellent article! We will be linking to this great article on our website. Keep up the great writing.| а

    回复
  25. I am now not certain the place you are getting your info, however good topic. I needs to spend a while learning more or working out more. Thank you for great information I used to be looking for this information for my mission.| а

    回复
  26. Hey there I am so grateful I found your site, I really found you by error, while I was looking on Askjeeve for something else, Anyhow I am here now and would just like to say many thanks for a remarkable post and a all round thrilling blog (I also love the theme/design), I don’t have time to look over it all at the minute but I have bookmarked it and also added your RSS feeds, so when I have time I will be back to read more, Please do keep up the fantastic work.| а

    回复
  27. If some one wishes to be updated with latest technologies after that he must be go to see this site and be up to date daily.| а

    回复
  28. Very good info. Lucky me I discovered your website by accident (stumbleupon). I have bookmarked it for later!| а

    回复
  29. Hey there! I could have sworn I’ve been to this site before but after browsing through some of the post I realized it’s new to me. Anyways, I’m definitely delighted I found it and I’ll be bookmarking and checking back often!| а

    回复
  30. Nice post. I was checking continuously this blog and I’m impressed!
    Extremely helpful info particularly the last part 🙂 I care for such information much.
    I was looking for this certain information for a long time.
    Thank you and best of luck.

    回复
  31. If some one desires expert view concerning running a blog after that i suggest him/her to pay a visit this weblog, Keep up the pleasant work.| а

    回复
  32. I’d like to find out more? I’d love to find out more details.| а

    回复
  33. I read this piece of writing completely about the difference of latest and preceding technologies, it’s amazing article.| а

    回复
  34. You really make it seem so easy with your presentation but I find this topic to be really something that I think I would never understand. It seems too complex and extremely broad for me. I am looking forward for your next post, I will try to get the hang of it!| а

    回复
  35. It’s very straightforward to find out any topic on net as compaed to books, as I found
    this piece of writing at this web site.

    回复
  36. I absolutely love your blog and find a lot of your post’s to be just what I’m looking for. Do you offer guest writers to write content available for you? I wouldn’t mind composing a post or elaborating on a lot of the subjects you write concerning here. Again, awesome web log!| а

    回复
  37. Please let me know if you’re looking for a author for your blog.
    You have some really good articles and I believe I would be a
    good asset. If you ever want to take some of
    the load off, I’d really like to write some material for your blog in exchange for a link back to mine.
    Please send me an e-mail if interested. Regards!

    回复

番薯大师进行回复 取消回复

电子邮件地址不会被公开。 必填项已用*标注