- Download Android SDK, NDK, system and kernel source code;
- Download modified lxc and libcap source code (ppoffiec/lxc-android, ppoffice/libcap-android)
- Build Android system from source first so that we can link to its shared library when we build lxc (or maybe we don't have to);
- Modify Android kernel config and make sure lxc-checkconfig does not report any missing features. Then build kernel;
- Modify Android
system/core/rootdir/init.rc
according toinit.rc.diff
. Make sure you mount all the cgroup subsystems needed (cpu, cpuacct, cpuset, memory, pids, devices, freezer, blkio) under/sys/fs/cgruop
, otherwise lxc won't find them; - Rebuilt the Android system image so that the modified init.rc is in the image;
- Fire up the emulator with custom kernel (
emulator -kernel kernel-file-path
) and use adb shell and dmesg to check if everything is doing ok.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x = '\xE7\xBB\xBF\xE8\x89\xB2\xE5\x81\xA5\xE5\xBA\xB7\xE5\xB0\x8F\xE6\xB8\x85\xE6\x96\xB0'; | |
x.split('').map(i => (j = i.charCodeAt(0).toString(2), i.charCodeAt(0) > 127 ? j : new Array((4 - (j.length % 4)) % 4).fill('0').join('') + j)).map((i, j, k) => (l = i.match(/^0|^1{2,4}0/), l ? m = new Array(l[0] === '0' ? 1 : l[0].length - 1).fill(0) : m = [], m.map((o, r) => r === 0 ? i.slice(l[0].length, i.length) : k[j + r].slice(2, k[j + r].length)))).filter(i => i.length).map(i => String.fromCharCode(parseInt(i.join(''), 2))).join(''); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Modified from ivandavidov/minimal-linux-script | |
# https://github.com/ivandavidov/minimal-linux-script | |
# This script includes a dynamic linked busybox, openssl, python and | |
# network support | |
set -ex | |
KERNEL_VERSION=4.17.2 | |
BUSYBOX_VERSION=1.28.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get Pre-reqs | |
apt-get install libattr1-dev git unzip make gcc automake pkg-config | |
# Get Android NDK | |
cd /root | |
mkdir -p build && cd build | |
wget http://dl.google.com/android/repository/android-ndk-r10e-linux-x86_64.zip -O /tmp/android-ndk-r10e-linux-x86_64.zip | |
unzip /tmp/android-ndk-r10e-linux-x86_64.zip -d /root/build | |
# Set paths |
- CNC Server: 192.168.1.12:23 (cnc.local:23)
- Report Server: 192.168.1.12:48101 (cnc.local:48101)
- Loader Server: 192.168.1.13
- Bot Binary Host: http://192.168.1.13:80/bins/mirai.*
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Tuple | |
import pyasn1.codec.der.encoder | |
import pyasn1.type.univ | |
import base64 | |
import rsa | |
def private_key_pem(n: int, e: int, d: int, p: int, q: int, dP: int, dQ: int, qInv: int) -> str: | |
'''Create a private key PEM file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# recompile kernel first with patch: | |
# https://github.com/postmarketOS/pmbootstrap/blob/4b10acc2535033414cd4f358433a51626096d7ce/aports/device/linux-lg-hammerhead/06_fix_mdss_fb_rgb_mode.patch | |
git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8 \ | |
-b marshmallow-mr1-release \ | |
~/arm-eabi-4.8 | |
git clone https://android.googlesource.com/kernel/msm \ | |
-b android-msm-hammerhead-3.4-marshmallow-mr1 \ | |
~/msm | |
git clone https://github.com/osm0sis/mkbootimg.git ~/mkbootimg | |
cd ~/msm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2020 ppoffice | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this softwareand associated documentation files(the "Software"), to | |
// deal in the Software without restriction, including without limitation the | |
// rights to use, copy, modify, merge, publish, distribute, sublicense, and /or | |
// sell copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions : | |
// | |
// The above copyright noticeand this permission notice shall be included in |
-
Install Termux, an Android terminal emulator that provides a Linux execution environment and various tools.
-
Update system packages in Termux:
$ pkg update -y
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cd / | |
tar -cvpzf backup.tar.gz \ | |
--exclude=/backup.tar.gz \ | |
--exclude=/proc \ | |
--exclude=/tmp \ | |
--exclude=/mnt \ | |
--exclude=/dev \ | |
--exclude=/sys \ | |
--exclude=/run \ |
OlderNewer