Pages

Friday, 11 October 2013

DIY自己的手机通信系统

看到一个利用自建伪基站来屏蔽运营商网络并接管覆盖范围内的手机,发送诈骗短信被警方连窝端掉的新闻,瞬间把我惊呆了。所有的伪基站设备来自于一家深圳山寨小工厂,直到事发,卖出去了很多套,价格还很便宜,5块一套就可以了。如果不是模拟到了正常用户的号码,被举报。可能公安与运营商都会一直认为是通过运营商网络发的。买这套系统的不仅仅是用来发转帐,银行卡信息的诈骗电话。还有用来发运营商干的最多广告群发信息。

1、发信人号码可根据客户需要设置成106开头客户的客服电话或联系方式,更显尊贵(特服号码不能设置);
2、收信人可根据客户需要,搜集客户周边最大半径6公里范围内的移动、联通用户,轻松锁定周边目标客户群;
3、可根据客户需要缩小或扩大用户收集范围;
4、工作人员直接携带设备到客户现场操作,确保真实有效,诚信可靠;
5、发送率高,设备可边收集号码边发送信息,最高1小时可发送1万条信息;
6、100%保证所收集的号码都是正常使用的手机用户,不存在重发、漏发从而导致的资源浪费;
7、适合大型商场、超市、医院、门诊部、房地产、门店开业、教育、贷款等各行业的广告宣传。

从上面的特征可以看出来,这纯粹就是运营商没有发展做起来的小区基站短信业务,拉着这基站去火车站,机场发订房,机票广告,这效果几万块钱分分钟就挣出来了。

看到这让我惊呆了的伪基站,我非常来了解其中的技术实现原理。原来我有研究过openbts,通过USRP开源实现GSM基站是容易的,但这种系统都需要自己再做过sim卡来接入自制的基站。这个深圳伪基站是怎么实现本来就是联通,移动的GSM手机终端接入自己的基站了,这个涉及到联通,移动的SIM卡加密系统了啊。知乎果然有跟我一样同样疑问的人,伪基站实现原理,移动基站是如何被假冒的?从这个问题的回答可以看出来,原来这个伪基站是利用基站与手机之间认证一个漏洞,基站对手机有认证,而手机对基站没有认证,手机直接跟据基站发布的UE信号直接选择信号强的基站就登录了。这个伪基站呢,也没有跟手机再做进一步的沟通,建立什么数据通道,通话通道之类的。直接拿到手机IMSI码就随便发短信了,到手机上要显示什么号码就伪基站自己说了数。

从伪基站的实现功能上来讲,他就是用USRP硬件(软件无线电硬件部分)+openbts(基站交换系统)+GNUradio(软件无线电协议编码软件部分)开源软件实现的一个GSM基站,完了车子拉到闹市上,以高功率发射基站信号,让周围手机注册到自己上面来。再群发小区短信。但如果想要监听、截获、修改用户的来电和短信,或者让手机可以通过伪基站完成所有的打电话,发短信,用GPRS的功能。那么伪基站要做的事情就还很多了。

首先伪基站需要破解联通,移动基站与手机之间的通信加密,才有可能实现双向通信。这也是我初一看到伪基站被惊呆了的原因,他是怎么破解掉这个加密的。原来深圳山寨货跟本没破解这玩意,直接在第一次交互上欺骗下手机而已。好消息就是GSM的加密早在2009年的黑帽大会就有牛人破解了。并且在黑帽大会成功演示了伪基站欺骗GSM手机注册,通信的全过程。还有个好消息是GSM手机因为是标准生产的,加密不加密是由基站说了算的,用什么加密方式反正也就是GSM标准定义好的。

其次伪基站需要接入通信网站,才有可能实现手机打电话,发短信。除非手机打的电话,发的短信的对方同属于同一个伪基站系统。所以伪基站系统必须要通过freeswitch这种开源的VOIP软交换系统接入国际通信网。这里有一个在树霉派上实现移动基站有详细讲实现的办法。

How to shrink a basestation into a Raspberry Pi

最后伪基站要想完成接入GSM终端的管理,他还得有一套完整的终端管理系统与业务支撑系统。

