Simjacker


Testing your sim locally :
You can get the latest SIMTester code here v1.9

# nano /etc/apt/sources.list

add this line

deb http://deb.debian.org/debian/ jessie

# apt update# apt install gcc-4.8 g++-4.8 gcc-8 g++-8
# update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 400 --slave /usr/bin/g++ g++ /usr/bin/g++-4.8
# update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 800 --slave /usr/bin/g++ g++ /usr/bin/g++-8
# update-alternatives --install /usr/bin/java java /usr/lib/jvm/java-13-openjdk-amd64/bin/java 13
# update alternatives --config java

choose 13

# update alternatives --config gcc

choose 4.8

# apt install build-enssential libtool libtalloc-dev shtool autoconf automake git-core make gcc libpcsclite-dev pkg-config libgmp3-dev libmpfr-dev libx11-dev libx11-6 texinfo flex bison libncurses5 libmpfr4 libmpc-dev zlibc zlib1g-dev libncursessw6 libncurses5-dev libncursesw5-dev libncurses5-dbg openjdk-13-jdk
# cd ~
# git clone git://git.osmocom.org/libosmocore
# cd libosmocore
# git checkout 0.11.0
# autoreconf -fi
# ./configure
# make -j8
# make install
# ldconfig -i
# apt remove texinfo
# cd /root
# wget http://ftp.gnu.org/gnu/texinfo/texinfo-4.13.tar.gz
# gzip -dc < texinfo-4.13.tar.gz | tar -xf -
# cd texinfo-4.13
# ./configure
# make
# make install
# git clone https://github.com/axilirator/gnu-arm-installer.git gnuarm
# cd gnuarm

Run this scripts:

# ./download.sh
# ./build.sh
# export PATH=$PATH:/root/gnuarm/install/bin
# cd ~
# git clone git://git.osmocom.org/osmocom-bb
# cd osmocom-bb
# git checkout luca/libosmosim
# git clone https://github.com/bbaranoff/osmocombb-patch
# patch -p1 < osmocombb-patch/test.patch
# patch -p1 < osmocombb-patch/test2.patch
# make -j8
# nano /root/osmocom-bb/src/host/layer23/src/libosmosim/libosmosim.h

change #include <jni.h>
by #include </usr/lib/jvm/java-13-openjdk-amd64/include/jni.h>

# nano /usr/lib/jvm/java-13-openjdk-amd64/include/jni.h

change #include "jni_md.h"
by #include "/usr/lib/jvm/java-13-openjdk-amd64/include/linux/jni_md.h"

# cp ~/osmocom-bb/src/layer23/src/libosmosim/.libs/libosmosim.so /usr/lib/x86_64-linux-gnu/jni/.
# cd ~

# wget https://opensource.srlabs.de/attachments/download/180/SIMTester_v1.9.zip

# unzip SIMTester_v1.9.zip

RUNNING

Shell 1

# cd ~/osmocom-bb/src/host/osmocon/
# ./osmocon -c ../../target/firmware/board/compal_e88/layer1.highram.bin

Shell 2

cd ~/SIMTester_v1.9
# java -jar SIMTester.jar -tf OsmocomBB

4 thoughts on “Simjacker”

  1. Hi all , firstly Thanks for this post , second it’s not work for me on Kali x64 , i just download jdk-7u80-linux-x64.tar.gz and run like this-> java -Djava.library.path=/usr/lib/x86_64-linux-gnu/jni -jar SIMTester.jar -stbs -tf OsmocomBB -d , i tried ran with java 8 but it’s not work because of this ->
    file — OsmoCard.java:77

    public void disconnect(boolean not_really_reset) throws CardException {
    // documentation says this should be TRUE to reset the card, but there is a bug in Java (reverse logic), nobody knows when and if it will ever get fixed (https://bugs.openjdk.java.net/show_bug.cgi?id=100151), 2012-04-01, the bug is still present in 1.6.0_31
    if (not_really_reset) {
    if (_channelOpened) {
    OsmoCardTerminal._osmojni.simPowerdown();
    }
    OsmoCardTerminal._osmojni.exit();
    OsmoCardTerminal._initialized = false;
    } else {
    boolean cardPresent = OsmoCardTerminal._osmojni.simReset();
    if (!cardPresent) {
    throw new CardException(« Card is not present in the phone! »);
    }
    }
    }
    }

Leave a Reply