Hacking Instructions for the Nokia 800 Tough (aka Bananaphone with KaiOS)

Overview

Nokia 800 Tough

Hacking Instructions for Arch Linux host system. I don't care about your messed up Windows, sorry.

1. Android Platform Tools

Install the Android Platform Tools on the host machine. On Arch Linux, you can do that by installing the android-tools package:

sudo pacman -S android-tools android-udev;

2. Web IDE

The KaiOS Phone comes with an outdated boot2gecko firmware, and development on that version has stopped around Firefox 59. In order to make things work with each other, it is recommended to install the Firefox 52.9.0 ESR version from Mozilla's Archive server.

When speaking of WebIDE, that's the window that you can open by starting Firefox, clicking on the (Menu Icon) > Developer > WebIDE or use Shift + F8 as a shortcut.

If that Menu isn't visible and/or your phone doesn't appear when connected via USB, read the next point.

3. Fix Mozilla's Certification Authority Fuckup

Mozilla uses SSL certificates to sign XPI extensions, which is bad because it will automatically brick old extensions when the lifetime of the SSL certificate is over, which happened by mistake early 2020 - and also has affected our outdated Firefox ESR version.

In order to fix this for our local (technically outdated) Firefox ESR installation, we need to do the following:

  • Visit about:config and set devtools.webide.enabled to true.
  • Visit about:config and set xpinstall.signatures.required to false.
  • Install the ADB Helper Extension.
  • Restart the Browser.
  • Open a new Tab, open the Browser Console (Ctrl + Shift + K or Inspect Element > Console Tab).
  • In the Browser Console enter "allow pasting" without the quotation marks and press Enter.
  • Paste and execute the Enable Extensions snippet.
  • Restart the Browser again.