从上面的介绍可以看出来,要DIY一个自己的GSM通信系统,看来是很容易的。深圳山寨的伪基站都有点价格过高了。老外的直接架在raspberry pi上的解释方案多便宜。rpi上可以跑openBTS,freeswitch,管理系统,再通过USRP进行GSM信号发射与接收,两设备都接入同一个以太网。

但这里我想到了前面rpi直接通过GPIO实现的广播发射台的应用。是不是可以直接通过GNUradio软件直接通过rpi的GPIO针脚实现USRP硬件功能呢。毕竟USRP设备一般都好几千,前面老外在rpi上用的USRP B100就有650美金,在GNUradio中文社区里面的也得好几千人民币。如果能找到一个用GPIO针脚+GPIO驱动程序实现USRP的AD,DA功能就省钱了。找了半天只找一个用RTL-2832U实现接收DVB电视的SDR软件无线电方案,这个坑爹的是单向接收的.

相关帖子: http://briteming.blogspot.co.uk/2013/08/blog-post_9834.html
----------------------------------------------------------

How to shrink a 30ft base-station into a three-inch Raspberry Pi

How to shrink a 30ft base-station into a three-inch Raspberry Pi

One of the biggest innovations in recent years has been the Raspberry Pi platform. This $30 Linux-based computer, about the size of a credit card, is targeted at educating the next generation of software and hardware engineers in programming. Recognising its potential, we teamed up with the Raspberry Pi Foundation to launch a competition (now closed to new entrants) that challenged schoolchildren, students and programmers to use a Raspberry Pi to make the world a better place.
Meanwhile, to evaluate what the platform was capable of, our wireless experts at the PA Technology Centre got hold of a Raspberry Pi to see if we could implement a mobile phone base-station that could run our own private mobile-phone network.
Overcoming some seriously complex obstacles along the way, we successfully managed to route voice and SMS traffic through the computer – as well as implement the GSM mobile phone standard. If you are developing your entry into the competition and are looking for inspiration – or are just interested in what can be done with this exciting new technology – please watch our video.
We shrank a 30ft base-station into a three-inch Raspberry Pi by:
  • setting up our Raspberry Pi in a screened-room facility to ensure we didn’t break any laws on frequency spectrum
  • hooking up the Raspberry Pi to a radio interface
  • hand-optimising some of the software
  • code-optimising the signal processing – we are experts in this and needed to use all our skills to get parts of the code running fast enough.
The Raspberry Pi was used to set up three pieces of software:
  • OpenBTS – this implements the GSM mobile phone standard
  • FreeSWITCH – this routes calls in a similar way to Skype
  • our own python features – a programming script that assigns telephone numbers to colleagues.

    from http://www.paconsulting.com/our-experience/how-to-shrink-a-base-station-into-a-raspberry-pi/ ,
    http://www.cambridgenetwork.co.uk/news/how-pa-shrunk-30-ft-mobile-phone-basestation-into-3in-computer/
    ---------------------------------------------------
    PA's competition challenges entrants to use a Raspberry Pi to make the world a better place - http://www.paconsulting.com/raspberry...
    Here our experts use one to create a basestation for our own mobile-phone network.

    If you are developing your entry into the competition and are looking for inspiration -- or are just interested in what can be done with this game-changing new technology -- please take a look.

    One of the technology highlights of 2012 has been the Raspberry Pi platform. This $30 Linux-based computer, about the size of a credit card, is targeted at educating the next generation of software and hardware engineers in programming. Recognising its potential, we teamed up with the Raspberry Pi Foundation to launch a competition (now closed to new entrants) that challenged schoolchildren, students and programmers to use a Raspberry Pi to make the world a better place. For more information on the Raspberry Pi competition: http://bit.ly/WJjrZw

    Meanwhile, to evaluate what the platform was capable of, our wireless experts at the PA Technology Centre got hold of a Raspberry Pi to see if we could implement a mobile phone base-station that could run our own private mobile-phone network.

    If you are developing your entry into the competition and are looking for inspiration -- or are just interested in what can be done with this exciting new technology -- take a look at the PA video.

    For more on PA's technology and innovation capabilities, visit: http://www.paconsulting.com/technology

    相关视频: http://www.youtube.com/watch?v=GCcKgrzbix4