All Projects → Exeinspa → Exein Openwrt Public

Exeinspa / Exein Openwrt Public

Licence: gpl-3.0
Openwrt 18.06.5 featured with the Exein's security framework

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Exein Openwrt Public

Exein
Exein core for Linux based firmware
Stars: ✭ 158 (+338.89%)
Mutual labels:  firmware, linux-kernel, embedded, security-tools
Embedos
EmbedOS - Embedded security testing virtual machine
Stars: ✭ 108 (+200%)
Mutual labels:  firmware, embedded, security-tools
Iot Pt
A Virtual environment for Pentesting IoT Devices
Stars: ✭ 218 (+505.56%)
Mutual labels:  firmware, embedded, security-tools
Libuhttpd
A very flexible, lightweight and fully asynchronous HTTP server library based on libev and http-parser for Embedded Linux.
Stars: ✭ 302 (+738.89%)
Mutual labels:  openwrt, embedded
drone-cortexm
ARM® Cortex®-M platform crate for Drone, an Embedded Operating System.
Stars: ✭ 31 (-13.89%)
Mutual labels:  embedded, firmware
Drone Core
The core crate for Drone, an Embedded Operating System.
Stars: ✭ 263 (+630.56%)
Mutual labels:  firmware, embedded
firmware-core
nodewatcher firmware.
Stars: ✭ 26 (-27.78%)
Mutual labels:  firmware, openwrt
Xkcptun
xkcptun is kcp tunnel for OpenWRT&LEDE, implemented in c language
Stars: ✭ 419 (+1063.89%)
Mutual labels:  openwrt, embedded
Keyberon
A rust crate to create a pure rust keyboard firmware.
Stars: ✭ 355 (+886.11%)
Mutual labels:  firmware, embedded
Awesome Embedded And Iot Security
A curated list of awesome embedded and IoT security resources.
Stars: ✭ 500 (+1288.89%)
Mutual labels:  firmware, embedded
Emba
emba - An analyzer for Linux-based firmware of embedded devices.
Stars: ✭ 607 (+1586.11%)
Mutual labels:  firmware, security-tools
firmware
The Firmware for the Freifunk Bielefeld Community
Stars: ✭ 23 (-36.11%)
Mutual labels:  firmware, openwrt
OpenWare
Firmware for OWL devices
Stars: ✭ 23 (-36.11%)
Mutual labels:  embedded, firmware
Iotgoat
IoTGoat is a deliberately insecure firmware created to educate software developers and security professionals with testing commonly found vulnerabilities in IoT devices.
Stars: ✭ 275 (+663.89%)
Mutual labels:  firmware, openwrt
xiaomi-r3g-openwrt-builder
OpenWrt builder for any supported routers using Docker. Scheduled to run weekly
Stars: ✭ 25 (-30.56%)
Mutual labels:  firmware, openwrt
Openwrtinvasion
Root shell exploit for several Xiaomi routers: 4A Gigabit, 4A 100M, 4, 4C, 3Gv2, 4Q, miWifi 3C...
Stars: ✭ 366 (+916.67%)
Mutual labels:  firmware, openwrt
Linuxboot
The LinuxBoot project is working to enable Linux to replace your firmware on all platforms.
Stars: ✭ 554 (+1438.89%)
Mutual labels:  firmware, linux-kernel
Broadcom Bt Firmware
Repository for various Broadcom Bluetooth firmware
Stars: ✭ 677 (+1780.56%)
Mutual labels:  firmware, linux-kernel
Diamorphine
LKM rootkit for Linux Kernels 2.6.x/3.x/4.x/5.x (x86/x86_64 and ARM64)
Stars: ✭ 725 (+1913.89%)
Mutual labels:  linux-kernel, security-tools
HandsomeMod
IOT freedom for end users!
Stars: ✭ 39 (+8.33%)
Mutual labels:  firmware, openwrt

This repository has been moved to

https://github.com/Exein-io/exein-openwrt

Exein

Exein framework's goal is to accomplish the task of protecting the target system from undesirable behavior, introducing the self-protecting and remote-monitoring set of tools into the embedded systems arena.

splash

The natural position of a piece of software providing Run-time anomaly detection features is within the Linux kernel using the Linux Security Module ecosystem.

The task of analyzing the system behavior enumerating system's event is divided into three macro functions:

  • Collecting event at OS level (LSM Exein)
  • Providing a mean of communication between kernel space section and the userspace applications (Exein_interface)
  • Analyzing them using machine learning algorithms (MLEPlayer)

