0×00 关于SIM卡
众所周知SIM卡是一张插在手机上的小卡,其全称为Subscriber Identity Module 客户识别模块。不过,这个世界上并没有多少人知道SIM卡中的操作系统是基于jvm的。该系统简称SCF(Smart Card Filesystem)又称SAT(SIM Application Toolkit)。
那么这个系统能够做什么呢?
允许运营商给你的SIM卡下载固件
加密解密
读取手机数据
获取用户输入
甚至截取你的微信聊天记录
SAT系统中的文件不像Windows或Linux,它的文件名是一串8或16字节的编号,它的文件结构也十分独特,如下图:
SAT中的系统指令
READ 读取
SELECT 修改
DOWN 下载
GET 接收
等等等等....
那么你一定会说:既然是系统就一定会安全问题
确实,根据国外媒体,曾有黑客通过自制发射器录制运营商加密信息后修改,造成巴西大量市民SIM卡属性泄露,之后便再也没有报道
说了那么多,那怎么访问这个系统呢?
0×01 SIMtrace介绍
这块板使用T=0 线+ AT91SAM7 微控.
它主动接收SIM卡与手机间交流的内容并上传到电脑通过电脑程序解密转换成TCP/UDP协议的包,可以通过Wireshark获得可视化内容。
特性:
完全的主动式扫描器
能够检测到RST和ATR
支持PPS / PTS
能够分割APDUs
作为手机与卡的中间人
0×02 使用方法
将SIMtrace如下连接:
安装:
sudo apt-get install libusb-1.0--dev
git clone git://git.osmocom.org/simtrace.git
cd simtrace/host/
make
sudo groupadd osmocom
sudo adduser $USERNAME osmocom
sudo tee /etc/udev/rules.d/-osmocom.rules << EOF
# to use, install this file in /etc/udev/rules.d as -osmocom.rules
# rule to grant read/write access on SIMtrace to group named osmocom.
SUBSYSTEM=="usb", ATTR{idProduct}=="", ATTRS{idVendor}=="16c0", MODE="", GROUP="osmocom"
EOF
sudo service udev reload
运行:
sudo ./simtrace
APDU: (): a0 a4 6f 9f 0fAPDU: (): a0 c0 0f 6f 78APDU: (): a0 a4 6f 9f 0fAPDU: (): a0 c0 0f 6f 78APDU: (): a0 b0 ff 3f ff ff 3f 78APDU: (): a0 a4 6f ad 9f 0fAPDU: (): a0 b0 78APDU: (): a0 a4 6f 9f 0fAPDU: (): a0 b0 78APDU: (): a0 a4 6f 7e 9f 0fAPDU: (): a0 b0 0b ff ff ff ff f0 ff fe 78APDU: (): a0 a4 6f 9f 0fAPDU: (): a0 b0 78APDU: (): a0 a4 6f 9f 0fAPDU: (): a0 b0 78APDU: (): a0 a4 6f 9f 0fAPDU: (): a0 b0 ff ff ff ff ff ff ff ff 78APDU: (): a0 a4 6f 9f 0fAPDU: (): a0 c0 0f f0 6f
使用wireshark
socat -u udp-recv: /dev/null
./simtrace -i 192.168.0.1
接下来,就能看见你的手机和SIM卡是怎么交流的
比如SIM卡告诉手机他能干嘛
有兴趣的朋友可以继续深入研究,如给SIM卡刷入系统等,不过这一领域是毫无资料的
附上simtrace购买地址:
官方:http://shop.sysmocom.de/products/simtrace –90欧元 freebuf:http://shop.freebuf.com/item/51 –20FB