Do you have old late 90s or early 2000s cell phones lying around? Are they going to waste? Here's how you can resurrect them into a mini working cell network so you can feel nostalgic again.
Tools needed:
- Ubuntu 22.04 (I could not get it to work with anything newer)
- BladeRF xA4 (https://www.nuand.com/product/bladeRF-xA4)
- A couple antennas (https://www.nuand.com/product/tri-band-antenna/)
- A case (https://www.nuand.com/product/micro-case/)(Optional)
- Sysmocom programmable sim card (https://shop.sysmocom.de/Omnikey-CardMan-6121-USB-CCID-interface-2FF-sized/cm6121)
- USB SIM card writer (https://shop.sysmocom.de/Omnikey-CardMan-6121-USB-CCID-interface-2FF-sized/cm6121) (After all you need a way to program the sim cards)
- An old cell phone that supports 2G or 3G GSM
- And a little patience, the process is tricky
The process below is very hacky. I had a lot of trial and error until I got it right.
# Install bladeRF drivers
add-apt-repository ppa:nuandllc/bladerf
apt update
apt install bladerf libbladerf-dev automake libusb-1.0-0-dev libusb-1.0-0 build-essential cmake libncurses5-dev libtecla1 libtecla-dev pkg-config git wget bladerf-fpga-hostedxa4 python3-pip
# Install yate
wget https://nuand.com/downloads/yate-rc-2.tar.gz
tar -xvf yate-rc-2.tar.gz
cd yate
./autogen.sh
./configure --prefix=/usr/local
./configure --prefix=/usr/local
make
make install
ldconfig
# Install Apache web server with PHP extensions
add-apt-repository ppa:ondrej/php
apt-get install subversion autoconf libgsm1-dev libgusb-dev libusb-1.0-0 libusb-1.0-0-dev
apt update
apt-get install php5.6 apache2
cd /var/www/html
ln -s /usr/local/share/yate/nipc_web/ nipc
touch /usr/local/etc/yate/snmp_data.conf /usr/local/etc/yate/tmsidata.conf
chown root:yate /usr/local/etc/yate/*.conf
addgroup yate
usermod -aG yate ezluzvaerus
usermod -aG yate root
chown root:yate /usr/local/etc/yate/*.conf
chmod -R a+rw /usr/local/etc/yate
# Install pysim
pip3 install pysim
apt-get install --no-install-recommends pcscd libpcsclite-dev python3 python3-setuptools python3-pycryptodome python3-pyscard python3-pip
git clone git clone https://gitea.osmocom.org/sim-card/pysim.git
git clone https://gitea.osmocom.org/sim-card/pysim.git
cd pysim/
pip3 install -r requirements.txt --user
apt-get install libusb1-devel
cd /var/www/html/nipc
vi /var/www/html/nipc/config.php
sed -i '/<?php/ c\<?php\n$pysim_path = "/usr/local/bin";' /var/www/html/nipc/config.php
vi /etc/apache2/sites-enabled/000-default.conf
service apache2 restart
/usr/local/bin/pySim-prog.py
chmod +x /usr/local/bin/pySim-prog.py
/usr/local/bin/pySim-prog.py
cd /usr/local/bin
ln -s /usr/src/pysim/pySim-prog.py pySim-prog.py
rm /usr/local/bin/pySim-prog.py
ln -s /usr/src/pysim/pySim-prog.py pySim-prog.py
pySIM_Path=`which pySim-prog.py`
echo -e "\e[1;32mPySIM Installed To: $pySIM_Path\e[0m"
# Harden some things
echo "install cramfs /bin/true" >> /etc/modprobe.d/CIS.conf
echo "install freevxfs /bin/true" >> /etc/modprobe.d/CIS.conf
echo "install jffs2 /bin/true" >> /etc/modprobe.d/CIS.conf
echo "install hfs /bin/true" >> /etc/modprobe.d/CIS.conf
echo "install hfsplus /bin/true" >> /etc/modprobe.d/CIS.conf
echo "install squashfs /bin/true" >> /etc/modprobe.d/CIS.conf
echo "install udf /bin/true" >> /etc/modprobe.d/CIS.conf
echo "install dccp /bin/true" >> /etc/modprobe.d/CIS.conf
echo "install sctp /bin/true" >> /etc/modprobe.d/CIS.conf
echo "install rds /bin/true" >> /etc/modprobe.d/CIS.conf
echo "install tipc /bin/true" >> /etc/modprobe.d/CIS.conf
echo "* hard core 0" >> /etc/security/limits.conf
echo 'fs.suid_dumpable = 0' >> /etc/sysctl.conf
sysctl -p
echo 'ulimit -S -c 0 > /dev/null 2>&1' >> /etc/profile
systemctl disable avahi-daemon
systemctl disable triggerhappy.service
systemctl disable bluetooth.service
# Install python bindings for BladeRF
cd libraries/libbladeRF_bindings/python/
python3 setup.py install