Results 1 to 6 of 6

Thread: Top Configuration Changes after installing Kali Linux on Raspberry Pi 2

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Top Configuration Changes after installing Kali Linux on Raspberry Pi 2

    First off I'd like to say great job on the Raspberry Pi edition of Kali Linux.

    Before starting this tutorial I'm assuming that you have already installed a fresh image of Kali Linux on your Raspberry Pi

    This tutorial will focus on portability so once you plug your Raspberry Pi 2 in to power it on you don't have to connect a monitor, mouse or even an ethernet cable if on wifi just power will be sufficent. The only suggestion in the future would be to remove vino as it's terribly buggy for these kind of remote applications but we will fix this.

    Kali linux by default uses
    Code:
    /usr/lib/vino/vino-server --sm-disable
    in startup applications however vino-server isn't the greatest it's very buggy for doing remote access without a screen atached so I recommend tightvncserver instead of fixing the broken vino-server as it's much easier than dropping into source code.

    Lets Start!

    Plug in with HDMI, keyboard and mouse to follow along till we are done here

    Login with default password root and toor

    type startx then press enter to get to the GUI but you don't have to

    open a terminal or if you are not in the GUI you should have one already

    Change the root password
    Code:
    passwd
    Now enter a new password of your choice

    With that out of the way lets begin!

    --GET NETWORK INTERFACES WORKING--
    Set Network Manager management to true (why this is not set to true by default, who knows...)
    Code:
    nano /etc/NetworkManager/NetworkManager.conf
    set managed=false to managed=true then save

    Code:
    service network-manager restart
    Now your ethernet port should not say this "not managed"... yet again they really need to change this


    --GET VNC SERVER ON BOOT WORKING--
    Install tightvncserver (this is more than likely already installed)
    Code:
    sudo apt-get install tightvncserver
    --VNC SERVER ON BOOT--
    Create new file called vncboot in init.d directory to create the vnc server as a service
    Code:
    nano /etc/init.d/vncboot
    Put in the following
    Code:
    ### BEGIN INIT INFO
    # Provides: vncboot
    # Required-Start: $remote_fs $syslog
    # Required-Stop: $remote_fs $syslog
    # Default-Start: 2 3 4 5
    # Default-Stop: 0 1 6
    # Short-Description: Start VNC Server at boot time
    # Description: Start VNC Server at boot time.
    ### END INIT INFO
    
    #! /bin/sh
    # /etc/init.d/vncboot
    
    USER=root
    HOME=/root
    
    export USER HOME
    
    case "$1" in
     start)
      echo "Starting VNC Server"
      #Insert your favoured settings for a VNC session
      su - root -c "/usr/bin/vncserver :0 -geometry 1280x800 -depth 16 -pixelformat rgb565"
      ;;
    
     stop)
      echo "Stopping VNC Server"
      /usr/bin/vncserver -kill :0
      ;;
    
     *)
      echo "Usage: /etc/init.d/vncboot {start|stop}"
      exit 1
      ;;
    esac
    
    exit 0
    Make it executable with 755 permissions and update to be default service on boot
    Code:
    chmod 755 /etc/init.d/vncboot
    update-rc.d vncboot defaults
    Now start the service (this is needed to set the default password for your vnc server)
    Code:
    service vncboot start
    It will prompt you the first time to enter a password for your vnc server enter your password once the confirm it and for view only use 'n' and enter
    The vncserver now should be started and will start on boot.

    --AUTO BOOT AND LOGIN STARTX--

    The problem you will have now is that when you boot your Raspberry Pi you will not have access to vnc on boot if it doesn't login automatically for you to do this complete the following:
    Code:
    nano /etc/inittab
    Add # in front of this line
    Code:
    1:2345:respawn:/sbin/getty 115200 tty1
    Add this below the line we commented out:
    Code:
    1:2345:respawn:/bin/login -f root tty1 </dev/tty1 >/dev/tty1 2>&1
    Now we need to edit ~/.profile
    Code:
    nano ~/.profile
    Add the following just before the last line of code
    Code:
    if [ -z "$DISPLAY" ] && [ $(tty) == /dev/tty1 ]; then
    /usr/bin/startxfce4
    fi
    --EXTRA GOODIES--
    If not seeing colors in terminal bugs you as much as it does me, uncomment these lines in ~/.bashrc:
    Code:
    export LS_OPTIONS='--color=auto'
    eval "`dircolors`"
    alias ls='ls $LS_OPTIONS'
    alias ll='ls $LS_OPTIONS -l'
    alias l='ls $LS_OPTIONS -lA'
    If you want to set a cool ssh login message for your Raspberry Pi like this cool one:
    Code:
    █ ▄▄   ▄ ▄      ▄   █ ▄▄  ▄█ 
    █   █ █   █      █  █   █ ██ 
    █▀▀▀ █ ▄   █ ██   █ █▀▀▀  ██ 
    █    █  █  █ █ █  █ █     ▐█ 
     █    █ █ █  █  █ █  █     ▐ 
      ▀    ▀ ▀   █   ██   ▀
    Just edit this file and drop your message in there
    Code:
    nano /etc/motd
    If you want to disable the last login portion of the banner on ssh login edit this file
    Code:
    nano /etc/ssh/sshd_config
    Then change PrintLastLog yes to PrintLastLog no and save

    If you want to change the name of your Raspberry Pi hack machine edit this file
    Code:
    nano /etc/hostname
    Keep in mind metasploit from the repositories is having issues at this time but I will update this tutorial with that information once I figure it out.

    I also at somepoint be adding how to turn one of your wifi adapters on this to a hotspot so you can connect to the pi over wireless and use it for wireless pentesting too

    Happy pen-testing!

    -lillypad
    Last edited by lillypad; 2015-05-12 at 13:22.

Similar Threads

  1. wlan0 configuration for raspberry pi 3 Model B
    By sjens76 in forum ARM Archive
    Replies: 0
    Last Post: 2021-01-30, 13:23
  2. Installing Kali Linux on a Raspberry Pi 3 Model B +
    By KaliTut in forum Installing Archive
    Replies: 0
    Last Post: 2019-07-28, 14:26

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •