Change default username on Raspberry Pi – Thanks to Darrenjw

It is tricky to rename an account while you are logged in to it, and easy to accidentally lock yourself out of your Pi, so first enable the root account with

sudo passwd root

Use a secure password, even if you intend to lock the root account again later. Then log out and log back in as root. The rest supposes a desired username of “myuname” – replace with whatever you want.

usermod -l myuname pi
usermod -m -d /home/myuname myuname

This first renames the account and then moves the home directory associated with it. Then log out and log back in again as “myuname”. If you are still using the default password of “raspberry” on this account, do

passwd

and change password to something more secure. That should be it. Test carefully! “sudo” users seem to get updated OK, but check that your renamed account works and really does have “sudo” privileges before disabling the root account.

Should you prefer to disable the root account, do

sudo passwd -l root

Technically, this just locks the password – it doesn’t completely disable the account. But that’s probably what you want.

Shell In A Box on Raspberry Pi -Thanks to Remi Bergsma

Building and installing Shell In A Box

I want to setup Shell In A Box on my Raspberry Pi. It’s a great device running Linux that has a very small energy consumption footprint. Ideal for an always-on device I’d say!

Since there is no package available, we’ve to compile our own. It’s best to get the sources from Github (original here), since the Github repository contains some patches and fixes for issues on Firefox.

These commands install the required dependencies, clone the Git repository and start building:

apt-get install git dpkg-dev debhelper autotools-dev libssl-dev libpam0g-dev zlib1g-dev libssl1.0.0 libpam0g openssl
git clone https://github.com/pythonanywhere/shellinabox_fork
cd shellinabox_fork
dpkg-buildpackage

During my first attempt, I ran into this problem:

dpkg-source -b shellinabox-2.14
dpkg-source: error: can’t build with source format ’3.0 (quilt)’: no upstream tarball found at ../shellinabox_2.14.orig.tar.{bz2,gz,lzma,xz}
dpkg-buildpackage: error: dpkg-source -b shellinabox-2.14 gave error exit status 255

When grepping for ‘quilt’ I found a file called ‘/debian/source/format’. From what I can tell this does not do anything important, so I ended up deleting the file. Guess what, it now works.

rm ./debian/source/format

Build the package again, this should now succeed.

dpkg-buildpackage

This process will take some time (especially on the Raspberry Pi). Afterwards you’ll find the .deb file ready to be installed.

dpkg -i ../shellinabox_2.14-1_armhf.deb

I changed the configuration, to disallow the build-in SSL and to bind to localhost only. I did this because another web server will serve our terminal. I will explain in a minute.

nano /etc/default/shellinabox

And edit this line:

SHELLINABOX_ARGS="--no-beep -s /terminal:LOGIN --disable-ssl --localhost-only"

Finally, restart the deamon:

/etc/init.d/shellinabox restart

And check if all went well:

/etc/init.d/shellinabox status

You should see:

Shell In A Box Daemon is running

Another way to verify is to check the open ports:

netstat -ntl

You should see:

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 127.0.0.1:4200 0.0.0.0:* LISTEN

Setting up Lighttpd as a proxy

Shell In A Box runs on port 4200 by default. Although this can be changed to a more common 80 or even 443, this is not what I want. I decided to integrate it with another webserver, to be able to combine other services and use just one url (and one SSL certificate). Since the Raspberry Pi isn’t that powerful, I choose Lighttpd.

apt-get install lighttpd
cd /etc/lighttpd/conf-enabled
ln -s ../conf-available/10-proxy.conf

This installs Lighttpd and enables Proxy support. Now add the Proxy config:

nano /etc/lighttpd/lighttpd.conf

And add:

proxy.server = (
 "/terminal" =>
  ( (
    "host" => "127.0.0.1",
    "port" => 4200
  ) )
)

Save and restart Lighttpd:

/etc/init.d/lighttpd restart

Connect to http://pi.example.org/terminal and your Shell In A Box terminal should appear.

RPi-Monitor on Raspberry Pi

Installation

Download it from the official repository :

sudo wget http://goo.gl/NLVKa -O rpimonitor_2.1-1_all.deb

Install the dependencies by executing the following command:

sudo apt-get install librrds-perl libhttp-daemon-perl libjson-perl

Installation or upgrade can be done with the command:

sudo dpkg -i rpimonitor_2.1-1_all.deb

