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 有 212 条回应

  1. Howdy! I could have sworn I’ve visited this blog before but after going through a few of the articles I realized it’s new to me. Anyways, I’m certainly pleased I found it and I’ll be book-marking it and checking back regularly!| а

    回复
  2. This is a topic which is near to my heart… Best wishes! Exactly where are your contact details though?| а

    回复
  3. What a material of un-ambiguity and preserveness of valuable familiarity regarding unpredicted emotions.| а

    回复
  4. Nice weblog right here! Additionally your website quite a bit up very fast! What host are you the usage of? Can I am getting your affiliate link in your host? I want my site loaded up as fast as yours lol| а

    回复
  5. Wow, superb blog layout! How long have you been blogging for? you made blogging look easy. The overall look of your web site is magnificent, let alone the content!| а

    回复
  6. Your method of explaining all in this post is truly pleasant, every one be capable of simply understand it, Thanks a lot.| а

    回复
  7. Just desire to say your article is as astonishing. The clearness in your post is simply cool and i can assume you’re an expert on this subject. Fine with your permission allow me to grab your RSS feed to keep up to date with forthcoming post. Thanks a million and please carry on the gratifying work.| а

    回复
  8. I love what you guys tend to be up too. This kind of clever work and reporting! Keep up the good works guys I’ve added you guys to my own blogroll.| а

    回复
  9. What i do not realize is if truth be told how you are now not really much more well-liked than you may be now. You’re so intelligent. You already know thus considerably in the case of this subject, produced me in my opinion consider it from so many numerous angles. Its like men and women are not fascinated except it is something to do with Lady gaga! Your own stuffs great. Always maintain it up!| а

    回复
  10. This is very interesting, You are a very skilled blogger. I’ve joined your rss feed and look forward to seeking more of your magnificent post. Also, I’ve shared your website in my social networks!| а

    回复
  11. Write more, thats all I have to say. Literally, it seems as though you relied on the video to make your point. You clearly know what youre talking about, why waste your intelligence on just posting videos to your site when you could be giving us something enlightening to read?| а

    回复
  12. I don’t even know how I ended up here, but I thought this post was good. I don’t know who you are but certainly you’re going to a famous blogger if you aren’t already 😉 Cheers!| а

    回复
  13. Wow, marvelous weblog structure! How lengthy have you been running a blog for? you made blogging look easy. The total glance of your website is great, let alone the content material! а

    回复
  14. You actually make it seem so easy with your presentation but I find this topic to be really something which I think I would never understand. It seems too complicated and very broad for me. I’m looking forward for your next post, I’ll try to get the hang of it!| а

    回复
  15. It is not my first time to visit this site, i am browsing this site dailly and get pleasant information from here everyday.| а

    回复
  16. If you desire to increase your familiarity just keep visiting this site and be updated with the hottest news posted here.| а

    回复
  17. Hi there, I do believe your site could be having web browser compatibility problems. When I look at your blog in Safari, it looks fine but when opening in Internet Explorer, it has some overlapping issues. I just wanted to give you a quick heads up! Apart from that, great website!| а

    回复
  18. Fine way of explaining, and nice piece of writing to get facts on the topic of my presentation focus, which i am going to convey in university.| а

    回复
  19. Hi i am kavin, its my first time to commenting anyplace, when i read this paragraph i thought i could also create comment due to this sensible piece of writing.| а

    回复
  20. Greetings! Very helpful advice within this post! It is the little changes that make the largest changes. Many thanks for sharing!| а

    回复
  21. Hurrah, that’s what I was looking for, what a data! present here at this webpage, thanks admin of this web page.| а

    回复
  22. Wow! In the end I got a website from where I be capable of truly take helpful data concerning my study and knowledge.| а

    回复
  23. Thanks for finally writing about Loved it!| а

    回复
  24. Hey there I am so delighted I found your blog, I really found you by error, while I was browsing on Askjeeve for something else, Regardless I am here now and would just like to say thank you for a marvelous post and a all round exciting blog (I also love the theme/design), I don’t have time to read it all at the moment but I have book-marked it and also included your RSS feeds, so when I have time I will be back to read a lot more, Please do keep up the excellent work.| а

    回复
  25. Wonderful article! We will be linking to this particularly great post on our site. Keep up the great writing.| а

    回复
  26. Simply desire to say your article is as amazing. The clearness in your submit is simply cool and i could assume you are knowledgeable on this subject. Fine with your permission let me to clutch your feed to keep up to date with forthcoming post. Thank you a million and please carry on the enjoyable work.| а

    回复
  27. Since the admin of this site is working, no question very rapidly it will be famous, due to its feature contents.| а

    回复
  28. My family members always say that I am wasting my time here at web, except I know I am getting familiarity all the time by reading such nice articles.| а

    回复
  29. Hello Dear, are you genuinely visiting this site on a regular basis, if so then you will absolutely take pleasant knowledge.| а

    回复
  30. What’s up, I want to subscribe for this website to obtain most recent updates, so where can i do it please help out.| а

    回复
  31. It’s awesome to pay a quick visit this website and reading the views of all colleagues concerning this post, while I am also zealous of getting familiarity.| а

    回复
  32. Incredible many of fantastic info. [url=https://buymodafinilntx.com/]modafinil 200mg[/url]

    回复
  33. I pay a quick visit daily some websites and websites to read content, but this weblog gives feature based posts.| а

    回复
  34. Superb tips. Thanks a lot. [url=https://viagrapython.com/]when will generic viagra be available[/url]

    回复
  35. After checking out a few of the articles on your blog, I honestly appreciate your way of blogging. I added it to my bookmark website list and will be checking back soon. Please visit my web site too and let me know what you think.| а

    回复
  36. Having read this I believed it was extremely enlightening. I appreciate you finding the time and effort to put this informative article together. I once again find myself spending a lot of time both reading and leaving comments. But so what, it was still worthwhile!| а

    回复
  37. What’s up everyone, it’s my first pay a quick visit at this website, and piece of writing is truly fruitful in favor of me, keep up posting these types of articles or reviews.| а

    回复
  38. Hi would you mind letting me know which hosting company you’re working with? I’ve loaded your blog in 3 completely different browsers and I must say this blog loads a lot faster then most. Can you suggest a good web hosting provider at a honest price? Kudos, I appreciate it!| а

    回复
  39. Hey! I just wanted to ask if you ever have any problems with hackers? My last blog (wordpress) was hacked and I ended up losing months of hard work due to no data backup. Do you have any methods to protect against hackers?| а

    回复
  40. You can definitely see your enthusiasm within the article you write. The world hopes for even more passionate writers such as you who aren’t afraid to say how they believe. All the time go after your heart.| а

    回复
  41. Hello! I could have sworn I’ve been to this site before but after reading through some of the post I realized it’s new to me. Nonetheless, I’m definitely happy I found it and I’ll be bookmarking and checking back frequently!| а

    回复
  42. I used to be recommended this website by my cousin. I am not positive whether or not this post is written by way of him as nobody else know such certain approximately my trouble. You’re amazing! Thank you!| а

    回复
  43. Good day! This is kind of off topic but I need some advice from an established blog. Is it very hard to set up your own blog? I’m not very techincal but I can figure things out pretty quick. I’m thinking about setting up my own but I’m not sure where to start. Do you have any ideas or suggestions? Many thanks| а

    回复
  44. It’s actually a nice and useful piece of info. I am satisfied that you shared this useful information with us. Please keep us up to date like this. Thank you for sharing.| а

    回复
  45. I have been exploring for a little for any high-quality articles or blog posts on this kind of house . Exploring in Yahoo I at last stumbled upon this site. Studying this information So i am satisfied to express that I’ve a very excellent uncanny feeling I found out just what I needed. I so much indisputably will make sure to do not put out of your mind this site and provides it a look regularly.| а

    回复
  46. For latest news you have to pay a visit world-wide-web and on web I found this web site as a finest website for hottest updates.|

    回复
  47. 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!| а

    回复
  48. I do believe all the concepts you have introduced in your post. They’re very convincing and will definitely work. Still, the posts are very short for novices. May you please prolong them a bit from next time? Thank you for the post.| а

    回复

发表评论

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