Afterwards, the New Tab Page will keep crashing (thanks, Mozilla telemetry services that don't work anymore due to shut down services -_-) but that's kind of expected.

4. Connecting WebIDE with the Bananaphone

Activate the adb daemon on the banana phone by dialing the following sequence. As the Nokia 800 Tough has a T9 keyboard debug means 33284.

*#*#debug#*#*

Now connect the USB cable to the host machine, and check whether or not your bananaphone is listed there:

adb devices; # should list the bananaphone

If you want, you can explore now what the device looks like by executing adb shell.

By default, you don't have root rights and no sudo binary installed, so you shouldn't be able to break anything that you can't restore via factory reset later.

If you start the WebIDE after the bananaphone is showing up via adb devices, it should look like this:

WebIDE Screenshot 1

5. Bananaphone Filesystem

The filesystem has 5 partitions, and it looks very familiar to an Android device:

  • /system contains the operating system, including preinstalled web apps.
  • /data contains all user data, including installed apps.
  • /cache.
  • /persist.
  • /modem contains the modem firmware.

The device also has an old Linux 3.10.49 kernel running, which might come handy later in case we need a user-privilege escalation exploit (and if the rooting instructions fail).

[$] adb shell;
shell@Nokia 800 Tough:/ $ mount;
(...)
/dev/block/bootdevice/by-name/system /system ext4 ro,seclabel,relatime,discard,data=ordered 0 0
/dev/block/bootdevice/by-name/userdata /data ext4 rw,seclabel,nosuid,nodev,noatime,discard,noauto_da_alloc,data=ordered 0 0
/dev/block/bootdevice/by-name/cache /cache ext4 rw,seclabel,nosuid,nodev,relatime,data=ordered 0 0
/dev/block/bootdevice/by-name/persist /persist ext4 rw,seclabel,nosuid,nodev,relatime,data=ordered 0 0
/dev/block/bootdevice/by-name/modem /firmware vfat ro,context=u:object_r:firmware_file:s0,relatime,uid=100

shell@Nokia 800 Tough:/data $ uname -a
Linux localhost 3.10.49-g58c036c69ff #1 SMP PREEMPT Sat Dec 7 08:58:31 CST 2019 armv7l

6. KaiOS Web App Structure

KaiOS is based on FirefoxOS (also known as boot2gecko or b2g). The filesystem structure and where things are hint into that direction. If we take a look at the /system/b2g/webapps/webapps.json file, we see an index of all installed web apps.

It seems that Web Apps on KaiOS are just HTML5 single-page apps that can be either hosted locally or online. For example, the Google Maps KaiOS Manifest is just an online manifest file that will be requested each time you open up the Google Maps web app on KaiOS.

[$] adb shell;
shell@Nokia 800 Tough:/ $ cat /system/b2g/webapps/webapps.json;
(...)
  "snake.gaiamobile.org": {
    "origin": "app://snake.gaiamobile.org",
    "installOrigin": "app://snake.gaiamobile.org",
    "receipt": null,
    "installTime": 1575680915112,
    "updateTime": 1575680915112,
    "manifestURL": "app://snake.gaiamobile.org/manifest.webapp",
    "localId": 53,
    "appStatus": 3,
    "manifestHash": "b4922f7b1bdcc1ef762c63a2cfb819c9"
  },
(...)

shell@Nokia 800 Tough:/ $ cd /system/b2g/webapps/snake.gaiamobile.org;
shell@Nokia 800 Tough:/system/b2g/webapps/snake.gaiamobile.org $ ls -la
-rw-r--r-- root     root      1903492 2008-12-31 17:00 application.zip
-rw-r--r-- root     root          450 2008-12-31 17:00 manifest.webapp

Each Web App is namespaced into their own FQDN (fully qualified domain name), and in their equivalent folder contain an update.webapp file and an application.zip which contains the locally mounted assets.

7. KaiOS Operating System Details

The installed KaiOS version can easily be identified by taking a look at the /system/b2g/application.ini or the /system/b2g/platform.ini file.

As we can also see, KaiOS 2.5.2 ships with Firefox 48.0.a2, which is vulnerable to the buffer overflow and use-after-free vulnerability CVE-2020-26950. This vulnerability even has a metasploit module available on packetstormsecurity, so this might come in handy, too.

[$] adb shell;
shell@Nokia 800 Tough:/ $ cat /system/b2g/application.ini;

[App]
Vendor=KaiOS
Name=B2G
RemotingName=b2g
Version=2.5.2
BuildID=20191207090036
ID={3c2e2abc-06d4-11e1-ac3b-374f68613e61}

[Gecko]
MinVersion=48.0a2
MaxVersion=48.0a2

[XRE]

[Crash Reporter]
Enabled=1
ServerURL=https://crash-reports.kaiostech.com/submit?id={3c2e2abc-06d4-11e1-ac3b-374f68613e61}&version=2.5.2&buildid=20191207090036

8. Hardware Drivers

The Nokia 800 Tough uses the Qualcomm MSM8909 system-on-a-chip.

shell@Nokia 800 Tough:/ $ getprop ro.board.platform;
msm8909

9.a) Rooting via OmniSD

There are multiple ways to root your phone, and a lot of messed up workflows in between. Documented here is what's most compatible with adb, fastboot and those workflows in regards to backing up the device, flashing newer system images or sideloading Apps.

// TODO: Document OmniSD Rooting Procedure

9.b) Rooting via Wallace Toolkit

// TODO: Document Wallace Rooting Procedure

9.c) Rooting via Exploit

// TODO: Document Firefox RCE / Linux Privilege Escalation Rooting Procedure

You might also like...

Short sample and instructions for configuring a Flutter Web application to deploy-on-push to Firebase Hosting

Short sample and instructions for configuring a Flutter Web application to deploy-on-push to Firebase Hosting

Nov 17, 2022

A User Interface for calling a program's instructions

Anchor Test UI Testing Anchor programs can be lenghty and overwelming So we thought of a Cool Way of Testing Anchor program without writing an Testing

Sep 3, 2022

Node js package makes creating node jd dependincies files like Controllers,Entities and Repositories easier by executing a few instructions