Execute:

sudo apt-get update && sudo service rpimonitor update

Once RPi-Monitor is configured as you wished, browse http://localhost:8888/ to access to the web interface.

OScam Auto update script for Debian – Thanks to raja for this script

#!/bin/sh

 ####################################################################
 # 1 June 2011
 # By: Raja
 # Description: Automaticaly Stop Oscam and update to latest oscam version
 # Also restart it after update
 ####################################################################
### Checking if Oscam is running, if yes then Stopping it ##########

process=`ps auxwww | grep oscam | grep -v grep | awk '{print $1}'`
 if [ -z "$process" ]; then
 echo "Oscam was not running"
 else
 echo "Stopping Oscam"
 /etc/init.d/oscam stop
 echo "Oscam stopped"
 fi

## Opening Oscam directory #####
 cd /usr/src

## Removing Old directory ######
 rm -rf oscam

### Downloading latest Version in oscam directory #######
 echo "downloading latest SVN release of oscam"
 svn checkout http://streamboard.de.vu/svn/oscam/trunk oscam
 sleep 2

## Opening new oscam directory #######
 cd oscam/

## Making new directory called build ###
 mkdir build

## Opening directory Build
 cd build/

## Compiling Oscam #####
 echo "Starting compilation of oscam with WEBIF Support,CW double check and i***** guessing"
 cmake -DWEBIF=1 I*****_GUESSING=1 -DCS_WITH_DOUBLECHECK=1 ..
 sleep 5
 echo "Compilation finished"

## Installing new version oscam #####
 echo "Now installing"
 make install
 echo "Finished installing"
 sleep 2

## Starting Oscam ######
 /etc/init.d/oscam start
 sleep 2

## Checking if successfully started ####
 echo "Please wait while I check if Oscam started"
 sleep 3
 process=`ps auxwww | grep oscam | grep -v grep | awk '{print $1}'`
 if [ -z "$process" ]; then
 echo "Oscam still not running"
 echo "Trying again"
 /etc/init.d/oscam start
 else
 echo "Oscam Running OK"
 fi
Category: DEBIAN, OSCAM  6,687 Comments

Raspberry Pi and Oscam

This tutorial is organized in 4 steps :

Step 1 – Prepare an SD-Card with a Raspbian official image and boot your Raspberry for the first time.
Step 2 – Install the packages required to compile Oscam for the Raspberry.
Step 3 – Get the source, compile and install Oscam on the Raspberry.
Step 4 – Final tweaks on your new Oscam server.

So, before we start, you are going to need to download a few tools and the Raspberry Image.
Below is the list of tools I used, there are others but these ones worked for me.

Tools Required

Win32DiskImagerhttps://launchpad.net/win32-image-writer

This tool will be used to load the Raspbian Image into the SD-Card.

Puttyhttp://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

This is an SSH and Telnet client which will be used to remotely access the Raspberry.

Filezilla FTP Client- http://filezilla-project.org/download.php?type=client

This is an FTP client that supports SFTP which will be used to send files to the Raspberry using the SFTP protocol.

Raspbian Imagehttp://www.raspberrypi.org/downloads

This is the Raspbian image which will be loaded into the SD Card (need a 2Gb card or higher).

Ok, now that you have downloaded the tools, let´s get started.

Step 1 – Prepare an SD-Card with a Raspbian official image and boot your Raspberry for the first time.

There are several images for the Raspberry. On this tutorial we are using the official Raspbian image. It comes with alot of stuff you will not use on a dedicated Oscam server, like the X server and the LXDE Enviroment but we will use this image and not remove anything because you might want to use your raspberry for other stuff while running Oscam at the same time.

  1. Extract the Raspbian image you downloaded into a folder on the computer.
  2. Insert your SD Card on the computer card reader or an external card reader.
  3. Launch the Win32DiskImager and select the image you extracted (ex: 2012-09-18-wheezy-raspbian.img).
  4. Select the drive letter of the SD Card you want to flash.
  5. Click on “Write” and wait for the process to terminate.

There are many other ways to flash the image on the SD Card as you can see here.

Now that the image is flashed, it is time to insert the card into the Raspberry and connect the power, display and network cable.

Remember that the default login for this image is :

Username : pi
Password : raspberry

At the raspberry first boot you will see a configuration menu which will allow you to setup your system (this is the raspi-config tool which you can call at any time by using the “sudo raspi-config” command).