The LSM Exein is the part of the Exein solution which interfaces with the Linux kernel and exports the system events data to the userspace application module for the analysis. Its main functions are:

  • Interfacing with the Linux Kernel
  • Collecting the events flows
  • Enforcing policies dictated by the MLEPlayer

The Exein_interface is the glue that makes it possible for the userspace MLEPlayer to communicate with the LSM Exein. It accomplishes this task by defining a new protocol within the Linux Netlink stack. It also provides userspace tools for debugging purposes.

The next part of the list is the code part where the actual computation is performed by the machine learning algorithms. The code block element is called MLEPlayer.

The MLEPlayer embodies the following functions:

  • Receives data from the Exein_interface
  • Sends policies to the Exein_interface
  • Triggers the machine learning algorithm on the supplied data

design

User space

  • libexnl: the library implements the NetLink agent in charge for collecting data, registers the application to the kernel and keeps this registration active. It also provides functions for fetching data and pushing policies.
  • MLEPlayer: Using Tensorflow 2.0.0 it performs the actual computation, tracking the target application behavior.

Kernel

  • LSM: this module is embedded within the Linux Kernel image, it collects data from applications and exports them to the requiring MLEPlayers.
  • LKM: This Linux Kernel Module provides Netlink interface to the MLEPlayer, and some useful tools for debugging the solution.
  • patch/exec/task_struct: In order to make the solution work, few patches to the original Linux Kernel are required. To be more specific, in order to track a process it needs to be easily recognized among others. The patch allows an executable tagged in its ELF header to bring this tag to its task struct, and therefore to be recognized among the others.

Example

The example shown in this repository represents the porting of the Exein's solution to the Openwrt ecosystem.
Exact versions in use are:

  • Openwrt 18.06.5
  • Linux Kernel 4.14.151

Users can easily test the solution in an emulated environment by following these steps:

  1. Download the repository
  2. Make the config.exein the current openwrt configuration by using cp config.exein .config
  3. Run the make utility
  4. Run with qemu-system-arm by issuing the following command
sudo qemu-system-arm -M virt -nographic -smp 1 -kernel bin/targets/armvirt-exein/32-glibc/openwrt-armvirt-exein-32-zImage-initramfs -append "rootwait root=/dev/vda console=ttyAMA0 loglevel=0 norandmaps" -netdev tap,ifname=tap0,id=eth0 -device virtio-net-device,netdev=eth0
  1. After the system has started, activate the MLEPlayer by issuing the following
# dmesg |grep Exein
[    0.001962] ExeinLSM - lsm is active: seed [857594974]
[    9.280018] ExeinLKM - Interface module load complete. Interface ready.
# tf-exein 857594974 /etc/exein/config-13107.ini /etc/exein/model-13107.tflite

Test an Exein protected application

test-example

To make you taste how an Exein protected application performs, this repo has been equipped with the OpenWrt HTTP server behavior model.

Worth to note that the HTTP root directory also includes a trojan CGI-script located at http://192.168.1.1/cgi-bin/vuln.cgi which lets an attacker obtain a reverse shell to TCP:192.168.1.2:4919.

During the test you should observe that regular traffic to the server is allowed, whereas the anomal behavior of an HTTP server instance acting as a shell is detected and terminated.

Looking at the MLEPlayer output, you should see something like the following:

Starting Exein monitoring for tag: 13107
libexnl staring up
Now checking pid 835
INFO: Initialized TensorFlow Lite runtime.
Now checking pid 4432
Now checking pid 4438
Removing pid 4432
Now checking pid 4463
Removing pid 4463
Now checking pid 4481
Block process: 4438
Removing pid 4438
Removing pid 4481

Here's a brief description of most meaningful parts:

  • The first line Starting Exein monitoring for tag: 13107 indicates that the MLEPlayer instance is watching at the tag 13107, the tag assigned to the HTTP server.

Tags are a central concept of the Exein framework. They act as classifiers and let the Exein framework identify the target processes and their children. Tags are basically 16-bits identifiers that are embedded into executables by adding a section within the ELF header ad are checked every time the executable is ran.

  • As traffic to the server starts, one by one, the HTTP server processes are added to the watchlist.

Now checking pid 835 notifies the process 835 was added to the watchlist.

  • As soon as anomalies are detected, the MLEPlayer acts asking the LSM to take action against the abnormal process (see Block process: 4438 message).
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].