Saturday, March 6, 2021

Kali-Linux on Chromebook / Crostini (LXC/LXD linux container)

Intro

let me first state that this is not the normal intended use of containers.
In the normal use case containers are supposed to be ephemeral.
However, in this specific use case I want to use it as a light-weight virtual machine, and therefore I do want to keep it's state at all times. 
---


Objective: 

  1. Running a Kali-Linux docker-container inside the Crostini LXC/LXD- Debian-container on a Chromebook. 
  2. Keeping an up-to-date Kali-Linux image with any updates, pen-test-data, and changes made inside the active kali-Linux container so it is easy to create new and/or transport containers with all the latest changes and data. (back-up image with the current state of the current container)

Assumptions:

The Linux-container is active on your Chromebook

 

Linux-Terminal @ Chromebook


Setup Docker:

  1. Update your Debian LXC/LXD container:

    sudo apt update && upgrade -y

  2. Install dependencies:

    sudo apt install -y \
    apt-transport-https ca-certificates \
    curl gnupg2 software-properties-common


  3. Import gpg-key:

    curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -

    (note: don't forget the "-" at the end of the line!)

  4. Add the docker repo to the source list:

    sudo add-apt-repository \
    "deb [arch=amd64] https://download.docker.com/linux/debian \
    $(lsb_release -cs) stable"

  5. Update the new resources:

    sudo apt update

  6. Install the docker engine (community edition):

    sudo apt install -y docker-ce docker-ce-cli containerd.io


Saturday, August 1, 2020

VPN Gateway VM in VirtualBox (with Kill Switch)

PDF - version

Setup:

  • A Linux host PC (Ubuntu 18.04/20.04) Running an up-to-date Virtual Box.
  • Guest: A headless Virtual server (Ubuntu 18.04/20.04)
  • Valid VPN account with a 3rd party. (in my case: NordVPN)

Goal:

  • Start the virtual machine (guest) headless as a service when booting the Host machine.
  • The VM must be able to log in automatically as a service without manually providing account credentials 
  • The VM uses a bridged network so it has a reachable IP on the LAN
  • Using the VM-IP as a gateway for devices that need a VPN connection.
  • No other outbound connection possible for devices using this gateway when the VPN-connection to NordVPN goes down, No internet connection is available.

Sunday, April 26, 2020

Install Node.js from binaries on your Linux system


Of course, you can install Node from installer scripts or use the repository version from your distribution. But if you are like me and want to have full control of what version you want to use for your projects, the binary install is the way to go.
Alternatively, you could use the nvm (node version manager) to achieve the same.
But I like to keep things simple and clear. 



Step 1:

Download the version you want to use from the node website.
At the time of this writing, the version latest version file: node-v14.0.0-linux-x64.tar.xz

Step 2:

Extract the tar-file to the location of your liking. ( ~/node-v14.0.0)

Step 3:

Edit either your .bashrc or .profile file to add the path to your node-folder.
I prefer to use my .bashrc file as I add many other handy things in there, and distribute it to all my systems


edit ~/.bashrc 

and add the following lines

# ---------------------
# Node-js settings:
# ---------------------
export NODEJS_HOME=~/node-v14.0.0
export PATH=$PATH:$NODEJS_HOME/bin


Step 4:

Refresh .bashrc or .profile or simply exit terminal and open again

Step 5:

Test the version of node and npm

~$ node -v 
> v14.0.0

~$ npm -v 
> v6.14.4