The only changes I made on this menu was the “expand_rootfs” option because I have an 8Gb SD-Card and wanted to use the full space (by default it uses just 2Gb) and I changed my password and the timezone to correct the date/time for my country and zone.

After setting your changes I advise you to restart your raspberry.

 

Now that you have installed your image on the Raspberry it is time to prepare the system for Oscam.
You will obviously need to type some commands to install the packages, you can do this by using a keyboard connected on one of the USB ports or you can do it remotely using SSH and I recommend the SSH method because you will be able to copy & paste commands which is very useful. In order to remotely access the Raspberry SSH server, it should be connected to the network and you need to know which IP address it has acquired from the DHCP server.

After booting the raspberry there will be a message on the console which says something like “My IP address is xxx.xxx.xxx.xxx”.
After logging into the raspberry you can also type “ifconfig” and you will see the network configuration for the eth0 device. The second line should be something like “inet addr: xxx.xxx.xxx.xxx”. That is the raspberry IP address.

Now that you know which IP address is being used by your raspberry :

  1. Launch putty.exe.
  2. Type the IP address of the raspberry in the Hostname field.
  3. Click on “Open“.
  4. Accept the certificate and login with the “pi/raspberry” account.

 

The first step of this tutorial is done.
You have successfully loaded an image into your raspberry and now have remote access to the system.

Step 2 – Install the packages required to compile Oscam for the Raspberry.

Now that you are logged into the system, you will install all the packages required to compile Oscam.

You can paste the following commands into Putty by clicking the right mouse button.

First, you will update the package repositories of the APT system.

sudo apt-get update

The sudo command is used when you need to do something that requires permissions of a superuser. We use it because the “pi” account is not a superuser and system level operations like installing packages need a superuser account.

Now, let´s install the packages for compiling Oscam.

sudo apt-get install subversion cmake build-essential libssl-dev libpcsclite1 libpcsclite-dev dialog

If you are using USB smartcard readers, you will need to compile libusb.

Go to your home directory.

cd ~

Download libusb sources from sourceforge.

wget http://sourceforge.net/projects/libusb/files/libusb-1.0/libusb-1.0.9/libusb-1.0.9.tar.bz2

Extract the sources.

tar xjvf libusb-1.0.9.tar.bz2

Compile libusb and install.

cd libusb-1.0.9

./configure

make

sudo make install

Back to home directory.

cd ~

All packages required for compiling Oscam have been installed.

Step 3 – Get the source, compile and install Oscam on the Raspberry.

Now that you have all the required tools to compile Oscam, let´s get the source from the SVN repository.

svn checkout http://www.streamboard.tv/svn/oscam/trunk oscam-svn

(or svn co http://www.oscam.to/svn/oscam/trunk oscam-svn -r ***x)

Get inside the sources folder.

cd oscam-svn

Make the folder where the compiled binaries will be created.

mkdir build

Get inside the folder.

cd build

Prepare the build using cmake.

cmake ..

Compile Oscam

make

Install Oscam

sudo make install

If everything went smooth without any errors, you should now have Oscam installed on your system.
The oscam binary should now be located at /usr/local/bin.

By default oscam will attempt to read the configuration files located at /usr/local/etc so we have to copy the files into it.

Let´s change the ownership of the configuration folder so you are able to upload files using the SFTP client using the pi account.

sudo chown pi.pi /usr/local/etc –R

  1. Launch Filezilla FTP Client
  2. Open the Site Manager and create a new site.
  3. Select protocol “SFTP – SSH File Transfer Protocol”.
  4. Select Logon Type “Normal”.
  5. Type your raspberry username and password and click “OK”.
  6. Navigate to /usr/local/etc folder and upload your oscam configuration files.

Note : If you don´t have any configuration files already created, check /home/pi/oscam-svn/Distribution/doc/example.

To test you new Oscam server, type

sudo oscam

Congratulations, you have successfully compiled and installed Oscam on your Raspberry.
If you want to learn how to setup oscam to start on boot and set a fixed IP address, check the next step.

Step 4 – Final tweaks on your new Oscam server.

On this step you will be able to set oscam like a daemon which will be started when the system boots and set a fixed IP address.

Setting up a fixed IP address.

This is quite simple. You just need to edit a file and restart the interface.

Edit the network configuration file.

sudo nano /etc/network/interfaces

Find the line that reads “iface eth0 inet dhcp” and replace with the following lines.

iface eth0 inet static

address 192.168.1.11

netmask 255.255.255.0

network 192.168.1.0

broadcast 192.168.1.255

gateway 192.168.1.1

Replace the IP address to reflect your own network settings.

Now restart the network service.

sudo /etc/init.d/networking restart

If you are using SSH to edit the settings, you will be disconnected because you restarted the network.
You can now connect to the Raspberry using the new IP address.

 

Category: OSCAM  3,748 Comments

Cleaning up problems with NMAP on Mac OS X

With the latest version, 5.61, I did the following to get the GUI interface running again:

1) Unhide your otherwise hidden files. If you don’t know how to do this, use the Terminal.

