Silly Kali Linux script for Mobian SD card
#1
Hey all,

I wrote a kind of dumb script to turn your phone into a cyberpunk accessory. Since Kali and Mobian are both based off Debian all it really does is take a Mobian install and remove most of the packages, then add the Kali repositories to apt and install all the tools. When done it takes up about 30 GB (if more of the base OS can be removed, please let me know. I'm no expert on this. Also if packaging this into an image is an option, I'm all ears). It also adjusts the theme and background, and changes the default username from 'mobian' to 'h4x0r' (obviously). I'd also change my ssh port to '1337' but that's just

If you're pretty new to Linux but with aspirations to become a world-class (white-hat) hacker you can:


- install Mobian to an SD card, following the instructions here: https://wiki.mobian-project.org/doku.php?id=install. Just a note, that if you install an encrypted version via the installer it will alter the UUID of the eMMC-LUKS-partition if you already have an encrypted version of Mobian on you eMMC. Instructions for restoring the original OS can be found here: https://gitlab.com/mobian1/issues/-/issues/235. I'm not sure how this bug affects other installs.


- open up a terminal (King's Cross) in Mobian and type:


Code:
nano 1337.sh

- copy this script into it:


Code:
#! /bin/bash

# get rid of all crap. h4x0r has no time for games
apt purge gnome-2048 gnome-authenticator gnome-calculator gnome-calendar gnome-chess gnome-clocks evince firefox-esr fractal geary lollypop gnome-maps gnome-todo gnome-weather telegram-desktop gnome-software gnome-sound-recorder gnome-software-plugin-flatpak nemo file-roller gedit totem epiphany-browser gnome-contacts -y && apt autoremove -y

# here check to make sure you're getting the good stuff
apt-key adv --keyserver pool.sks-keyservers.net --recv-keys ED444FF07D8D0BF6
# and you want the good stuff
echo 'deb http://http.kali.org/kali kali-rolling main contrib non-free' | tee -a /etc/apt/sources.list > /dev/null

# live in the now
apt update && apt dist-upgrade
# get rid of old kernel to stop small boot partition from complaining
apt purge linux-image-5.9-sunxi64

# load up toolbelt (least important)
apt install kali-tools-*

# look the part (most important)
apt install kali-themes
gsettings set org.gnome.desktop.interface gtk-theme 'Kali-Dark'
gsettings set org.gnome.desktop.background picture-uri 'file:///usr/share/backgrounds/kali/kali-neon.xml'

# how can you be mobian? you are h4x0r (this part taken from mobian wiki)
old="mobian"
new="h4x0r"
# Home paths
ohp="home/$old"
nhp="home/$new"

# Change username
for file in group gshadow passwd shadow subgid subuid
do
    sed -i "s/$old/$new/g" /etc/$file*
done

# Rename home folder
mv /$ohp /$nhp

# Fix path references in /home for new user
grep -rl "$ohp" /$nhp | xargs sed -i "s+$ohp+$nhp+g"

# Set user info
echo
chfn $new
sync

# like 1337 phoenix, you are reborn
reboot

- save and exit by typing Ctrl-x and saying yes


- make the file executable with


Code:
chmod +x 1337.sh


- run the script with elevated privileges


Code:
sudo ./1337.sh



I've tried to comment everything in the script so folks can customize as necessary. Any recommendations are also welcome.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Genode- Sculpt OS for the PinePhone (non Linux) Surehand53 1 978 11-04-2023, 07:23 PM
Last Post: tllim
  Does Ubuntu modify a Pinephone SD boot card? Peter Gamma 0 867 10-05-2023, 09:18 AM
Last Post: Peter Gamma
Photo Mobian with X11 without Wayland and Phosh. Manieck71 0 952 09-09-2023, 07:35 AM
Last Post: Manieck71
  External SD card not listed by Pcmanfm? Peter Gamma 1 1,541 08-22-2023, 12:22 PM
Last Post: Peter Gamma
  Arch Linux on PinePhone Rocky-IV 4 9,791 12-21-2022, 04:35 AM
Last Post: gregb49
  Mepo - Minimalist and hackable OSM map viewer for mobile linux mil 22 14,570 10-31-2022, 07:29 AM
Last Post: mil
  Control HBIAS through a linux OS twiclo 0 1,018 10-04-2022, 03:20 PM
Last Post: twiclo
  difference between android and linux? vanja 3 2,128 09-16-2022, 07:43 PM
Last Post: TRS-80
  meet franz! (whatsapp,telegram,etc linux client) vanja 0 1,110 09-15-2022, 01:23 AM
Last Post: vanja
  Enable 'upcoming-events' on Mobian/Phosh Korac 3 2,235 09-14-2022, 01:19 AM
Last Post: dukla2000

Forum Jump:


Users browsing this thread: 1 Guest(s)