Node js package makes creating node jd dependincies files like Controllers,Entities and Repositories easier by executing a few instructions

Nodejs Studio Node js package makes creating node js project dependincies files like Controllers,Entities and Repositories easier by executing a few i

Oct 12, 2022

This repository contains the Solidity smart contract of Enso, a detailed list of features and deployment instructions.

Enso NFT Smart Contract This repository contains the Solidity smart contract of Enso, a detailed list of features and deployment instructions. We stro

Apr 24, 2022

aka Scaletor, take screenshots of a piece of a map and scale/compare with other parts of the map

scale-a-tron A quick-and-dirty map that lets you compare one area to another. Draw a shape around a region, zoom in to another place on the map, and c

Nov 7, 2022

Plugin that lets you create diagrams from textual representation (aka 'Diagrams as Code') within Logseq

Plugin that lets you create diagrams from textual representation (aka 'Diagrams as Code') within Logseq

Logseq - Diagrams as Code Plugin that lets you create diagrams (and other visualizations) from textual representation (aka 'Diagrams as Code') within

Dec 21, 2022

TypeScript plugin for service-to-service (aka. "functionless") cloud integrations.

Functionless λ Functionless is a TypeScript plugin that transforms TypeScript code into Service-to-Service (aka. "functionless") integrations, such a

Jan 2, 2023

🎲 Extract one or more random elements from a weighted array (aka loot table or gacha)

wrand Extract one or more random elements from a weighted array. const items = [ { original: "Bronze", weight: 20 }, { original: "Silver", weight:

Dec 2, 2022

a tweaked hackchat client. aka hackchat++.

hackchat-client-plus A tweaked hackchat client. aka hackchat++. Most code are from https://github.com/hack-chat/main. Hosted at https://hcer.netlify.a

Dec 24, 2022
Owner
Cookie Engineer
I like purple cybersec. Backpropagated ES/HyperNEAT+Instinct AI creator. Open Source Idealist.
Cookie Engineer
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
An api named Crypto Versus, a multiplayer versus hacking simulator. Project still in the making!

Crypto Versus A Multiplayer Versus Hacking Simulation Inspired by the Steam game Bitburner Table of content Possible ouputs for all endpoints routes /

null 3 Jan 29, 2022
Hacking Prodigy, the math game.

Website • Discord • Installation • YouTube How to install See our Quickstart Guide. Info We aren't evil. We aren't evil. Everything is open source, fo

Prodigy P-NP 30 Dec 19, 2022
A pokemon-like project game where you level up by hacking your neighbor.

CTF BourgPalette A pokemon-like project game where you level up by hacking your neighbor. You play as a new hacker. You are not trying to capture all

VB 23 Dec 27, 2022
Clone of the Fallout hacking mini-game, rendered into a browser canvas.

kodenkel-fo-hacking Clone of the Fallout hacking mini-game, rendered into a browser canvas. You can try it out at: https://www.kodenkel.com/games/fo-h

Gabor Major 14 Dec 19, 2022
A powerful, extensible, customizable & rapidly develop hacking framework.

YourN3xt(Beta) A powerful, extensible, customizable & rapidly develop hacking framework. Installations Github: https://github.com/OTAKKATO/YourN3xt N

OTAK 4 Nov 21, 2022
This repo contains instructions on how to create your NFT in Solana(using Metaplex and Candy Machine) and mint it using your custom front-end Dapp

Solana-NFT minting Dapp Create your own NFT's on Solana, and mint them from your custom front-end Dapp. Tools used Metaplex -> Metaplex is the NFT sta

Udit Sankhadasariya 12 Nov 2, 2022
A POC of a Discord.js bot that sends 3D rendering instructions to a Go server through gRPC which responds with the image bytes which are then sent back on Discord.

A POC of a Discord.js bot that sends 3D rendering instructions to a Go server through gRPC which responds with the image bytes which are then sent back on Discord.

Henrique Corrêa 5 Jan 8, 2022