2) Under /usr/local/bin/ delete ncat, ndiff, nmap, and nping (Shell: sudo su root, rm ncat, etc..)

3) Under /usr/local/share/ delete the ncat and nmap directories. (Shell: rm -r ncat, rm -r nmap)

4) Under /Applications delete the Zenmap application icon.

5) Empty your trash.

6) Open the latest download of NMAP (i.e. the dmg file) and run the executable.

If you’ve cleaned up properly, you can now click on the Zenmap icon and run NMAP just fine.

Category: APPLE  4,401 Comments

Screenshot tool for Backtrack 5

Here is the Quick way to get Screenshot tool in Backtrack 5.

For Backtrack 5, GNOME version has default disabled screenshot tool.So we need to install gnome utils to get that tool enabled.
Copy and paste the below command into a terminal:
apt-get install gnome-utils
Now you can see the screenshot tool available under accessories > screenshot
For KDE version:
Copy and paste the below command into a terminal
apt-get install ksnapshot

How to install gogoc on mac osx

Running gogo6 Client on Mac OS X

1. Install Apple XCode if not installed yet, this comes with Snow Leopard installation DVD. For help see http://www.mactricksandtips.com/2010/02/installing-xcode.html

2. Install MacPorts if not installed yet, get from www.apple.com/downloads/macosx/unix_open_source/macports.html

3. Open a shell and enter the following commands :

sudo port install vpnc

sudo port load tuntaposx

4. Retrieve the source archive from the Freenet6 download area for gogoCLIENT 1.2 Source Code (Linux/Unix/MacOS/BSD), at http://gogonet.gogo6.com/profile/gogoCLIENT , place it in a temporary directory, preferably /tmp because directory with spaces will fail

5. Go to the temporary directory in step 4 and decompress the file using this command :

tar -xvf gogoc-1_2-RELEASE.tar.gz

6. After decompressing go to the gogoc-tsp directory

7. Generate the gogoc executable by entering the following commands:

make all

make installdir=/usr/local/gogoc install

Note that superuser privileges may be needed above

8. To modify the username/password or enable routing advertisments modify the gogoc.conf file in the /usr/local/gogoc/bin directory

9. Change dir to /usr/local/gogoc/bin

10. Enter the following to run :

sudo ./gogoc to execute

11. Check out http://ipv6.google.com and http://www.v6.facebook.com which will only work if you have a working IPv6 Public address. Also test the connection at www.test-ipv6.com

12. To stop gogoc run this command :

killall gogoc

Category: IPV6  2,993 Comments

Come installare Reaver su Backtrack 5

Reaver è il programma delle meraviglie per craccare le reti con WPS attivo.

Infatti è in grado in poche ore di trovare il PIN WPS del router e la key WPA della connessione.

Backtrack è la distro migliore per effettuare test sulla vulnerabilità della nostra rete.

Per installare Reaver possiamo fare in due modi o in linea o offline avendo l’archivio di reaver già scaricato.

Passo 1.Scaricare Reaver:

digitate dal terminale il seguente indirizzo:

wget http://reaver-wps.googlecode.com/files/reaver-1.4.tar.gz

Passo 2.Estrarre Reaver:

Ora digitate da terminale il seguente codice:

tar zxvf reaver-1.4.tar.gz

Passo 3. Installazione:

Ora seguite i seguenti comandi:

cd reaver-1.4/src

Configuriamo i comandi:

./configure

Comando Make:

make

Installazione:

make install

Ora è tutto installato e potete già usarlo.Per visualizzare tutti i comandi basta digitare sul  terminale la stringa:

reaver